Greetings,
I'm working on a multit-threaded program using Solaris' threads (not POSIX).
When I call nanosleep() or usleep(), sometimes the program works well, but often I get either a SIGSEGV or a SIGBUS.
Have a look at the following dbx output using a core file:
(dbx) threads
o> t@1 a l@1 ?() signal SIGSEGV in t_splay()
t@2 a l@2 cpu_thread() LWP suspended in ___nanosleep()
(dbx) thread 2
dbx: unrecognized arg/option '2'
Use the 'help' command for more information.
(dbx) thread t@2
Current function is cpu_thread
367 nanosleep(&sleep_time, NULL);
t@2 (l@2) stopped in ___nanosleep at 0xfe5c017c
0xfe5c017c: ___nanosleep+0x0008: bcc,a,pt %icc,___nanosleep+0x18 ! 0xfe5c018c
(dbx) list
367 nanosleep(&sleep_time, NULL);
[...]
(dbx)
The code used to create the thread:
thr_create(NULL, 0, cpu_thread, NULL, 0, &tid);
Am I missing something?
Any suggestions are welcome.
Thanks,
-Thomas