Problems using libpthread-0.10.so library on Montavista Professional edition 3.1
Hi,
I have written an application which creates a main thread and spawns some 10 child threads. The main thread after spawning all threads does a sigwait for certain signals which I want to handle.
I am using the following calls before creating all the child threads
- pthread_attr_setschedpolicy (Sched policy used is SCHED_RR)
- pthread_attr_setschedparam
- pthread_attr_setinheritsched (this is used to set the PTHREAD_EXPLICIT_SCHED attribute for the thread)
Of all the child threads , most of the threads use a pthread_cond_timedwait() call to sleep for some time and then wake up to do some work.
The application works fine but generates SIGSEGV in one or the other thread sometimes and the stack trace shows the following:
# Fault occurred in thread 'Main Thread' [id=16384]
# Faulty address is 0x7fa3, from 0x4036d8cc
#0 /lib/libc.so.6(__sigsuspend+0x6c) [0x4036d8cc]
#1 /lib/libpthread.so.0(sigwait+0x134) [0x40206ce4]
#2 MyApp [0x80c6df0]
#3 MyApp [0x80c7078]
#4 MyApp [0x80be3c6]
#5 MyApp [0x80bf11b]
#6 MyApp [0x80c74cf]
# Fault occurred in thread 'ACS Processor' [id=131081]
# Faulty address is 0x00007fa3, from 0x4020ac76
#0 /lib/libpthread.so.0(nanosleep+0x46) [0x4020ac76]
#1 /lib/libpthread.so.0 [0x40203174]
#2 MyApp [0x80bf32c]
#3 MyApp [0x81ddac5]
#4 MyApp [0x80be3c6]
The libc that I am using is libc-2.3.2.so and the pthread library version is libpthread-0.10.so. Has anyone faced a similar problem ? Or the way I am using pthreads is wrong ?
Any inputs will be of great help.
Cheers,
Arinjay
|