This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug threads/10227] GDB resumes inferior unexpectedly when receiving ignored signal; step/next behave as continue
- From: "ppluzhnikov at google dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 2 Jun 2009 06:36:11 -0000
- Subject: [Bug threads/10227] GDB resumes inferior unexpectedly when receiving ignored signal; step/next behave as continue
- References: <20090602061531.10227.ppluzhnikov@google.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From ppluzhnikov at google dot com 2009-06-02 06:36 -------
Smaller/simpler test case:
/* compile with "gcc -pthread -g t.c"
* Test program generates an endless stream of SIGPIPE in second thread. */
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
void *fn(void *p)
{
int fd = *(int*)p;
while (1) {
int x = 1;
x++;
x++;
write(fd, &x, sizeof(x));
}
}
int foo()
{
return 42;
}
int main()
{
int fd[2];
pthread_t tid;
signal(SIGPIPE, SIG_IGN);
if (pipe(fd) == -1)
return 1;
close(fd[0]);
pthread_create(&tid, 0, fn, &fd[1]);
while (1) {
int x = foo();
}
return 0;
}
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10227
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.