简体   繁体   中英

throwing c++ exception from android native code hangs thread

It seems that when I throw an exception from outside of a JNICALL function, any thrown exceptions will hang the thread.

That is, if I throw an exception directly inside a JNICALL function (java native function), it can be caught properly. If it's thrown from a function or method that the JNICALL function calls, even just once call deep, it will hang the thread.

I am confused and I can't find any references to anyone else having this issue.

My project is using the latest stable ndk, APP_STL is set to c++_shared, and the language std is set to gnuc++11.

Any help would be appreciated.

It would appear it might be a conflict with AddressSanitizer. Once I uninstalled it from the phone and disabled asan compiler flags, it's now working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM