In the latest version of Common C++ I get a segfault
from said method.
I inherit from PosixThread in a simple class. I create
potentially thousands of threads in the applications
lifetime but each thread only executes for
approximately 10 seconds *max* before exited. However,
after an indetermninate (e.g. sporadic) amount of time
the main (calling) process or thread segfaults here:
#0 ost::Thread::detach (this=0xb4b00470, st=0x0) at
thread.cpp:909
909 if(!rtn && priv->_tid)
(gdb) bt
As gdb shows (this is from a core dump). This happens
in more than one application.
I believe 'priv' becomes unavailable after
pthread_create returns if the thread exits before the
condition can be tested in the calling thread? The
thread is (obviously)
created in a detached state. I have modified the source
on my machine to test for a NULL priv object before
trying to dereference a member belonging to it.
Applications have not crashed since doing this.
Can someone confirm and if necessary fix the bug at the
source? Please advise.
Jim Vanns
Logged In: YES
user_id=1458877
Anyone even going to respond to this? As I said, I *think*
I've fixed it by testing the priv object for a NULL value.
Jim
Logged In: YES
user_id=217
Originator: NO
I believe this had been resolved in recent releases, as they now return if !priv before doing the priv->_tid test...