-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Random app crashes on publish in AOT mode #26890
Comments
@rolfbjarne thoughts? |
@jdarwood007 not sure if it matters, but are you using the interpreter? Have you set the |
I found these issues:
Might be unrelated, might not be. |
@mattleibow I do not have it defined in my .csproj, so no. Although a quick read on the documentation seems that this may be the reason because I use generics. I consume a REST API returning JSON results and it uses a standardized return with a property that has a defined type (so my return is something like I did enable However, I can get it to build and run successfully randomly and even have releases. My thoughts here are that something on the Visual Studio or Mac OS side is being held and retained during the build from a previous build and causing this. It is possible that a file is being cached improperly, a file stat call is returning cached results or a file is not recognized as needing to be rebuilt. For the linked issues, the first issue mentions The second issue was resolved with an update, but the change message indicates a different function than the one I'm seeing crashing. That is we are seeing The third linked issue isn't relevant, as their crash is caused by code they directly wrote, whereas from what I can tell, my issue occurs early on in the startup process, before my code can even execute. |
This issue was moved to xamarin/xamarin-macios#21908 |
Description
Random app crashes on publish in AOT mode
I am randomly getting app crashes in my app, only in release mode and only after sending to the App store and running in TestFlight on a physical device. Making this very difficult to get debugging information.
The problem seems to go away randomly as well. I can sometimes get the error to go away after a few times of cleaning and building the solution. It is inconsistent in what I do to fix it. However I have determined that even with no code changes in my app, after a few times of rebuilding and cleaning that I can send the exact same code up and have it not crash.
I got a crash report and had all symbols stripped. So I've added this to my .csproj
This resulted in me being able to get this stack trace:
It seems the app is hitting
mono_exception_from_name_two_strings_checked
early on in the startup of my app, as indicated the code is in the main and xamarin triggered the faulty code.I hooked up the device to a Mac mini and was able to get the console to present the following error message
This seems to back the results of what I am experiencing in that the crash is occurring randomly and that cleaning fixes it, by possibly removing that out of date dependency.
To resolve the crashes, I have done the following, all sometimes work and at other times does not resolve the issue.
I don't have any project to provide, as it is random and by luck I feel, will just work for a bit. I've seen this on a few projects I work with and the resolution has always been the same, try to clean things and rebuild until it works.
I have noticed that more often than not, the problem seems to exist after I deployed a the app to the device via TestFlight , if I plug it into the mac and deploy the app in debug mode, unplug device, clean, rebuild and publish the app into TestFlight and install the TestFlight version, it will crash.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.21 SR2.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
Any
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: