dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.95k stars 4.65k forks source link

[Android] App crashing with condition `xref_count == xref_index' not met #106410

Open kklose23 opened 1 month ago

kklose23 commented 1 month ago

Description

This is happening when using shell navigation to navigate to a bunch of pages. Unfortunately I was unable to reproduce it on a simpler project to post. So I'm uncertain exactly what's causing this. However, it was working on MAUI version 8.0.40 and broke on subsequent versions.

I was able to reproduce on the Android emulator

Others have posted about this as well: https://github.com/dotnet/maui/issues/23827 https://github.com/dotnet/maui/discussions/23634 https://github.com/dotnet/maui/discussions/23826

Steps to Reproduce

See description

Link to public reproduction project repository

No response

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.40 SR5

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

[namix.mobileapp] * Assertion at /__w/1/s/src/mono/mono/metadata/sgen-tarjan-bridge.c:1174, condition `xref_count == xref_index' not met, function:processing_build_callback_data, xref_count is 1101 but we added 1096 xrefs
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 8651 (namix.mobileapp), pid 8651 (namix.mobileapp)
github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Redth commented 1 month ago

@jonathanpeppers could you or someone on Android team have a look?

jonathanpeppers commented 1 month ago

I don't think this is related to dotnet/android.

It says it's on this line: src/mono/mono/metadata/sgen-tarjan-bridge.c:1174

If I look on the release/8.0 branch might be this g_assertf():

I think we can transfer to runtime.

dotnet-policy-service[bot] commented 1 month ago

Tagging subscribers to this area: @brzvlad See info in area-owners.md if you want to be subscribed.

vitek-karas commented 4 weeks ago

@BrzVlad could you please take a look?

BrzVlad commented 4 weeks ago

I've seen reports for crashes like this for a few years now, ever since we switched to the tarjan bridge implementation as default, but we havent yet received a repro project so that we can investigate. The recommended solution is to use the new bridge by adding this to the environment vars: MONO_GC_PARAMS=bridge-implementation=new.