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

NativeAOT app crashes on macOS 11 #20196

Closed
tipa opened this issue Feb 25, 2024 · 3 comments
Closed

NativeAOT app crashes on macOS 11 #20196

tipa opened this issue Feb 25, 2024 · 3 comments
Labels
need-info Waiting for more information before the bug can be investigated
Milestone

Comments

@tipa
Copy link

tipa commented Feb 25, 2024

Since I enabled NativeAOT for my macOS app, it seems to be crashing on macOS 11 (which is also my LSMinimumSystemVersion)

Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x000000018ba90e68 __pthread_kill + 8
1   libsystem_pthread.dylib       	0x000000018bac343c pthread_kill + 292 (pthread.c:1582)
2   libsystem_c.dylib             	0x000000018ba0b454 abort + 124 (abort.c:118)
3   my.app.AppPackage             	0x00000001008f6354 0x100820000 + 877396
4   my.app.AppPackage             	0x00000001008abd54 0x100820000 + 572756
5   my.app.AppPackage             	0x00000001008a3718 0x100820000 + 538392
6   my.app.AppPackage             	0x00000001008ad34c 0x100820000 + 578380
7   my.app.AppPackage             	0x0000000100bfe550 0x100820000 + 4056400
8   my.app.AppPackage             	0x0000000100833914 xamarin_initialize + 228
9   my.app.AppPackage             	0x000000010083cbf8 0x100820000 + 117752
10  my.app.AppPackage             	0x000000010085d2ac 0x100820000 + 250540
11  libdyld.dylib                 	0x000000018bae1430 start + 4

I tried to symbolicate the crash report (lines 3-10) and got this:

ReleaseCondAttr(_opaque_pthread_condattr_t*) (in Diarium) (PalRedhawkUnix.cpp:122)
RhInitialize (in MyApp) (startup.cpp:376)
InitializeRuntime() (in MyApp) (main.cpp:167)
Thread::ReversePInvokeAttachOrTrapThread(ReversePInvokeFrame*) (in MyApp) (thread.cpp:1181)
fram0_Microsoft_macOS_ObjCRuntime_Runtime__SafeInitialize (in MyApp) (Runtime.cs:266)
xamarin_initialize (in MyApp) (runtime.m:1332)
xamarin_main (in MyApp) (monotouch-main.m:441)
main (in MyApp) (main.arm64.mm:50)

Looking at the crash reports & session statistics in App Store Connect, it crashes always on every launch attempt.
Various macOS 11 versions are affected, but no crashes for macOS 12 & newer.
Is NativeAOT expected to work on macOS 11?

Environment

.NET 8 with NativeAOT

@rolfbjarne
Copy link
Member

It took me a while to get a mac with macOS 11 up and running, but I was able to run a NativeAOT-compiled macOS app just fine.

However, I tried debugging with lldb just to see if my test app would hit the same stack trace, and while the RhInitialize function is called, the ReleaseCondAttr function isn't, so I'm not sure my test case is entirely valid.

Would you be able to send me your app so that I can run it locally?

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Feb 28, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Feb 28, 2024
Copy link
Contributor

Hi @tipa. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@rolfbjarne
Copy link
Member

main (in MyApp) (main.arm64.mm:50)

So my macOS 11 machine is x64, and this seems to happen on arm64 only.

Also given that:

  1. In .NET 8, NativeAOT is in preview for us.
  2. In .NET 9, we'll bump the min macOS version to macOS 12.

We've decided not to investigate this, since it'll likely be a rather big effort for not much gain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-info Waiting for more information before the bug can be investigated
Projects
None yet
Development

No branches or pull requests

2 participants