Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using nanosleep() in a threaded program cause SIGBUS or SIGSEGV

807567Dec 16 2005 — edited Dec 16 2005
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2006
Added on Dec 16 2005
2 comments
772 views