libCom: exitWait() from thread exit handler corrupts stack

The epicsThreadCallEntryPoint() function stores a pointer
to a local variable in epicsThread::pWaitReleaseFlag.
Calling epicsAtThreadExit::exitWait() from that thread's
epicsAtThreadExit() handler writes to this pointer
after epicsThreadCallEntryPoint() has returned.
Thus corrupting the stack.

Set pWaitReleaseFlag=NULL before return to prevent this.

fixes lp:1558206
This commit is contained in:
Michael Davidsaver
2016-03-16 14:40:37 -04:00
parent 113076a009
commit 4e312b9f64

View File

@@ -109,6 +109,7 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt )
// once the terminated flag is set and we release the lock
// then the "this" pointer must not be touched again
}
pThread->pWaitReleaseFlag = NULL;
}
bool epicsThread::beginWait () throw ()