[uClibc]popen failing on i386 -- vfork issue?

David McCullough davidm at lineo.com
Thu Mar 1 04:51:06 UTC 2001


Jivin Manuel Novoa III lays it down ...
> Hello everyone,
> 
> In running some tests on the stdio routines, I found that the attached popen
> test from glibc was generating SIGSEGs (or SIGPIPEs in gdb).  By replacing
> vfork
> with fork in stdio/popen.c, the test runs successfully.  However, I don't want
> to do _that_ because that breaks under NOMMU.  So,
> 
> 1) Could someone in a NOMMU environment run the test and see if it bombs?

It appears to work fine.  I looked at the source,  the child does not seem
to modify any data structures, variables or stack after the vfork.  It
looks fairly safe to me.  Where does it SEGV ?

Of course SEGV's just don't happen without an MMU and it may have merrily
trashed some memory that no one was using ;-) The fact that you are crashing
means there is a bug,  and it will be easier to find on an x86 platform.

> 2) Is a seperate vfork really needed under i386, or could we just silently
>    fork instead?

It's a tough call,  but I think that if the user calls vfork,  they should
get vfork.  If you want to change to using fork then use an
"ifndef__NO_MMU__" or whatever the define is ?

Cheers,
Davidm

-- 
David McCullough:  Ph: +61 7 3435 2815  Lineo (The Embedded Solutions Company)
davidm at lineo.com   Fx: +61 7 3891 3630  PO Box 925, Kenmore QLD 4069, Australia





More information about the uClibc mailing list