Crash in libunwind?

We are getting this cryptic native crash on a Oculus Quest:

[ 0 ] std::__ndk1::shared_ptr<unwindstack::Elf>::~shared_ptr() (libunity.so)
[ 1 ] unwindstack::MapInfo::~MapInfo() (libunity.so)
[ 2 ] 0x740dae911e (base.odex)

Is there anyway to disable this use of libunwind in Unity? Why would it be crashing during stack unwind?

It’s used whenever stacktrace is being resolved, you could disable it by setting stacktrace logging to None in Player Settings, but I think it would be still be used when the actual crash is occuring.

In any case if you have a 100% repro crash with this stacktrace, could you please report a bug with repro project attached? Thank you.

Our stack traces are set to “ScriptOnly,” so should we expect it to make a difference to put it to “None”?

If you’re using IL2CPP, then yes, None - should disable that code path, assuming the stacktrace resolving is done from scripts, from your callstack it’s not totally clear if that’s the case.

We see variations of this issue extensively on our live releases. Have been unable to repro locally so aren’t able to provide a sample project. We do obviously use IL2CPP.

We currently rely on Unity Diagnostics and Bugsnag to track issues. What are the implications of disabling Stack Trace logging on diagnostic efforts?

SIGSEGV Segmentation violation (invalid memory reference)     
libunity std::__ndk1::shared_ptr<unwindstack::Elf>::~shared_ptr()     
libunity unwindstack::MapInfo::~MapInfo()     
libunity unwindstack::Maps::Clear()     
libunity UnityFinalDeinitApplication()     
libunity nativeDone(_JNIEnv*, _jobject*)     
/data/app/com.bhe.alicelegends-iHird0Ma2aXdzujzqQQnhw==/oat/arm64/base.odex:474640 0x74f4435e10
SIGSEGV Segmentation violation (invalid memory reference)     
libunity std::__ndk1::shared_ptr<unwindstack::Elf>::~shared_ptr()     
libunity unwindstack::MapInfo::~MapInfo()     
libunity unwindstack::Maps::Clear()     
libunity UnityFinalDeinitApplication()     
libunity nativeDone(_JNIEnv*, _jobject*)     
/data/dalvik-cache/arm64/mnt@asec@com.bhe.alicelegends-fWIww8RHXDEDOJo9@base.apk@classes.dex:699920 0x6f370b2e10

Seems like it’s crashing when application is being closed by OS, disabling stack trace logging only affects Debug.Log/LogError and similar functions, in case of a crash Unity will still try to resolve stacktrace, other than that it doesn’t impact the game

We rolled out an update with the above suggestion but still get this crash on Android.

7109473--848128--upload_2021-5-5_12-34-37.png

The log clearly indicates that the game has terminated as far as the client code paths are concerned.

7109473--848131--upload_2021-5-5_12-37-8.png

The issue is a continual source of instability on Android for us since Android instability impacts discoverability on the platform. Is there anything else we can try to mitigate? Alternatively, what is the best way to go about helping you to fic the issue within Unity given that it is intermittent and hard to repro for us?

There also seems to be a second route for the exception to occur.

This is a bug on our side. It happens on application quit. We’re rolling out a fix for it.

1 Like

Hi Aurimas-Cernias, many thanks for the fix. We’re very excited to get this as soon as possible.

Currently, the issue causes us to be flagged for “bad behaviour” in the Google Play dashboard, which significantly harms our organic installs. Do you have an ETA on when we might be able to get the fix?

Thanks again,
Mark

I approved pull requests for backports of this feature yesterday (all supported resleases), so it’s a matter of how long it takes to land them, test and publish release. Should be few weeks from now.

Which Unity releases will this make it in for? Thanks!

Thank you for reporting and investigating this issue, it sounds like this is what is happening to our app. We are affected much in the same way as BearHugMark so - if possible - we would love an approximate ETA of the fix, or which version it is in if it has already been released.

All the best,
Emilio

Has the fix been rolled out yet? Is there an issue in the issuetracker that I could follow? We get quite a lot of those sigsegv errors. Thanks for your work on this!

I can see that a fix made it into 2021.1.10f1 which links to this issue.

Looking over the release notes for 2019.4.28 I can’t see anything matching it. So I suppose we wait for the fix to get backported. I wonder how long that takes.

did the 2019.4.x fixed this issue? thanks.

我们在Unity2020.1.14f1开发项目遇到了相同,请问现在有什么最新的进展吗?

Hi, have you fix that bug?