This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/20485] sigprocmask in tracee affects tracer as well
- From: "jengelh at inai dot de" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 16 Oct 2016 17:59:33 +0000
- Subject: [Bug gdb/20485] sigprocmask in tracee affects tracer as well
- Auto-submitted: auto-generated
- References: <bug-20485-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20485
--- Comment #2 from Jan Engelhardt <jengelh at inai dot de> ---
Hm. So what is the best way to put gdb in a position to successfully interrupt
a process that implements a signal thread in the style of pthread_sigmask(3)'s
example?
---
#include <stdio.h>
#include <signal.h>
#include <pthread.h>
#include <unistd.h>
static sigset_t m;
static void *signal_handler(void *x) {
int sig;
while (sigwait(&m, &sig) == 0) printf("acting upon signal %d\n", sig);
return NULL;
}
int main(void) {
pthread_t t2;
sigemptyset(&m);
sigaddset(&m, SIGINT);
pthread_sigmask(SIG_BLOCK, &m, NULL);
pthread_create(&t2, NULL, signal_handler, NULL);
while (1) sleep(1);
return 0;
}
--
You are receiving this mail because:
You are on the CC list for the bug.