Hello.

I've an "interesting" case here, when busybox (in debian)
segfaults when run in initramfs as pid == 1, when invoking
awk applet (PREFER_APPLETS is set to yes).  I can't trigger
it with pid != 1, and since pid=1 is special in linux,
I can't really debug it too.

To complicate things further, it looks like reverting a
trivial debian-only patch fixes this issue, but I suspect
it fixes only the symptom, not the actual cause of the
problem.

The debian-specific patch in question is this (one-liner):

shell/ash.c:
-       { VSTRFIXED|VTEXTFIXED       , bb_PATH_root_path, changepath },
+       { VSTRFIXED|VTEXTFIXED|VEXPORT, bb_PATH_root_path, changepath },

so it merely exports PATH variable, and should not affect
the behavour in question, but I'm not sure anymore about
this.  It looks rather innocent.

Anyway.  The problem is that, from within initramfs, from
/init script which gets executed as pid==1, run by busybox's
sh with PREFER_APPLETS=y, any attempt to execute "awk"
results in a segfault.  Only this way -- "awk", not "/bin/awk"
or "busybox awk".  No arguments are necessary.

When I put the call into a separate .sh file and exec it,
it will succeed.  If I'll source this .sh file from within
/init, it will segfault.

The corresponding debian bugreport is http://bugs.debian.org/679377

I weren't able to trigger the issue using other NOFORK
applets, only awk so far shows this problem.

I understand the problem happens only with debian-specific
patch (which I wanted to get rid of anyway), but it might
be some more deep issue.  And I'm asking for some help with
debugging this, since I don't have enough knowlege about
the busybox internals.  Does it even make any sense at all?

Thanks!

/mjt
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to