This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SIGCHLD ignored


A fellow KDevelop hacker has reported that when running kdevelop itself
under CVS HEAD of gdb, kdevelop hangs. What happens if that kdevelop spawns
subprocess, and then does not notice it has exited, because it never
receives SIGCHLD. I attach a much reduced project that requires only Qt4,
and probably an even more reduced project is possible.

If I apply the attached patch to GDB, things work fine -- but I suspect
this 'fix' will break something else. 

Pedro, I think this SIGCHLD magic is your doing -- do you have any ideas
how to fix it? 

Thanks,
Volodya

Attachment: hang.tar
Description: Unix tar archive

diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 47dac59..8e62718 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4248,12 +4248,14 @@ Tells gdb whether to control the GNU/Linux inferior in asynchronous mode."),
 			   &maintenance_set_cmdlist,
 			   &maintenance_show_cmdlist);
 
+#if 0
   /* Block SIGCHLD by default.  Doing this early prevents it getting
      unblocked if an exception is thrown due to an error while the
      inferior is starting (sigsetjmp/siglongjmp).  */
   sigemptyset (&mask);
   sigaddset (&mask, SIGCHLD);
   sigprocmask (SIG_BLOCK, &mask, NULL);
+#endif
 
   /* Save this mask as the default.  */
   sigprocmask (SIG_SETMASK, NULL, &normal_mask);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]