[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#1111: signal bug with session manager
From:       Harri Porten <porten () tu-harburg ! de>
Date:       1999-04-01 10:30:55
[Download RAW message or body]

Navindra Umanee wrote:
> 
> Hi, I recompiled libkdecore.* with the above change but it doesn't
> seem to have made a difference.  Hmmm.

Really ? I am quite surprised. Did you do a 'make install' and restarted
KDE ?

Btw: I do experience an effect of that bug, too. When I do a 'man xxx'
in a xterm and press 'q' to quit I get an error about sigpipe. The
attached patch fixes this for me 100% reproducible.

> 
> Andreas Pour wrote:
> [...]
> > Even if a parent were to do any signal catching, it doesn't apply to
> > children (how could it? the child does not have a copy of the
> > signal-handling function).

Not quite. The libc documention says:

> When a new process is created, it inherits handling of signals from its parent
> process. However, when you load a new process image using
> the exec function (see section Executing a File), any signals that you've defined \
> your > own handlers for revert to their SIG_DFL handling.

BUT (my explanation): SIG_IGN is not your own handler that's why it can
get inherited.

> So, if there is a bug, it seems to be like
> > it must not stem from KDE or Gnome bu t from the kernel (shudder,
> > shudder!).  I am running kernel 2.0.36 -- which versio n are you
> > running?  (I am also suspisicous that this is a kernel bug b/c of the
> > value reported by you -- 0x1 is not a legitimate function address!).

Right. It's what SIG_IGN is defined as (signum.h).

Please try the following patch. If it doesn't break anything it might
well go into the CVS.

Harri.

-- kprocess.cpp.bak	Thu Apr  1 01:37:38 1999
+++ kprocess.cpp	Thu Apr  1 11:58:38 1999
@@ -235,6 +237,14 @@
 	if (run_mode == DontCare)
           setpgid(0,0);
 
+        // Restore default SIGPIPE handler
+        struct sigaction act;
+        sigemptyset(&(act.sa_mask));
+        sigaddset(&(act.sa_mask), SIGPIPE);
+        act.sa_handler = SIG_DFL;
+        act.sa_flags = 0;
+        sigaction(SIGPIPE, &act, 0L);
+
 	execvp(arglist[0], arglist);
 	exit(-1);
 
@@ -633,6 +643,14 @@
 	// Matthias
 	if (run_mode == DontCare)
           setpgid(0,0);
+
+        // Restore default SIGPIPE handler
+        struct sigaction act;
+        sigemptyset(&(act.sa_mask));
+        sigaddset(&(act.sa_mask), SIGPIPE);
+        act.sa_handler = SIG_DFL;
+        act.sa_flags = 0;
+        sigaction(SIGPIPE, &act, 0L);
 
 	execvp(arglist[0], arglist);
 	exit(-1);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic