sebastien.plagnol Posted March 5, 2012 Share Posted March 5, 2012 Hi everybody, I just ran into a classic borring threads problem when shuting down the engine it 'sometimes' crashes on a bad access => function CPUThread::process(), shader.id = shaders[num].id I first suspected a bad use from my side but i can't find my error. So i went to suspect something really unusual with Unigine. That's to say 'A Bug' :) In fact i tracked a bit the execution process, and saw that in the CPUThread destructor the 'running' variable was set to 0 befor emitting the signal (SetEvent) to wake up the process method one last time. Buuut ! as it is in the destructor, the memory space of the thread class will be released just after and the memory can be used again by the system., and the memory pointed by 'running' could differ from zero even if it should not. It seems i fixed the crash in most case with a _WIN32 specific call just after (SetEvent) i put : #ifdef _WIN32 CPUThread::~CPUThread() { running = 0; // send signal SetEvent(event); if( thread ) { WaitForSingleObject(thread,INFINITE); } #else Maybe Unigine team could fix this bug in a better way or at least integrate it in the next update !! Thanks Link to comment
unclebob Posted March 12, 2012 Share Posted March 12, 2012 Hi, Thanks for report. Could you provide test scene where crash most frequently appears? It'll help us a lot. Link to comment
ivan.cuevas Posted May 16, 2012 Share Posted May 16, 2012 Hi I have same problem. I've attached the callstack, the output messages,unigine log, and world files (very simple) The sebastien fix at the moment works (merci :) ) Hope this info can help in some way. crash on close.zip Link to comment
unclebob Posted May 21, 2012 Share Posted May 21, 2012 Hey guys, Thanks for the fix. We've already added it into engine. Link to comment
Recommended Posts