Repository navigation
custom poco events reaching deadlock #62
Copy link
Copy link
Closed
Description
Whenever a custom event is added, we are getting a deadlock. This is affecting a lot of the examples on the raspberry pi. This was tested and failed with Poco 1.4.4 and 1.4.5.
I believe this is happening in Poco, because Poco's own tests won't release when using mutexes.
A little more research is needed on this.
(gdb) backtrace
#0 0x4083c258 in __lll_lock_wait () from /lib/arm-linux-gnueabihf/libpthread.so.0
#1 0x40836cac in pthread_mutex_lock () from /lib/arm-linux-gnueabihf/libpthread.so.0
#2 0x0001b3b0 in Poco::MutexImpl::lockImpl (this=0x249ac0) at ../../../libs/poco/include/Poco/Mutex_POSIX.h:81
#3 0x0001b600 in Poco::FastMutex::lock (this=0x249ac0) at ../../../libs/poco/include/Poco/Mutex.h:259
#4 0x0001bf58 in Poco::ScopedLock<Poco::FastMutex>::ScopedLock (this=0xbefff3e0, mutex=...) at ../../../libs/poco/include/Poco/ScopedLock.h:60
#5 0x0001b650 in Poco::AtomicCounter::operator++ (this=0x249ac0) at ../../../libs/poco/include/Poco/AtomicCounter.h:318
#6 0x0001b728 in Poco::ReferenceCounter::duplicate (this=0x249ac0) at ../../../libs/poco/include/Poco/SharedPtr.h:62
#7 0x0002063c in Poco::SharedPtr<Poco::AbstractDelegate<float>, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::AbstractDelegate<float> > >::SharedPtr (
this=0x249ae0, ptr=...) at ../../../libs/poco/include/Poco/SharedPtr.h:154
#8 0x0001f374 in __gnu_cxx::new_allocator<Poco::SharedPtr<Poco::AbstractDelegate<float>, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::AbstractDelegate<float> > > >::construct (this=0x2496d4, __p=0x249ae0, __val=...) at /usr/include/c++/4.6/ext/new_allocator.h:108
#9 0x0001f50c in std::vector<Poco::SharedPtr<Poco::AbstractDelegate<float>, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::AbstractDelegate<float> > >, std::allocator<Poco::SharedPtr<Poco::AbstractDelegate<float>, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::AbstractDelegate<float> > > > >::_M_insert_aux (this=0x2496d4, __position=..., __x=...) at /usr/include/c++/4.6/bits/vector.tcc:335
#10 0x0001e36c in std::vector<Poco::SharedPtr<Poco::AbstractDelegate<float>, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::AbstractDelegate<float> > >, std::allocator<Poco::SharedPtr<Poco::AbstractDelegate<float>, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::AbstractDelegate<float> > > > >::push_back (
this=0x2496d4, __x=...) at /usr/include/c++/4.6/bits/stl_vector.h:834
#11 0x0001d470 in Poco::DefaultStrategy<float, Poco::AbstractDelegate<float> >::add (this=0x2496d0, delegate=...)
at ../../../libs/poco/include/Poco/DefaultStrategy.h:88
#12 0x0001c838 in Poco::AbstractEvent<float, Poco::FIFOStrategy<float, Poco::AbstractDelegate<float> >, Poco::AbstractDelegate<float>, Poco::FastMutex>::operator+= (this=0x2496c0, aDelegate=...) at ../../../libs/poco/include/Poco/AbstractEvent.h:197
#13 0x0001b0d4 in ofAddListener<ofEvent<float>, float, testApp> (event=..., listener=0x2496b0, listenerMethod=
(void (testApp::*)(testApp * const, float &)) 0x1ac04 <testApp::newFloat(float&)>) at ../../../libs/openFrameworks/events/ofEventUtils.h:61
#14 0x0001aa74 in testApp::setup (this=0x2496b0) at src/testApp.cpp:10
#15 0x0003d3d8 in ofNotifySetup () at ../../..//libs/openFrameworks/events/ofEvents.cpp:77
#16 0x000c2a00 in ofAppEGLWindow::runAppViaInfiniteLoop (this=0x23bb20, appPtr=0x2496b0) at ../../..//libs/openFrameworks/app/ofAppEGLWindow.cpp:471
#17 0x0003abd0 in ofRunApp (OFSA=0x2496b0) at ../../..//libs/openFrameworks/app/ofAppRunner.cpp:84
#18 0x000236a4 in main () at src/main.cpp:12
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
bakercp commentedon Dec 4, 2012
I believe that the above happens when we attempt to call an
ofAddListenerwithin a function that was called via the Poco system (i.e. inside setup).The following happens when we try to create call
ofAddListenerinside of another function (in this case, it was called during the first call toupdate():So, it seems that there is some odd thread stuff going on with poco. @arturoc could you take a look at this and see if you have any next steps for debugging? Once I exhaust our combined brain power, I'll take it over to the poco forums.
bakercp commentedon Dec 4, 2012
This is resolved using debian repo poco libs (1.3) and should be resolved using @arturoc's recompiled 1.4.3p1 libs.
bakercp commentedon Dec 4, 2012
fixed with #63