[maemo-developers] [maemo-developers] Problem with GDB and threads...
From: Christian Henz christian.henz at c-lab.deDate: Thu Jul 13 19:42:44 EEST 2006
- Previous message: [maemo-developers] The Sardine is finally on the grill
- Next message: [maemo-developers] using __attribute__ ((visibility "hidden")))
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi.
I have a problem when trying to debug a multi-threaded application on the
Nokia 770 (OS 2006).
This is my test program:
------------------------
#include <unistd.h>
#include <cassert>
#include <pthread.h>
void* routine( void* arg ) {
while( 1 ) { }
return 0;
}
int main( int argc, char** argv ) {
pthread_t handle;
int err = pthread_create( &handle, 0, routine, 0 );
assert( err == 0 );
sleep( 60 );
return 0;
}
------------------------
On the PC, I do the following in gdb:
(gdb) inf thr
2 Thread -1479910480 (LWP 29458) routine (arg=0x0) at test.cpp:8
* 1 Thread -1479907648 (LWP 29455) 0xa7d3a2bc in nanosleep ()
from /lib/tls/libc.so.6
(gdb) thread apply all bt
Thread 2 (Thread -1479910480 (LWP 29458)):
#0 routine (arg=0x0) at test.cpp:8
#1 0xa7ef7ced in start_thread () from /lib/tls/libpthread.so.0
#2 0xa7d79dee in clone () from /lib/tls/libc.so.6
Thread 1 (Thread -1479907648 (LWP 29455)):
#0 0xa7d3a2bc in nanosleep () from /lib/tls/libc.so.6
#1 0xa7d3a0c4 in sleep () from /lib/tls/libc.so.6
#2 0x08048562 in main (argc=1, argv=0xafa2c274) at test.cpp:22
On the Nokia 770, the backtrace goes on forever and i have to kill
gdb:
(gdb) inf thr
3 Thread 16386 (LWP 2269) 0x000084b0 in routine ()
2 Thread 32769 (LWP 2268) 0x402a3474 in poll () from /lib/libc.so.6
* 1 Thread 16384 (LWP 2265) 0x4027e37c in nanosleep () from /lib/libc.so.6
(gdb) thread apply all bt
Thread 3 (Thread 16386 (LWP 2269)):
#0 0x000084b0 in routine ()
#1 0x40024a20 in pthread_start_thread () from /lib/libpthread.so.0
#2 0x40024a20 in pthread_start_thread () from /lib/libpthread.so.0
#3 0x40024a20 in pthread_start_thread () from /lib/libpthread.so.0
#4 0x40024a20 in pthread_start_thread () from /lib/libpthread.so.0
#5 0x40024a20 in pthread_start_thread () from /lib/libpthread.so.0
#6 0x40024a20 in pthread_start_thread () from /lib/libpthread.so.0
[...]
Has anyone else experienced this? Also, why is there an extra thread?
thanks,
Christian Henz
- Previous message: [maemo-developers] The Sardine is finally on the grill
- Next message: [maemo-developers] using __attribute__ ((visibility "hidden")))
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
