Module Name:    src
Committed By:   christos
Date:           Sun Oct 23 21:06:08 UTC 2011

Modified Files:
        src/libexec/ld.elf_so: rtld.c

Log Message:
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...


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/libexec/ld.elf_so/rtld.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.152 src/libexec/ld.elf_so/rtld.c:1.153
--- src/libexec/ld.elf_so/rtld.c:1.152	Sat Aug 13 18:24:24 2011
+++ src/libexec/ld.elf_so/rtld.c	Sun Oct 23 17:06:07 2011
@@ -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 @@ _rtld_exclusive_enter(sigset_t *mask)
 	sigset_t blockmask;
 
 	sigfillset(&blockmask);
+	sigdelset(&blockmask, SIGTRAP);	/* Allow the debugger */
 	sigprocmask(SIG_BLOCK, &blockmask, mask);
 
 	membar_enter();

Reply via email to