Opened 17 years ago
Closed 17 years ago
#1967 closed defect (fixed)
mythbackend crash during start up (upnp)
Reported by: | Owned by: | dblain | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
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.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.