We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

lgv
lgv asked
on
Medium Priority
653 Views
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.
Comment
Watch Question

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

Commented:
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
lgv

Author

Commented:
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)

Commented:
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.
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.