[Bug 4550] Segfault in Busybox while installing Ubuntu 11.10

bugzilla at busybox.net bugzilla at busybox.net
Fri Feb 24 23:05:36 UTC 2012


https://bugs.busybox.net/show_bug.cgi?id=4550

--- Comment #29 from Franz A. <james at wolke7.net> 2012-02-24 23:05:35 UTC ---
Hi Denys,

Yes, I was also wondering, where the "segfault ..." text came from. I could not
find it in your source code.

So, I tried several things in the past few days, with little success:
- Added a printf right after the sigaction, that activates the segfault
handler. And indeed, it proofed the activation. And so it also proofed, that
"my" busybox was in use during the installation. But still I got the "segfault
..." without backtrace.

- I guessed, that the segfault maybe happens in the shell area. So, I added
your segfault_handler also to ash.c. Almost the same result: activation printf
seen many times. Again no backtrace. Only the strange "segfault ..." message.

- Added code to force a SEGV in a place, that I could access at will: In the
set command output: { char *ptr=NULL; *ptr='a'; }. And indeed, I got a
backtrace.

- So maybe it came from an other place within busybox. Added the segfault
handler also to the main in appletlib.c. Same result: no backtrace.

- Found, that you set signal handlers in various places. Not for SEGV, but for
other signals. Just in case I overlooked something, I commented out all the
other sigactions. Again no backtrace. Slowly running out of ideas ...

- Maybe the "segfault ..." came from a default handler in some standard
library. So I made a 3-line-program:

#include <stdio.h>
int main (int argc, char **argv)
{ char *ptr=NULL; *ptr='a'; }

$ gcc x.c
$ ./a.out
Segmentation fault
So, it was not the standard message either. Maybe from a different library.

- Searched for the text in busybox: strings busybox | grep segf ... nothing,
even though it was statically linked.

- Last idea (not tried yet, because your answer came before that): I saw, that
you set the default SIG_DFL for several signals. Maybe commenting out these
would get me to the backtrace.

- I searched for the text "segfault" in libraries and found it in several of
them. But I tried this (in a shell on my dev PC, not during installation):
$ export LD_DEBUG=files
$ ./busybox sh
/tmp/initrd_tmp/bin $ exit
$ ./busybox init
init: must be run as PID 1
In other words: No additional library loaded. No big surprise, busybox was
statically linked.

So, now I know, that the text is not IN busybox and there is no additional
library. But still it is printed. Very strange.


A possible explanation:
The segfault happens very late during the installation, after installing more
than 100 packages, including the busybox package. This is just a thesis, I do
not know, if it really happens during the installation, if it would make any
sense to do it. But if the installation procedure's init would 'exec' the
busybox from the newly installed busybox package, then it would still have
PID=1 but it would be a different executable. Possibly with the segfault
message in it. What do you think about this (weird) idea?

I will run your "kill -SEGV 1" test, when I can access my test PC again in a
few days.

Do you have any other idea, where the message might come from?

Best regards
Franz

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list