OpenFL 2.2.7 to 3.3.4 Migration - MySemaphore::Wait Hang

Hi all! Been using NME/OpenFL for the past couple years and loving it! That being said, I’ve run into an issue today that I’m not entirely sure how to continue debugging. In short, after migrating our code from OpenFL 2.2.7 to OpenFL 3.3.4 to the best of my ability, a very strange hanging issue is occurring.

The application starts and generally runs for 10-15 seconds (though I saw it hang almost immediately one time), but once it comes to a point in the game where there’s some animation and particle effects the game’s graphics hang (and music continues to play).

The backtrace generally looks like so at the time of the hang:

* thread #1: tid = 0x225109, 0x00007fff8df1b716 libsystem_kernel.dylib`__psynch_cvwait + 10, queue = '', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff8df1b716 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff875d7c3b libsystem_pthread.dylib`_pthread_cond_wait + 727
    frame #2: 0x00000001010145b7 CineMagic`MySemaphore::Wait(this=0x000000010270bf68) + 87 at Thread.h:335
    frame #3: 0x000000010100a487 CineMagic`LocalAllocator::PauseForCollect(this=0x000000010270be00) + 151 at GCInternal.cpp:2781
    frame #4: 0x000000010100aa03 CineMagic`LocalAllocator::Alloc(this=0x000000010270be00, inSize=16, inIsObject=false) + 83 at GCInternal.cpp:2851
    frame #5: 0x000000010100855d CineMagic`hx::Object::operator new(inSize=16, inType=NewObjAlloc, inName=0x000000010122cfd3) + 253 at GCInternal.cpp:3331
    frame #6: 0x000000010107b5b3 CineMagic`hx::DoubleData::operator new(inSize=16, inAlloc=NewObjAlloc, inName=0x000000010122cfd3) + 35 at Dynamic.cpp:101
    frame #7: 0x00000001010761e1 CineMagic`Dynamic::Dynamic(this=0x00007fff5fbfa400, inVal=4340845056) + 337 at Dynamic.cpp:283
    frame #8: 0x000000010107626f CineMagic`Dynamic::Dynamic(this=0x00007fff5fbfa400, inVal=4340845056) + 31 at Dynamic.cpp:284
    frame #9: 0x000000010057e056 CineMagic`lime::graphics::cairo::Cairo_obj::destroy(this=0x0000000103610404) + 150 at Cairo.cpp:219
    frame #10: 0x000000010057e0fa CineMagic`lime::graphics::cairo::__Cairo_objdestroy(inObj=0x0000000103610404) + 42 at Cairo.cpp:225

To me this looks like something squirrelly is happening with memory/GC/Threading, but I’m at a bit of a loss of where to even start debugging such an issue. Here’s a link for the full backtrace. I’m running the mac target on a machine running OSX 10.9.5. Any help would be appreciated!


If you do not mind, could you install the previous version of both OpenFL and Lime, and see if it has this same issue? There is something in the last version that could be related, and it would really help to know if this happens with the version before (3.3.4, 2.6.3) … or are those the versions you are using? :smile:

Then, you can try to use -Dlegacy when building. This uses the OpenFL 2.x renderer for native targets (HTML5 and Flash are unaffected), which should make an easier transition for an older codebase while we continue to mature the newer code. Knowing if that works without a hitch would be great to know!

Thanks, keep me updated :slight_smile:

That seems to have fixed the issue! To be clear, I was running openfl 3.3.4 and lime 2.6.3 before. I downgraded to openfl 3.3.3 and lime 2.6.2 and the hang issue no longer occurs (though textfields no longer render now, but one problem at a time :smile: ).

Is there anything I could do to help you troubleshoot the hang bug further?

Try updating to OpenFL 3.3.5 and Lime 2.6.4, see if those have the issue you’re seeing? :slight_smile:

I just tried again with openfl 3.3.3 and lime 2.6.2 and the bug does not occur! Nicely done. :smile: