Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 25855  / 2 Years ago, fri, october 14, 2022, 8:10:05

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)


More From » bash

 Answers
4

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.


[#32522] Sunday, October 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lawain

Total Points: 150
Total Questions: 106
Total Answers: 101

Location: China
Member since Mon, Aug 22, 2022
2 Years ago
lawain questions
;