Domanda

I had a an error condition in C++ that I cannot easily reproduce in my call to pthread_join() some signal was generated, I do not know which one, but my signal handler was called and for some reason did not print out the normal debug information on the signal that was generated. I did get a stack trace that showed:

# 2 /lib/tls/libpthread.so.0: pthread_join(...) +0x1c [0xce439c]

I reviewed the man page for pthread_join() and did not see any mention of signals.

What might have been the signal generated and what might have been the cause? This might be some kind of race condition.

È stato utile?

Soluzione

http://linux.die.net/man/7/pthreads :

Signals are used in implementation internally

http://osr600doc.sco.com/man/html.PTHREAD/pthread_join.PTHREAD.html :

The wait in pthread_join is not broken by a signal.
If a thread waiting in pthread_join receives a signal that is not masked,
it will execute the signal handler, and then return to waiting in pthread_join.
Note that this behavior differs from that of pthread_cond_wait.

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Fapis%2Fusers_25.htm :

Threadsafe: Yes
Signal Safe: No

Basically, you might be experiencing the fact that pthread_join() accepts some other signal due to some error or external event.

We cannot guess what exactly causes the signal.

P.S. The exact environment is not specified which makes decision even harder.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top