Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

571 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