android: [.NET 8] Android crash at `xamarin::android::Helpers::abort_application`

Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

Affected platform version

.NET 8.0.101, Android workload 34.0.52, Android NDK 26.1.10909125

Description

We are getting a lot of native crashes in production that we don’t have on Xamarin. Here is the top 1 crash stack trace:

libc.so                    0x8ced76c8 + 337608
libc.so                    0x8ced7698 + 337560
libmono-android.release.so xamarin::android::Helpers::abort_application()
libmonosgen-2.0.so         mono_debugger_agent_unhandled_exception
libmonosgen-2.0.so         mono_debugger_agent_unhandled_exception
libmonosgen-2.0.so         mono_debugger_agent_unhandled_exception
libmonosgen-2.0.so         mono_runtime_class_init_full
libmonosgen-2.0.so         mono_jit_set_domain
libmonosgen-2.0.so         mono_jit_set_domain
libmonosgen-2.0.so         mono_install_ftnptr_eh_callback
libmonosgen-2.0.so         mono_install_ftnptr_eh_callback

Unfortunately, we don’t have any ADB logs or a repro and we only see it in production.

We publish our application in AOT and, obviously, release configuration, so I’m also a little concerned about the jit and debugger in the stack trace - not sure if it’s expected or something went wrong with our build process too.

Can anyone provide their thought on this issue, possible workarounds, etc.?

Steps to Reproduce

No repro, only getting crash reports from production.

Did you find any workaround?

No response

Relevant log output

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (15 by maintainers)

Most upvoted comments

@lambdageek thanks for the idea. Although, we did try to release our app on 8.0.100 a few weeks back, and we still had these abort_application crashes too, it just wasn’t top 1. Maybe the failed assertion is not (always?) a root cause.

I think we’ll try to release on 8.0.100 once again and see if we’ll be able to get more logs.

note that once 8.0.101 was released, installing a .NET workload will pick up the 8.0.1 runtime pack; just changing things in global.json to pin the SDK isn’t enough. you need the .csproj Target to override the runtime pack explicitly. .NET workloads are non-intuitive

<Target Name="UpdateRuntimePackVersion" BeforeTargets="ProcessFrameworkReferences">
  <ItemGroup>
    <KnownRuntimePack Condition="%(RuntimePackLabels) == 'Mono'" LatestRuntimeFrameworkVersion="8.0.0" />
  </ItemGroup>
</Target>