Hi,
I'm using DirectFB 1.0.0-rc2 on Linux 2.6.17 kernel and with the
vt-switch option on. Since upgrading to 1.0.0-rc2, any DFB app
is terminated with SIGHUP. This happens when the app is switching tty:
# dfbdump
...
(-) [Main Thread 0.445] ( 304) FBDev/VT: dfb_vt_initialize()
(-) [Main Thread 0.448] ( 304) FBDev/VT: vt_get_fb( 2 )
(-) [Main Thread 0.451] ( 304) FBDev/VT: -> 0
(-) [Main Thread 0.454] ( 304) FBDev/VT: vt_set_fb( 2, -1 )
(-) [Main Thread 0.503] ( 304) FBDev/VT: vt_init_switching()
(-) [VT Switcher 0.509] ( 307) FBDev/VT: dfb_vt_detach()
(-) [VT Switcher 0.512] ( 307) Direct/Signals: Blocking all signals
from now on!
(-) [VT Switcher 0.515] ( 307) FBDev/VT: vt_thread( 0x253a0,
(nil) )
(-) [VT Switcher 0.515] ( 307) FBDev/VT: ...vt_thread (signal
-1)
(!) [ 304: 0.518] --> Caught signal 1 (sent by pid 307, uid 0) <--
and is caused by this change between rc1 and rc2:
http://tinyurl.com/y2se2p
The removal of setpgid(0,0) call was apparently intentional (the log says
"No longer create a new process group in dfb_core_create()."), but it's
needed at least by the fbdev system with vt-switch on, otherwise the
process is bound to get SIGHUP when dfb_vt_detach() is called.
Attached patch simply restores the call, but perhaps there's a better
way. I'm not familiar with DFB code, so I don't know how the initialization
looks like and whether it's safe to call setpgid() from fbdev system
initialization or if that would be too late.
Regards,
Vaclav
--
PGP key: 0x465264C9, available from http://pgp.mit.edu/
Index: DirectFB/src/core/core.c
===================================================================
--- DirectFB/src/core/core.c (revision 95)
+++ DirectFB/src/core/core.c (working copy)
@@ -257,6 +257,10 @@
direct_find_best_memcpy();
+ /* Create a new process group with no controlling TTY; otherwise
+ we'd get SIGHUP when switching VT in fbdev system: */
+ setpgid(0,0);
+
D_MAGIC_SET( core, CoreDFB );
core_dfb = core;
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev