id summary reporter owner description type status priority milestone component version severity resolution keywords cc mlocked 1967 mythbackend crash during start up (upnp) jwestfall@… dblain "Hi I am seeing a crash on start up on one of my backends. I will attach gdb/backend. The issue is related to upnp starting up worker threads. In ThreadPool::AddWorkerThread() the following is timing out {{{ if (pThread->WaitForInitialized( 5000 )) { ... } else { // ------------------------------------------------------ // It's taking longer than 5 seconds to initialize this thread.... // give up on it. // (This should never happen) // ------------------------------------------------------ delete pThread; pThread = NULL; } }}} Deleting the pThread object while the thread exists causes the crash when the thread goes to access it. I think I got the timeout tracked down to CEvent::WaitForEvent(timeout) missing events/signals. I believe the following is happening. {{{ Thread 1 (main thread) Thread 2 (new worker thread) ----------------------------------------------------------------------- bool CEvent::WaitForEvent(time) { if (IsSignaled()) return( true ); bool CEvent::SetEvent() { m_bSignaled = true; m_wait.wakeAll(); } return( m_wait.wait( time ) ); } }}} The wakeAll() can happen before WaitForEvent() gets to its wait(), causing the timeout and thus missing the event/signal. " defect closed minor unknown mythtv head medium fixed 0