[gccsdk] fork/exec problems

Ron beeb at woosh.co.nz
Sun May 6 17:55:16 PDT 2012


I appreciate Duncan's  bug report on fork/exec as I am having problems.
The latest release 4.1.2 (upgraded last night) reliably halts with
segmentation error.
Actually previous releases have been giving more erratic faults only 
sometimes crashing at the some spot further into the program after
returning from the fork.

In the case of Tar, simply replacing fork with vfork or setting
Tar$heap "" doesn't work, though I think in the long term, I'll have
to change the code so it will work with vfork.
The fork/exec is only doing a bit of file renaming for multipart tars,
so shouldn't need a full copy of the parent.

I read somewhere (in the unix world) that there is a swing back to
using fork instead of vfork where it would be used, because new 
versions of fork can do it differently now. 

I have noticed previously that running the program from the Supervisor
that the fork wont work unless the WindowManager is running, does this
mean the WindowManager is necessary to get a new pid/(process)?

Thanks for any enlightenment on this subject.

Ron M.   




More information about the gcc mailing list