Poco::Condition causing exception on windows

Hello,

I am fixing up the ofxThreadedImageLoader so that it is a wait/notify thread rather than a hungry thread.

I have this working on OS X (this is standard thread functionality), but on Windows I am getting

“First-change exception at 0x77d628c5 in Blooms_debug.exe: 0xC0000008: An invalid handle was specified.”

This occurs in the Poco::MutexImpl::lockImpl() Line 76, which is a Poco Mutex critical section. I am trying to figure out the cause of this, but my questions to the forum are:

  • Has anyone successfully used Poco::Condition on Windows 7 through OF?
  • Is there anything specific regarding the Poco windows bindings? I know that the fastMutex on windows is actually a recursive mutex, but I fail to see why this would cause something such as an invalid handle exception.

any insight is helpful, thanks!

Poco Condition is used in the core so it should work without problem in windows. check that you use the mutexes properly when you wait on a condition the mutex needs to be locked something like that seems to be the problem you are having

Hi.

I just installed OF in a windows 7 32 bits, and the examples compile with warnings but they crash immediately when run.

Warnigns:
||=== particle_working, release ===|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:uuid.lib ' unrecognized| ||Warning: .drectve-defaultlib:uuid.lib ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve -defaultlib:LIBCMT ' unrecognized| ||Warning: .drectve-defaultlib:OLDNAMES ’ unrecognized|
||Warning: .drectve `/DEFAULTLIB:“LIBCMT” /DEFAULTLIB:“OLDNAMES” ’ unrecognized|

I start debugging but can’t even reach the first code line and says.

Program received signal SIGSEGV, Segmentation fault.
In ntdll!RtlEqualSid () (C:\Windows\system32\ntdll.dll)
At C:\of_v0.7.4_win_cb_release\libs\openFrameworksCompiled\project\win_cb/…/…/…/poco/include/Poco/Mutex_WIN32.h:76

And more specifically

#0 76DD6B90 ntdll!RtlEqualSid() (C:\Windows\system32\ntdll.dll:??)
#1 006524A6 Poco::MutexImpl::lockImpl(this=0xffffffff) (…/…/…/poco/include/Poco/Mutex_WIN32.h:76)
#2 00652259 Poco::FastMutex::lock(this=0xffffffff) (…/…/…/poco/include/Poco/Mutex.h:259)
#3 0064511B ScopedLock(this=0x7dabcc, mutex=@0xffffffff) (…/…/…/poco/include/Poco/ScopedLock.h:60)
#4 00000000 0x0064e1b2 in Poco::SingletonHolderPoco::ErrorHandler::get() (??:??)
#5 00000000 0x00610997 in Poco::ErrorHandler::defaultHandler() (??:??)
#6 00000000 0x00610a0b in __static_initialization_and_destruction_0() (??:??)
#7 00000000 0x00610a42 in _GLOBAL__sub_I__ZN4Poco12ErrorHandler9_pHandlerE() (??:??)
#8 00000000 0x00632752 in __do_global_ctors() (??:??)
#9 00000000 0x00401095 in __mingw_CRTStartup() (??:??)
#10 00000000 0x00401148 in mainCRTStartup() (??:??)

Any clues? Thanks in advance

is this with the latest version of OF? also is this with any specific example or all of them?

Hi!

Last version of OF and with every examples.

Should I try an older version maybe? At least for get it working temporarily.

not sure where it’s coming from but i would try with the nightly builds:

http://www.openframeworks.cc/nightlybuilds.html

Buena idea!
gracias