-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfaults during unwinding after throwing exception #774
Comments
Looks like #379 might be related? |
Per the example I saw in #289, I ran the readelf command on my shared library (the one generating the segfault):
According to one of the comments there, these should not be
This all looks correct to me, so why are unwind handlers not defined properly? |
Tested on r16b and I'm still seeing the UND on those unwind symbols |
Example command line invocation of compiler through CMake using ndk r16b:
And the linker command it prints:
|
I rebuilt some libraries and this went away. |
Yeah, that's usually the case with this issue these days. What probably happened above is that the libraries/objects/etc listed in the response file had a shared library that wasn't built with |
Good news is I got libc++ working on API 15 using ndk r17. Been a year or
two in the making. Now you have one less reason to keep gnustl around 😉
…On Fri, Aug 17, 2018, 4:02 PM Dan Albert ***@***.***> wrote:
Yeah, that's usually the case with this issue these days. What probably
happened above is that the libraries/objects/etc listed in the response
file had a shared library that *wasn't* built with --exclude-libs linked
before libgcc/libunwind (if libgcc isn't listed explicitly, it's added to
the very end by the computer, which is iirc the usual case for cmake). When
that happens the linker finds the public symbols for the unwjnder and loads
them for that library instead of including them from the static library.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#774 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABr6dmWNh359TJ_kr24nj_OrM3OSpDTXks5uRy9igaJpZM4WBpMC>
.
|
I'm observing that when I throw exceptions from my code, I get segfaults in destructors of local objects. Example of what I see in Android Studio:
SIGSEGV (signal SIGSEGV: address access protected (fault address: 0x5f023dd9))
In my case, the call stack shows it is in the destructor of one of my local objects (a custom string class). Once the exception is thrown, this string would obviously be destructed as part of the unwinding process.
Here are the details of how I have built my code:
NDK Version: r17b
Minimum API: android-15
ABI: armeabi-v7a
Actual API of the device: android-17
STL: libc++ (shared)
Toolchain: clang
I never had this issue using gnustl (shared). I am attempting to migrate to libc++ which is why I'm hitting this now. Is this a bug? I don't see how it could be my code since this code has worked for years using gnustl. Please let me know what I can do to help. I'm able to set breakpoints and debug on device but it doesn't do me any good since I can't investigate a root cause for this from my code alone.
The text was updated successfully, but these errors were encountered: