RE: just not getting it...

I apologize for the long code example.  Won't happen again.

I tried the _exit(0) suggestion.  The program now segfaults after the first
printf() statement in the final while() loop.  after clicking the close
button on the gnome segfault pop-up, the second printf() statement in that
same loop executes.  It's intended purpose is to display the line that is
about to be put into the gui, but instead it displays the last printf()
output from the signal handler.  I have tried running the program 3 times
now and have gotten consistant results each time.
Is there a way to invoke exit() and get the cleanup it normally does, while
avoiding the X disconnect?


-----Original Message-----
From: James Henstridge
To: Clancy, Shane W.
Cc: 'gnome-devel-list gnome org '
Sent: 7/3/02 1:09 AM
Subject: Re: just not getting it...

Clancy, Shane W. wrote:

>i am working on the same concept i mentioned in my recent mail
>crash upon fork() June 27, 2002), except i have realized that it is not
>fork() that is killing my app; at this point it appears to be inserting
>from a file into my gui.  i have written a small program to test what i
>to do, and am including it here in the hopes that someone can tell me
>i'm going wrong.  in a nutshell, what i would like this program to do
>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'
>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.


Email: james daa com au              | 2003 Call for
Papers out
WWW: |

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