ERROR: sh: can't map '/lib/libc.so.5'

Posted on 1997-07-24
Medium Priority
Last Modified: 2013-12-15
My hw is i386SX 25MHz, 4MB RAM, VGA, 40MB Linux Native, 10MB Linux Swap, SoundBlaster with CD 2x, WD 80x3 Ethercard.

I install Slackware96 with "sbpcd" bootdisk and "color" rootdisk. I just install A series disks (default options). Since I have just 4MegRAM, I must activate swapping manually before setup. Sbpcd kernel recognizes my Slackware CD. So far so good.

After installation (no problem), I restart my machine from HDD, login as root and try to execute (before anything) the command:

man man

And I get these errors:

sh: can't map '/lib/libc.so.5.3.12'
sh: can't map '/lib/libc.so.5'
fgets: No such file or directory
Error reading man page /usr/man/man1/man1.gz
No manual entry for man

These also happen when I try to run 'setup' again, or any program such 'less'. If I do 'ls' before one of these errors, it works fine, but after them it crashes too. Seems that executing a medium sized program crashes my system, but I don't understand why I *can* run 'setup' booting from installation disks under the same conditions, and I can't boot from the same kernel installed in my hard disk.

Sure! Both libraries do indeed exist under /lib and libc.so.5 is a link to libc.so.5.3.12... 'setup' takes care or it.

What's more, I have the same distribution working fine in a Pentium 120, 16MB RAM, 300MB Linux Native, 32MB Linux Swap, ATAPI CD.

i386's hard disk (QUANTUM LP52 A 950 509 105, 49MB w/64kB cache, CHS=751/8/17) seems not to have badblocks.

With all these data... What the hell is messing me?
Thank you for your answers, please reply by e-mail if possible.

P.S.: I've been told that this might be a memory problem, so I've tried to enlarge swapping to 16MB, but nothing changes, and, as you can see I can't enlarge it much more.
Question by:lgv
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 51

Expert Comment

ID: 1628873
Try to install the kernel (and all applications) in the a.out binary format.

Expert Comment

ID: 1628874
Try to do : ldconfig -v
and watch the result to find your libc.
then try to launch applications again to see if it is corrected

Author Comment

ID: 1628875
Yeah, right. I've wasted tons of time till I realized. Ashaming. Not as subtle as I thought.
Well, with 4MB RAM, before running Slackware's setup you have to activate swap space manually. I thought this meant that you didnt't have to touch that option inside the program... WRONNNNNG...
You must activate that option, don't let the program execute 'mkswap' nor 'swapon' and... LET IT ADD THE PROPER LINE TO /etc/fstab.
If you don't, or don't add this line inmediately after booting from HD and reboot again, obviously you are left with about 2.5MB RAM (physical and virtual, since you don't have swapping space).
Well, I'm grateful to every people which tried to help (Vlad The Impaler <wrightl@tahoma.cwu.edu> did suggesting I should run 'free', which was indeed what I had to do to realize my mistake)


Expert Comment

ID: 1628876
4 MB of RAM is *NOT ENOUGH*.  I'm running 16 MB of RAM and 32 MB of swapfile, and when I leave Xwindows running for a couple days or so on my RedHat system, I get the 'Can't map libc' error message myself.  What Linux is trying to tell you is, you've exhausted your availiable memory, therefore, it can't load libc into mem.

Considering that RAM prices are at a 10 year low, I'd look into upgrading your system RAM as much as you can afford.  32 megs should be fine, if your machine will take it.  Just remember to increase your swap space if you can, as well.  The rule of thumb on swap space is, twice physical memory if under 64 megs, and equal to physical memory if over 64 megs.

Accepted Solution

JeffVoskamp earned 200 total points
ID: 1628877
It's a swap/memory problem.  Each program wants to keep a copy of the libraries in it's address space.  With only 4M of memory and no swap space this only allows a few processes to start up before the kernel realizes that it can't honour these requests for memory.  with a "/dev/XXXX  swap swap defaults" line in your /etc/fstab (where XXXX is your swap partition) the setup scripts
will enable the swap space and now you have 12.5M for memory.

Note that only 10M of swap space is very low if you plan on doing
any development work (gcc and friends eat memory) or if you're
running X.  Your setup will work, but expect to hear/see a lot
of disk access.  An extra 4M of RAM could add months/years to the life of your harddrive.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question