Skip to content

# Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr ************ in tid **** (SGen worker) #105389

@dcrespo-isaac

Description

@dcrespo-isaac

Android framework version

net8.0-android

Affected platform version

.NET 8.0.100, .NET 8.0.303

Description

Our Android application started to crash randomly 3 months ago when we upgraded it to .net6.
We tried to add more logging, analyze the logcat, reproduce... but all in vain.

In an attempt to stabilize the app, we have upgraded to .net8.0-android and the number of crash was significantly reduced.
This problem happens on different kind of tablets, and we excluded the idea that it could come from firmware or hardware
because they did not change and with .net framework (Xamarin) everything was running smoothly (1 crash rarely vs hundreds per day now).

Our dev and testing team (qa) are not able to reproduce the problem. Looking at the logs (SIGSEGV_Samples_logcat-with-symbols.txt), we see that all of the SIGSEGV (SEGV_MAPERR) happens on the SGen worker thread but give different backtraces.
At the end of the log file, you’ll find a SIGABRT from SGen. We’ve kept it there for reference, in case it’s related to the SIGSEGV issues.

We used dotnet-symbol to retrieve a debug version of libmonosgen-2-0.so (with symbols). Then we run ndk-stack on our
logcat to symbolize the backtraces.

Application catches nothing. So we don't have any other traces to give from it. The logcat contains the most detailled
ones we have.

FYI, we did split our crashes into 3 categories, we're not sure that they related to the SIGSEGV...
but to give you all data, the other 2 are :

  • Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid ***** (|ANR-WatchDog|), pid ***** (com.isaac.onthego)
  • Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid ***** (enableInternal), pid ***** (com.android.nfc)

What we tried :

  • Reproducing by running our acceptance tests on the tablet
    -> Nothing happens unless we run the day long tests and it's very rare. It does not give more information than what we have in production.

  • Upgrading .net version (from 8.0.100 to 8.0.303)
    -> Nothing changed.

  • Revert to .Net Framework (Xamarin)
    -> We did it in order to identify if it's related to our changes or the framework. And it worked !!!
    The number of crash were back to normal (before .net6 and .net8).

  • *** EDIT *** We also tried to disable trimming by settings <PublishTrimmed>false</PublishTrimmed> in all of our .csproj.
    -> Our APK was a little bit heavier (of course) and no changes in number of crashes..

What we are still probing :

  • Disabling concurrency on Mono Garbage collector and change the bridge-implementation to old
    -> We’ve seen numerous issues and discussions about the stability of SGen. We are hoping that this change can make a difference, as the backtraces seem to point to a problem that could be within it. If this works, it could allow us to stay with .net8 until a fix is found.

Thank you in advance for your help. We will remain vigilant if you need more details.

Steps to Reproduce

Unfortunetaly we are unable to reproduce the problem in step by step as it appears randomly on production.

Did you find any workaround?

Currently, reverting to the .Net Framework appears to be effective for us.

Relevant log output

See attached files of the description

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions