-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Crash in _Unwind_RaiseException on Android #783
Comments
Thanks for reporting this! This is a bit surprising, as we are not actively hooking into the Its possible that some change in |
Changing the status based on the above. Please feel free to change. :) |
Hi @triplef. Sorry for the delay, but I invested a bit of time in analyzing the problem. The TLDR is this:
For more detail, feel free to read on. There are two aspects to the issue:
While the second aspect is the one that is currently affecting you, it is the first that we should fix. Let me first elaborate on the second:
I can't tell whether this (or a) change in the ABI causes the issue because I could not reproduce the segmentation fault even using outdated NDKs (compared to the ones used in the
which is what I would expect in such a situation. So there might be yet another unknown variable (target-arch?). I also looked into the release build of I used Android Studio No element in the code path from This brings me back to aspect 1: it shouldn't be necessary for the Native SDK or our client code to consider incidental code paths. |
Thank you very much for looking into this and your detailed summary of the underlying issues @supervacuus! 🙏 If I understand it correctly, the underlying issues of internal symbols being exported is planned to be fixed via #363. Regarding the NDK version: we’re using Could reproducing the issue depend on which NDK version the libobjc2 runtime was built with, since that is what is calling into the personality function? If so that might explain why you weren’t able to reproduce. Unfortunately it’s unclear to me to what extend NDK releases are supposed to be compatible – I think I read that compatibility is not guaranteed, but at the same time everyone seems to mix binaries built with different NDK releases (because building everything from source would be too much of a pain). In any case I’ll be watching #363 for the proper fix – if there’s anything I can do to help get this merged please let me know. |
Yes, I downloaded the latest pre-built and did not look into which NDK was used for the build. That would certainly explain why I do not see the issue. If the root cause is indeed in EH primitives, then it is, of course, more critical which NDK was used for building the Objective-C runtime rather than the app :-) It also substantiates my suspicion (though open to further verification), so thanks for the heads up. Regarding your question on NDK compatibility: I am not the right person to answer this, but I guess that breakage is very rare, depending on the abstraction level you are operating on. Again, I am not even sure the changes are the reason for your segfault; they were just the most apparent modifications at that level. |
Thanks, that makes sense. If you do want to try reproduce it once more, the previous toolchain build was done with NDK |
Now that #363 is released (thank you!) would it be possible to get the sentry-native dependency of sentry-java updated so we can give this a go? 🙏 |
Hi @triplef. The process is the following: pretty soonish, a GitHub bot will signal the Java SDK team that a new Native SDK release is out. Then they will integrate the update into their source tree and release it with their next release if our update doesn't raise any further issues on their side. When this happens, or if they will wait with the integration until a more significant release, I cannot say. I would still leave this issue open because even with a new CC @markushi. |
Here's a link to the relevant PR on |
@triplef we just released |
I tried 6.16.0-beta.1 and it works correctly now! Thank you, I really appreciate the work that went into supporting our probably somewhat rare case. 🙏 |
@triplef, thanks for giving the beta a test run! That is valuable feedback. While your case might be rare, the root cause can reach a broader audience. Revealing private dependencies is always a maintenance nightmare, especially at that level of abstraction. So, thanks also for providing another reason to fix this. |
Description
Calling
_Unwind_RaiseException()
on Android causes the following segfault for us using sentry-native v0.5.1 or later on Android via sentry-java. The issue does not happen using v0.5.0.We can reproduce the issue using sentry-java v6.6.0 or later, which bundles sentry-native v0.5.1. Using sentry-java v6.5.0 (bundling sentry-native v0.5.0) does not reproduce the issue.
We suspect the updated libunwindstack-ndk in v0.5.1 causing this issue.
Unfortunately I haven’t found documentation on how to build sentry-java for Android. I’m happy to debug/triage this further if someone could point me in the right direction.
We use Sentry with our Qt-based app using Objective-C on Android. In this setup,
_Unwind_RaiseException()
is called by the libobjc2 runtime to raise Objective-C exceptions.When does the problem happen
Environment
Steps To Reproduce
Log output
None.
The text was updated successfully, but these errors were encountered: