[BusyBox] Re: BusyBox `msh' doesn't work correctly with vfork / uClibc

Miles Bader miles at lsi.nec.co.jp
Tue Mar 5 00:59:03 UTC 2002


Erik Andersen <andersen at codepoet.org> writes:
> Could you check out this patch from Stefan Soucek
>     http://uclibc.org/lists/uclibc/2001-December/004491.html
...
> Anyway, if you try it and it does indeed work (or if you have the
> time to improve it), I'll be glad to include it for 0.60.3 on your
> recommendation.

I looked at that patch, and found that most of it had already been
applied in the version of busybox/msh.c that I have (which is from
uClinux-dist-20020220, and claims to be version 0.60.0).  Those parts
seems sane.

However, Stefan's patch doesn't address the problem with `exit' that I
reported, so my patch (that changes things to use `_exit') or something
similar is still necessary.

The parts of Stefan's patch which _aren't_ in the current sources are:

  (1) Some ifdefs to allow either fork or vfork to be used; the current
      sources just always use vfork, which seems fine to me.

  (2) A change to the `grave' function to avoid problems with vfork;
      since that function appears to do pretty complicated things
      within the child, Stefan's patch just does (where cp is the
      command):

        execlp("/bin/sh", "/bin/sh", "-c", cp, NULL);

      Not sure if that works, but the current code in `grave' is certain
      to screw things up when used with vfork.

So, I'd recommend:

  Apply my earlier patch to use _exit

  Think about doing something with the `grave' function similar to what
  Stefan did.

-Miles
-- 
80% of success is just showing up.  --Woody Allen



More information about the busybox mailing list