snowkit / snow

A low level cross platform framework for Haxe. Mac, Windows, Linux, Android, iOS, WebGL.
http://snowkit.org/snow
MIT License
133 stars 35 forks source link

Thread crashes on android when going home page #79

Open kevinresol opened 9 years ago

kevinresol commented 9 years ago
var t = Thread.create(function() { } )

Run the above code in ready() and then press the android "home button", the app will crash with error:

hxcpp: GetLocalAllocMT - requesting memory from unregistered thread!

or it should be reported in hxcpp?

ruby0x1 commented 8 years ago

Some tips so long. Rebuild snow in debug: cd <snow>/project/ flow build android --debug --d snow_dynamic_link

Ensure your app is in debug. Ensure ART jni debugging is enabled https://source.android.com/devices/tech/dalvik/

For other information: snow doesn't create threads, snow doesn't jump back and forth between java/haxe (only SDL layer does) we need more information to debug the callstack - the best option is to have it crash with a proper callstack (i.e the debug snow should help a lot at first)

kevinresol commented 8 years ago

Is this the supposed output? capture

ruby0x1 commented 8 years ago

With a debug snow build the libsnow lines would show actual cpp locations

kevinresol commented 8 years ago

oops right, I missed something, let me try again...

kevinresol commented 8 years ago

Here it is: capture

ruby0x1 commented 8 years ago

That's much better.

It appears that the SDL_AddEventWatch is pushing a message when another thread is active. Knowing where and why is what was needed to fix it or work around it - I'll try a fix soon (but with dev log 8 you'll see a lot of changes are headed in here, which might happen first).