This is the mail archive of the
rda@sources.redhat.com
mailing list for the rda project.
[PATCH] Ignore realitme signals.
- From: Kevin Buettner <kevinb at redhat dot com>
- To: rda at sources dot redhat dot com
- Date: Tue, 20 Apr 2004 13:13:08 -0700
- Subject: [PATCH] Ignore realitme signals.
- Organization: Red Hat
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);