5

example of the problem:

$ su
Segmentation fault
$ sudo ls
Segmentation fault

I tried to compile sqlite3 from source earlier. I don't know what libraries it installed. This may be the reason why this is happening.

I tried strace su and it ends with the following:

...
fstat64(6, {st_mode=S_IFREG|0644, st_size=17964, ...}) = 0
mmap2(NULL, 20788, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 6, 0) = 0xb7295000
mmap2(0xb7299000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 6, 0x3) = 0xb7299000
close(6)                                = 0
mprotect(0xb7299000, 4096, PROT_READ)   = 0
mprotect(0xb72f9000, 4096, PROT_READ)   = 0
set_tid_address(0xb758a728)             = 11144
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

When I try gdb su and try to run, it gives me Cannot find new threads: generic error. I looked online for a solution to the problem, encountered this thread, and then tried running LD_PRELOAD=/lib/i386-linux-gnu/libpthread.so.0 gdb su (as suggested in the thread). When I then tried to run it again, it gave me the same error.

Based on the strace, I think there is some problem with how it's threading, but I have no idea how to fix this. Is there some way to reinstall the basic bash utilities?

Here's more information about my system:

$ uname -a
myhost 3.2.0-37-generic-pae #58-Ubuntu SMP Thu Jan 24 15:51:02 UTC 2013 i686 i686 i386 GNU/Linux

(I'm pretty sure the hardware is 64bit)

4 Answers 4

2

Use aptdcon, which communicates with apt-daemon via dbus so it doesn't need su or sudo, to reinstall the damaged packages. Probably your best chance is to reinstall ALL the packages.

First, make sure there is no broken install pending a fix:

aptdcon --fix-install

Also make sure there is free space available on your disk:

df -h

Then, get your currently installed package list:

echo \"$(dpkg --get-selections | grep install | cut -f 1)\"

Save that for later, on a text editor of something. Then, call aptdcon like this, using the full package list:

aptdcon --reinstall "package1 package2 package3..."

I'm telling you this way because aptdcon won't be able to reinstall some packages for various reasons, so you will have to strip them out if aptdcon cries about that, and try again, probably more than once.

1
  • Thanks! I ended up just having to reinstall the sqlite packages via aptcon, as you suggested. Feb 24, 2013 at 23:12
0

I saw this problem, but the root cause was slightly different. I had been testing Kerberos and had something misconfigured in my /etc/krb5.conf. I discovered via strace that sudo was segfaulting shortly after reading that file so I figured there was an issue with my configuration file. I didn't track down a specific variable but one thing that stood out was that I had the default_domain variable empty in the krb5.conf like so

[libdefaults]
   default_realm = 

This may have cause some sloppy code in sudo to make a zero length string and mishandle it somehow causing the SIGSEGV. I didn't try to debug it any further since this wasn't the correct setting. I simply deleted my /etc/krb5.conf.

0

There is a chance that a pam module from samba is causing this.

If that's the case, then this should fix it:

  • Reboot the machine and choose to boot to the recovery mode. If you can't see the recovery mode, then you first need to choose the 'Advanced options for' option.
  • Choose "drop into root shell" from the recovery menu
  • Execute the command: dpkg --purge libpam-smbpass
  • Execute the command: dpkg --purge libpam-winbind

Then you should be able to use 'su' and 'sudo' again.

You then may want or need to do a

  • sudo apt-get -f install

to help fix any remaining broken packages.

If you need the libpam-smbpass and/or libpam-winbind package, or have a broken 'samba' package, you may find that you have to delete or rename /var/lib/samba/secrets.tdb:

  • sudo mv /var/lib/samba/secrets.tdb /var/lib/samba/secrets.tdb.old

Source/Related: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/260687

0

If you have the problem as the OP encountered, you cannot do what Jorge Suárez de Lis suggested, as it will throw a dependencies error.

So,

aptdcon --reinstall "libsqlite3-0"

and

aptdcon --install "libsqlite3-0"

returns the error message:

ERROR: org.debian.apt.TransactionFailed - error-cache-broken: The following packages have unmet dependencies:

While doing THIS:

aptdcon --fix-depends

will fix it, and su and sudo will work again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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