Menu

#32 Fixes segfault in thread.cpp when destroying thread

open
nobody
None
5
2012-11-20
2004-05-10
David
No

Added two lines of code to ThreadDestructor that seem
to prevent segfaulting my code:

changes in release: commoncpp2-1.1.7
insert at line 1035 in thread.cpp
--cut here--
if (th!=NULL)
if (th->priv!=NULL)
--end--

The th->priv seems to be not NULL but still invalid.
The above code prevents a segfault when attempting to
access a variable in th->priv when comparing it to
threadTypeDummy.

I still get a free(): Invalid pointer at some other
point which is probably the cause of the segfaul in
ThreadDestructor. This however fixed the problem
partially for me. Will ofcourse continue to track down
the free() problem. Anyone care to help?

Discussion


Log in to post a comment.