Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Provider update deadlock in DviSubscription::PropertiesInitialised
03-06-2013, 08:56 AM (This post was last modified: 03-06-2013 01:29 PM by lpeter.)
Post: #1
Provider update deadlock in DviSubscription::PropertiesInitialised
Hi,

I'm trying to write a simple renderer based on ohNet, but I hit the wall. It locks up after a few seconds after it starts playing a track.
Little debugging showed me that two threads gets in a deadlock. One them is the thread tries to update a provider property from a Timer callback, the other one is ohNet thread that tries to cancel a Timer.

Detailed call stack :

Thread 1: Callback thread from timer already acquired iCallbackMutex in TimerManager and tries to acquire iLock in DviSubscription

Code:
OpenHome::Os::MutexLock(void * aMutex) Line 53     C++
OpenHome::Mutex::Wait() Line 77     C++
OpenHome::Net::DviSubscription::PropertiesInitialised() Line 231     C++
OpenHome::Net::DviSubscriptionManager::QueueUpdate(OpenHome::Net::DviSubscriptio​n & aSubscription) Line 491     C++
OpenHome::Net::DviService::PublishPropertyUpdates() Line 231     C++
OpenHome::Net::DvProvider::TryPublishUpdate() Line 107     C++
OpenHome::Net::DvProvider::SetPropertyUint(OpenHome::Net::PropertyUint & aProperty, unsigned int aValue) Line 63     C++
OpenHome::Net::DvProviderAvOpenhomeOrgTime1::SetPropertySeconds(unsigned int aValue) Line 39     C++
OpenHome::Media::ProviderTime::SetSeconds(unsigned int aSeconds) Line 43     C++

Thread 2: Internal ohNet thread that already acquired iLock in DviSubscription and tries to acquire iCallbackMutex in TimerManager:

Code:
OpenHome::Os::MutexLock(void * aMutex) Line 53     C++
OpenHome::Mutex::Wait() Line 77     C++
OpenHome::TimerManager::CallbackLock() Line 148     C++
OpenHome::Timer::Cancel() Line 74     C++
OpenHome::ReaderHttpResponse::Read(unsigned int aTimeoutMs) Line 479     C++
OpenHome::Net::PropertyWriterUpnp::PropertyWriteEnd() Line 412     C++
OpenHome::Net::DviSubscription::WriteChanges() Line 161     C++
OpenHome::Net::Publisher::Run() Line 389     C++

It is not clear to me weather this az undocumented feature that provider properties should not be updated in a Timer callback, or it is a TimerManager bug...

Br,
Peter
Find all posts by this user


Messages In This Thread
Provider update deadlock in DviSubscription::PropertiesInitialised - lpeter - 03-06-2013 08:56 AM

Forum Jump: