-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Android] App crashing with condition `xref_count == xref_index' not met #106410
Comments
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:
|
@jonathanpeppers could you or someone on Android team have a look? |
I don't think this is related to dotnet/android. It says it's on this line: If I look on the
I think we can transfer to runtime. |
Tagging subscribers to this area: @BrzVlad |
@BrzVlad could you please take a look? |
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 |
We are having the same issue at the moment, version 8.0.91 |
We were able to fix the issue using the suggestion above. We added an Environment.txt file with the following: And added this to the project file:
|
Are you suggesting to use the Environment.txt file approach rather than code approach mentioned below? We tried setting the bridge implementation like below but it didnt work. |
Follows the recommendation from dotnet/runtime#106410 (comment)
Also having this issue /__w/1/s/src/mono/mono/metadata/sgen-tarjan-bridge.c:1176, condition xref_count == xref_index' not met, function:processing_build_callback_data, xref_count is 137 but we added 133 xrefs The problem arises when browsing some pages of the application for a while. In the .Net 8 version this same problem did not seem to happen. The application closes without throwing debugger-level exceptions. Among the suggestions, is there any appropriate action to try to resolve the problem? |
I have a pretty good idea why is this happening. This code path can introduce duplicates into the runtime/src/mono/mono/metadata/sgen-tarjan-bridge.c Lines 795 to 798 in b658cd2
Then we get to the code that counts runtime/src/mono/mono/metadata/sgen-tarjan-bridge.c Lines 1101 to 1114 in b658cd2
It uses the runtime/src/mono/mono/metadata/sgen-tarjan-bridge.c Lines 131 to 139 in b658cd2
The runtime/src/mono/mono/metadata/sgen-tarjan-bridge.c Lines 1126 to 1130 in b658cd2
|
I managed to reproduce the scenario in my synthetic tests: https://github.com/filipnavara/runtime/tree/standalone-gc-bridge-test Presumably it can be further simplified. |
Repro: |
I am also facing this:
Unfortunatly I don't have a simplified repro Using:
|
Getting this issue also on Android. Only the debug window shows any clue on what happened when the app crashed:
|
A fix is being worked on. Until it is released, you can use the workaround in #106410 (comment). |
This does not fix the issue. I added it and it still crashes. |
It literally doesn't enter the problematic code path if the option is applied, so either you are experiencing a different issue or the workaround was not applied correctly. Can you post the things that you added to your project file and the part of the crash log containing the "assert" message? |
It worked for me. Did you clean and build after? |
I added this to my csproj file:
And then I added the Environment.txt file with content of: I also did a clean/rebuild and still no luck. Below is what the latest output window shows:
|
I remember there being some issues with passing env variables to android app. @jonpryor I think you took a look at this not too long ago, do you have some more info ? |
That does look reasonable but apparently the environment variable is not set to the new value. Can you verify that you don't have some other |
In my code I added this in the App.xaml.cs:
and it returns this: So it seems to me the environment variable is not working. I did a search to see if it is being set anywhere else and it isn't. |
This is probably dotnet/android#9701. Someone there mentioned |
So when I added this:
My code now shows this: Debugging seems to be running better now without crashing but I am still testing. It was really slow starting the debugger tho. |
yes that's expected. This disables the Fast Deployment feature which means a lot more data needs to be packed into the .apk |
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:
dotnet/maui#23827
dotnet/maui#23634
dotnet/maui#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
The text was updated successfully, but these errors were encountered: