Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so Don't block SIGTRAP so that on architectur...



details:   https://anonhg.NetBSD.org/src/rev/d3852715d556
branches:  trunk
changeset: 770569:d3852715d556
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 23 21:06:07 2011 +0000

description:
Don't block SIGTRAP so that on architectures where the debugger needs to
be able to receive sigtrap for breakpoints to work, it can. For example
we are setting breakpoints inside dlopen(), after we've blocked the signal,
so the process keep trapping and looping over the trap instruction without
being able to send the signal. Another way would be to move the
_rtld_debug_state() calls outside the critical section...

diffstat:

 libexec/ld.elf_so/rtld.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 804a19f722eb -r d3852715d556 libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c  Sun Oct 23 17:37:55 2011 +0000
+++ b/libexec/ld.elf_so/rtld.c  Sun Oct 23 21:06:07 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld.c,v 1.152 2011/08/13 22:24:24 christos Exp $       */
+/*     $NetBSD: rtld.c,v 1.153 2011/10/23 21:06:07 christos Exp $       */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.152 2011/08/13 22:24:24 christos Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.153 2011/10/23 21:06:07 christos Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -1532,6 +1532,7 @@
        sigset_t blockmask;
 
        sigfillset(&blockmask);
+       sigdelset(&blockmask, SIGTRAP); /* Allow the debugger */
        sigprocmask(SIG_BLOCK, &blockmask, mask);
 
        membar_enter();



Home | Main Index | Thread Index | Old Index