I am using gdb 4.18 under Debian GNU/linux 2.2 (glibc 2.1.3) on a PowerPC
('99 Macintosh Powerbook G3, 400MHz PowerPC 750, 192MB RAM), with gcc
2.95.2, and I encountered an apparent bug when debugging multithreaded
programs.
Basically, when I try to debug the program below, or any program that
calls pthread_create, I get an error like:
Program received signal ?, Unknown signal.
0xfee1244 in sigset () from /lib/libc.so.6
(gdb) where
#0 0xfee1244 in sigset () from /lib/libc.so.6
#1 0xffd4a40 in __pthread_wait_for_restart_signal () from
/lib/libpthread.so.0
#2 0xffd4018 in pthread_create@@GLIBC_2.1 () from /lib/libpthread.so.0
#3 0x100005ac in main (argc=1, argv=0x7ffffa74) at foo.c:17
Let me know if you have any suggestions, or if I can provide more info.
Thanks for your efforts! gdb is a great piece of Free Software.
Cordially,
Steven G. Johnson
--------------------------- test program -------------------------
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
void *work2(void *foo)
{
while (1) {
printf("got %d\n", (int) foo);
sleep(2);
}
return 0;
}
int main(int argc, char **argv)
{
pthread_t id;
pthread_create( &id, NULL, work2, (void*) 0 );
printf("Created thread.\n"); fflush(stdout);
while (1) {
printf("Waiting...\n");
sleep(5);
}
return 0;
}