Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Good day!

While trying to recover a box to lenny it seems I've broken things. It upgrades libc and glib after that dpkg seems to be broken.

I can run apt-get, but it gets segmentation fault from dpkg:

# apt-get -f install
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 316 not upgraded.
9 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
/bin/sh: line 1:  4606 Segmentation fault      /usr/sbin/dpkg-preconfigure --apt
E: Sub-process /usr/bin/dpkg received a segmentation fault.

I can login via SSH but even ls is not working:

# ls
Segmentation fault

Is there anything I can do remotelly via SSH?

    # ldd /bin/ls
    linux-gate.so.1 =>  (0xffffe000)
    librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7fc8000)
    libacl.so.1 => /lib/libacl.so.1 (0xb7fc2000)
    libselinux.so.1 => /lib/libselinux.so.1 (0xb7fac000)
    libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7e51000)
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7e3f000)
    /lib/ld-linux.so.2 (0xb7fd8000)
    libattr.so.1 => /lib/libattr.so.1 (0xb7e3b000)
    libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7e37000)
    libsepol.so.1 => /lib/libsepol.so.1 (0xb7df6000)

It seems I've temporary fixed it with:

 # touch /etc/ld.so.nohwcap

From here: http://saintaardvarkthecarpeted.com/blog/archive/2005/08/_etc_ld_so_nohwcap.html

share|improve this question
    
Can you execute other commands like less to view log files? –  Khaled Feb 4 '11 at 11:45
    
Yes, less, tail work. –  artvolk Feb 4 '11 at 12:03
add comment

1 Answer

I think you should enable core file dumping by ulimit -c unlimited and run the failing program to get a coredump then. If you are lucky and gdb is installed and not segfaulting, you can analyze a coredump in place by gdb -c core.pid. It will show you at least an address of failing instruction so you will able to guess the failing lib from that address. If gdb is not installed, try to scp the coredump to some other host. Next step is probably to replace the failing lib by some other version from some other host by scp.

share|improve this answer
    
It seems I've fixed it temporary with touch /etc/ld.so.nohwcap –  artvolk Feb 4 '11 at 14:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.