Skip to content
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

iOS app crashes randomly on startup #21485

Open
vsfeedback opened this issue Oct 21, 2024 · 3 comments
Open

iOS app crashes randomly on startup #21485

vsfeedback opened this issue Oct 21, 2024 · 3 comments
Labels
bug If an issue is a bug or a pull request a bug fix msbuild Issues affecting our msbuild tasks/targets
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version]
I am experiencing random startup crashes of iOS app when run on Simulator. This has been happening on all versions of .NET 8/9 I have tested, and can be reproduced via both VS and VS Code. The app usually starts up correctly several times, but on a subsequent build it starts crashing immediately after deploy and the only quite reliable way to fix it is to uninstall it from Simulator, git clean, and rebuild completely.

I attached the native crash dump below in errorreport.txt.

I made a recording of the issue below, which shows I ran the app, and it immediately crashed. Then I uninstalled it and rebuilt the slnf, and then ran again - which made the app run fine again. This sort of random behavior is what I am encountering with this issue.

Repro steps:

  1. Clone https://github.com/unoplatform/uno
  2. In src folder rename crosstargeting_override.props.sample to crosstargeting_override.props
  3. In the crosstargeting_override.props file uncomment prop and set it to net8.0-ios
  4. Open Uno.UI-netcoremobile-only.slnf and try to run SamplesApp.netcoremobile on iOS Simulator
  5. If it runs successfully, stop debugging, and make a small change like a debug writeline somewhere
  6. After several tries you should see the app crash immediately on startup

Original Comments

Feedback Bot on 10/12/2024, 04:43 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 10/18/2024, 09:44 PM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

@rolfbjarne
Copy link
Member

I can reproduce this with something like this:

$ dotnet build /bl
$ sed -i '' 's_// you can specify it here._System.Console.WriteLine("Hello world!");_' iOS/Main.iOS.cs
$ dotnet build /bl
# launch

@rolfbjarne rolfbjarne added this to the .NET 10 milestone Oct 21, 2024
@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix msbuild Issues affecting our msbuild tasks/targets labels Oct 21, 2024
@yeahg-dev
Copy link

Is this crash report also related to this issue?
this crash infer app crashed as soon as launched.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0


Thread 0 name:
Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001d9a882ec __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001ed87bc0c pthread_kill + 268 (pthread.c:1721)
2   libsystem_c.dylib             	0x0000000198d87ba0 abort + 180 (abort.c:118)
3   FindingMateView               	0x000000010d573404 xamarin_unhandled_exception_handler + 60 (runtime.m:1134)
4   FindingMateView               	0x000000010d724ca0 mono_invoke_unhandled_exception_hook + 156 (exception.c:1219)
5   FindingMateView               	0x000000010d7bf748 mono_jit_exec_internal + 56 (driver.c:1374)
6   FindingMateView               	0x000000010d7bf748 mono_jit_exec + 396 (driver.c:1314)
7   FindingMateView               	0x000000010d57ba64 xamarin_main + 952 (monotouch-main.m:495)
8   FindingMateView               	0x000000010d8a4408 main + 64 (main.arm64.mm:555)
9   dyld                          	0x00000001b45cf154 start + 2356 (dyldMain.cpp:1298)

Crash report

@rolfbjarne
Copy link
Member

@yeahg-dev no, that's an unhandled managed exception. You need to figure out what that exception was.

One way to do that is to add event handlers for the exception marshaling process; for more information see: https://github.com/MicrosoftDocs/xamarin-docs/blob/live/docs/ios/platform/exception-marshaling.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix msbuild Issues affecting our msbuild tasks/targets
Projects
None yet
Development

No branches or pull requests

3 participants