osoftteam/dropboxQt

DropboxWebAuth methods throw exceptions inside slot-lambda -> causes SIGABRT in Android NDK's libstdc++ EHABI

Opened this issue · 0 comments

Unlike the templated (E, F) exception handling used elsewhere, the methods in DropboxWebAuth.cpp throw a DropboxException from inside a lambda connected to a Qt slot. In macOS Clang's libstdc++, this exception unwinds successfully back to the caller, but in Android NDK r19 (at least), the exception fails to unwind through the EHABI code and SIGABRT is signaled (observed by instruction-level debugging). I have not tried porting my code to iOS, yet, so don't know if the same will happen there.
I worked around this by making DropboxWebAuth do what the templated classes do in dropboxQt's endpoint code — that is, create a std::unique_ptr if an error is detected inside the lambda, then check for it after the QEventLoop exits, and raise it there instead — works fine on both platforms.