[Xfce4-commits] r19323 - libxfcegui4/trunk/libxfcegui4

Brian J. Tarricone bjt23 at cornell.edu
Sat Jan 7 12:12:40 CET 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- From Danny, since the ML hates him ^_~.


- -------- Original Message --------
Subject: [Fwd: Re: [Xfce4-commits] r19323 - libxfcegui4/trunk/libxfcegui4]
Date: Sat, 07 Jan 2006 12:06:50 +0100
From: dannym <danny.milo at gmx.net>
To: Brian J. Tarricone <bjt23 at cornell.edu>

I so know that the Mailinglist will bork on me, so I forwarded it to
your mail address, just in case...



Subject: Re: [Xfce4-commits] r19323 - libxfcegui4/trunk/libxfcegui4
From: Danny Milosavljevic <danny.milosavljevic at liwest.at>
Date: Sat, 07 Jan 2006 12:05:12 +0100
To: XFCE4 development list <xfce4-dev at xfce.org>

Hi,

Am Samstag, den 07.01.2006, 02:25 -0800 schrieb Brian J. Tarricone:

>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 1/7/2006 2:18 AM, Jasper Huijsmans wrote:
>
>>> > Brian J. Tarricone schreef:
>>> >
>>
>>>> >>On 1/7/2006 2:00 AM, Jasper Huijsmans wrote:
>>>> >>
>>>
>>>>> >>>Brian J. Tarricone schreef:
>>>>> >>>
>>>>> >>>
>>>>
>>>>>> >>>>On 1/7/2006 1:33 AM, Jasper Huijsmans wrote:
>>>>>> >>>>
>>>>>> >>>>
>>>>>
>>>>>>> >>>>>Brian J. Tarricone schreef:
>>>>>>> >>>>>...
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>
>>>>>>>>> >>>>>>>SIGCHLD is ignored by default, isn't it?
>>>>>>>
>>>>>>>> >>>>>>
>>>>>>>> >>>>>>Nope.
>>>>>>
>>>>>>> >>>>>
>>>>>>> >>>>>Hmm, according to the glibc info page, it is.
>>>>>
>>>>>> >>>>
>>>>>> >>>>Then it lies.  Try this awesome little one-liner:
>>>>>> >>>>
>>>>>> >>>>void main() { switch(fork()) { case -1: exit(1); case 0:
_exit(0);
>>>>>> >>>>default: while(1); } }
>>>>>> >>>>
>>>>>> >>>>Run it, and you'll see that a zombie is left.  At least it is
on my box
>>>>>> >>>>(glibc 2.3.5).  I get this:
>>>>>> >>>>
>>>>>> >>>>brian at kelnos ~ $ ./testsigchld &
>>>>>> >>>>[1] 17421
>>>>>> >>>>brian at kelnos ~ $ ps
>>>>>> >>>> PID TTY          TIME CMD
>>>>>> >>>>17312 pts/1    00:00:00 bash
>>>>>> >>>>17421 pts/1    00:00:00 testsigchld
>>>>>> >>>>17422 pts/1    00:00:00 testsigchld <defunct>
>>>>>> >>>>17423 pts/1    00:00:00 ps
>>>>
>>>>> >>>
>>>>> >>>That is exactly because SIGCHLD is not handled, or am I missing
something?
>>>
>>>> >>
>>>> >>"Not handled" and "ignored" aren't the same thing.  "Not handled"
(the
>>>> >>default) will leave zombies when the children exit, but "ignored"
(via
>>>> >>signal(SIGCHLD, SIG_IGN)) won't.
>>>> >>
>>>> >>
>>>
>>>>> >>>I thought Danny added a callback, because SIGCHLD would stop the
>>>>> >>>program. Did I read that wrong?
>>>
>>>> >>
>>>> >>SIGCHLD shouldn't stop the parent.  IIRC, if you don't handle it, you
>>>> >>just get zombie children.
>>>> >>
>>
>>> >
>>> >
>>> > Agreed. I slightly misunderstaood what Danny was trying to do.
>>> >
>>> > However, from the glib documentation:
>>> >
>>> >   G_SPAWN_DO_NOT_REAP_CHILD 	the child will not be automatically
>>> >   you must call waitpid() or handle SIGCHLD yourself, or the child
will
>>> >   become a zombie.
>>> >
>>> > So, only if we use this flag do we need to close the pid.


An example:

pid = spawn();
/* <here> */
g_child_watch_add(pid, ...)

If now, at the <here> mark the process is already gone again, that would
be bad. Therefore I wanted to do something like,

pid = spawn(KEEP IT HERE DARN IT);
g_child_watch_add(pid, ...);
I DONT CARE ABOUT THE PROCESS ANYMORE(pid); /* other than that the child
watch is called if appropriate */

However I don't find the latter and kind of thought it were automagic.
Probably not ?  :)


>>
>> Perhaps Danny could explain why he made this change then, to add this
>> flag?  I assume it has something to do with the language bindings.


The overall plan is to get the startup notification cancelled when the
process dies (i.e. opera/mozilla delegating stuff to a master process
then immediately existing, ...)


>>
>> Danny, also, a buglet.  You have:
>>
>> void
>> xfce_startup_notification_cancel(const char* id)
>> {
>>     screen;
>>     envp;
>>
>>     return g_strdupv (envp);
>> }


Fixed, thanks


cheers,
   Danny

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFDv6Io6XyW6VEeAnsRAp0OAJ9YUY5MF86nlAxnqspnalNZ7Rw1jACgsFBQ
OM9XUigCHhYu66Th3LbK+/c=
=3yey
-----END PGP SIGNATURE-----



More information about the Xfce4-dev mailing list