Strange exit behaviour of GUI programs in Xfce on Logout

Brian J. Tarricone bjt23 at cornell.edu
Mon Oct 3 01:03:20 CEST 2005


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

Bernhard Walle wrote:
> * Bernhard Walle [02.10.2005 20:37]:
> 
>>* Bernhard Walle [02.10.2005 19:52]:
>>
>>>* Olivier Fourdan [02.10.2005 09:53]:
>>>
>>>>On Sun, 2005-10-02 at 00:20 +0200, Bernhard Walle wrote:
>>>>
>>>>>following problem: I wrote an application which should save some
>>>>>information on exit. The application doesn't use session management
>>>>>(it's very simple, doesn't even have a real GUI, the connection to the
>>>>>X-Server is only to get closed on logout).
>>>>
>>>>If you run the session manager, the "--daemon" option in xfwm4 is simply
>>>>ignored (because it's the SM that manages the startup)
>>>>
>>>>So in your later example, the one that doesn't work, I believe your test
>>>>program is simply not executed.
>>>
>>>In this examples there's no session manager. I simply do
>>>
>>> - Starting a failsave session
>>> - xfwm4 --daemon
>>> - ./testclient&
>>> - exit
>>
>>Ok, this was wrong. It works.
>>
>>But following persists:
>>
>> - Normal Xfce login
>> - start ./testclient&
>> - log out
>>
>>/tmp/test.txt is not created, so the function registered with atexit()
>>is not run. Can anybody verify this?
> 
> 
> I tracked down the issue. The process receives SIGPIPE from the X11 socket.
> 
> I think this is a timing issue (if the process gehts a X11 error or a
> SIGPIPE) and not directly related to Xfce.

Ah, yes, a famous Linux stupidity.  It seems that Linux is the only OS
where the process gets a SIGPIPE when a connected socket is closed in a
particular way.  If you want to avoid this, it's safe to do:
signal(SIGPIPE, SIG_IGN);
in your app.

	-brian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDQGc46XyW6VEeAnsRAufrAKCks9sGg1HUyB3x8j/N6XlY+15OLACcCf9d
lfTD3/fr+qOBbKHsVhQWPs4=
=KzDk
-----END PGP SIGNATURE-----



More information about the Xfce4-dev mailing list