* [PATCH] Ignore realitme signals.
@ 2004-04-20 20:13 Kevin Buettner
2004-04-24 15:44 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Buettner @ 2004-04-20 20:13 UTC (permalink / raw)
To: rda
I've just committed the patch below.
The comment in the patch explains what it's about. I've seen this
problem (in which rda terminates due to getting a signal intended for
one of the inferior threads and terminates) in at three different
environments now (all embedded linux, but different architectures).
While I suspect that the real problem lies in the kernel, it certainly
doesn't hurt for RDA to ignore any real-time signals sent to it.
* server.c (main): Ignore realtime signals.
Index: server.c
===================================================================
RCS file: /cvs/src/src/rda/unix/server.c,v
retrieving revision 1.4
diff -u -p -r1.4 server.c
--- server.c 19 Mar 2004 18:26:08 -0000 1.4
+++ server.c 20 Apr 2004 20:08:09 -0000
@@ -374,6 +374,17 @@ main (int argc, char **argv)
signal (SIGCHLD, chld_handler);
+ {
+ int sig;
+ /* Ignore realtime signals. We do this so as to not terminate
+ RDA if we inadvertently receive one of these signals. The
+ realtime signals are used for thread support, and, for some
+ reason, some environments send these signals to RDA as well
+ as the application. (And some don't.) */
+ for (sig = SIGRTMIN; sig <= SIGRTMAX; sig++)
+ signal (sig, SIG_IGN);
+ }
+
if (portno != 0)
{
gdbsocket_startup (portno, gdbserver.attach, process);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Ignore realitme signals.
2004-04-20 20:13 [PATCH] Ignore realitme signals Kevin Buettner
@ 2004-04-24 15:44 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2004-04-24 15:44 UTC (permalink / raw)
To: Kevin Buettner; +Cc: rda
On Tue, Apr 20, 2004 at 01:13:08PM -0700, Kevin Buettner wrote:
> I've just committed the patch below.
>
> The comment in the patch explains what it's about. I've seen this
> problem (in which rda terminates due to getting a signal intended for
> one of the inferior threads and terminates) in at three different
> environments now (all embedded linux, but different architectures).
> While I suspect that the real problem lies in the kernel, it certainly
> doesn't hurt for RDA to ignore any real-time signals sent to it.
>
> * server.c (main): Ignore realtime signals.
At least some versions of the kernel will send a child's exit signal to
the debugger, instead of SIGCHLD - this should be fixed in 2.6 series
kernels, but I think it was broken through all of 2.2 and 2.4. GDB had
the same problem for a while, IIRC.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-24 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-20 20:13 [PATCH] Ignore realitme signals Kevin Buettner
2004-04-24 15:44 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).