Re: just not getting it...



Clancy, Shane W. wrote:

all,
i am working on the same concept i mentioned in my recent mail (application
crash upon fork() June 27, 2002), except i have realized that it is not the
fork() that is killing my app; at this point it appears to be inserting text
from a file into my gui.  i have written a small program to test what i want
to do, and am including it here in the hopes that someone can tell me where
i'm going wrong.  in a nutshell, what i would like this program to do is:
1. fork two child processes that pull data from the gui and put it into
individual files.
2. after catching the last SIGCHLD, the parent should assemble the
childrens' files into one.
3. finally, the parent should display the data in the gui.

so far, i am making it past #1 & #2, but am getting a 'broken pipe' error
before the data is displayed. any help would be appreciated.
Try changing the exit(0); call performed by the child to _exit(0); (note the underscore).

On exit(), various cleanups are performed. Included in this cleanup is shutting down the X connection, which is bad as the two processes are sharing the connection. Calling _exit() will exit the process without this cleanup.

In future, try cutting your example down to a minimal test case of the bug. More people will be willing to help you that way. This is especially important when filing bugs in bugzilla.

James.

--
Email: james daa com au              | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]