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

net5.0 app crash on Apple M1 under Rosetta 2 emulation #48877

Closed
k15tfu opened this issue Feb 27, 2021 · 9 comments
Closed

net5.0 app crash on Apple M1 under Rosetta 2 emulation #48877

k15tfu opened this issue Feb 27, 2021 · 9 comments

Comments

@k15tfu
Copy link
Contributor

k15tfu commented Feb 27, 2021

Hi! Sometimes my self-contained app published for osx-x64 crashes on M1 as follows:

Process:               Mandelbrot [46749]
Path:                  /Users/USER/*/Mandelbrot
Identifier:            Mandelbrot
Version:               0
Code Type:             X86-64 (Translated)
Parent Process:        zsh [45679]
User ID:               502

Date/Time:             2021-02-27 19:33:29.473 +0300
OS Version:            macOS 11.2.1 (20D74)
Report Version:        12
Anonymous UUID:        99CA9E8A-60BC-03E4-C062-DCBF45315D56

Sleep/Wake UUID:       4230E9B0-E302-4819-826A-DC28A40EC099

Time Awake Since Boot: 520000 seconds
Time Since Wake:       96000 seconds

System Integrity Protection: enabled

Crashed Thread:        13

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000100000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [46749]

VM Regions Near 0x100000000:
--> 
    __TEXT                      102708000-102716000    [   56K] r-x/r-x SM=COW  /Users/*

[...]
Thread 13 Crashed:
0   <translation info unavailable>	0x0000000102ad0718 ???
1   libsystem_kernel.dylib        	0x00007fff20325f86 swtch_pri + 10
2   libcoreclr.dylib              	0x000000010ac27185 PAL_DispatchException + 357
3   libcoreclr.dylib              	0x000000010ac26d37 PAL_DispatchExceptionWrapper + 10
4   ???                           	0x0000000100000000 0 + 4294967296
5   ???                           	0x0000000111a74ee9 ???
6   ???                           	0x0000000111a74738 ???
7   ???                           	0x0000000111a749e8 ???
8   ???                           	0x0000000111a71fc7 ???
9   ???                           	0x0000000111a70bb1 ???
10  ???                           	0x00000001115d03e2 ???
11  ???                           	0x00000001115d97e1 ???
12  ???                           	0x00000001115d04fe ???
13  libcoreclr.dylib              	0x000000010af113b9 CallDescrWorkerInternal + 124
14  libcoreclr.dylib              	0x000000010ad6609f MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 1519
15  libcoreclr.dylib              	0x000000010ad76a04 ThreadNative::KickOffThread_Worker(void*) + 404
16  libcoreclr.dylib              	0x000000010ad30cdb ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 315
17  libcoreclr.dylib              	0x000000010ad31290 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32
18  libcoreclr.dylib              	0x000000010ad76b7f ThreadNative::KickOffThread(void*) + 191
19  libcoreclr.dylib              	0x000000010ac24ffa CorUnix::CPalThread::ThreadEntry(void*) + 426
20  libsystem_pthread.dylib       	0x00007fff2035a950 _pthread_start + 224
21  libsystem_pthread.dylib       	0x00007fff2035647b thread_start + 15

Full log is here Mandelbrot_2021-02-27-193331.crash.txt. I was unable to reproduce the crash last few hours, but you can try to do it using Mandelbrot.zip from #13041:

  1. Add net5.0 as TargetFrameworks in .csproj
  2. $DOTNET_SDK/dotnet publish --self-contained=true -c Release -f net5.0 -r osx-x64 Mandelbrot.csproj -o tmp
  3. for i in {1..1000}; do echo $i; ./tmp/Mandelbrot --width=1024 --height=768 || break; done

macOS Big Sur 11.2.1
.NET SDK 5.0.103 x64

Linked issues: #44897

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 27, 2021
@k15tfu
Copy link
Contributor Author

k15tfu commented Apr 3, 2021

@sdmaclea @janvorli Do you need any more information I can provide?

@janvorli
Copy link
Member

janvorli commented Apr 6, 2021

@k15tfu I am sorry, I was OOF for a month from February 22 and I've missed this issue after getting back. I'll try to repro it locally running under lldb to see if I can get more details on it.

@mangod9
Copy link
Member

mangod9 commented Jul 14, 2021

Hi @k15tfu, are you still able to repro this on 11.3+? There have been fixes in that release which resolved Rosetta issues.

@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Jul 14, 2021
@mangod9 mangod9 added this to the 6.0.0 milestone Jul 14, 2021
@k15tfu
Copy link
Contributor Author

k15tfu commented Jul 17, 2021

@mangod9 Yes, it still fails on macOS 11.4:

Process:               Mandelbrot [21856]
Path:                  /opt/teamcity-agent/*/Mandelbrot
Identifier:            Mandelbrot
Version:               0
Code Type:             X86-64 (Translated)
Parent Process:        mono-sgen [21046]
Responsible:           bash [553]
User ID:               502

Date/Time:             2021-07-13 06:14:08.585 +0300
OS Version:            macOS 11.4 (20F71)
Report Version:        12
Anonymous UUID:        3BC01934-B29E-74C0-87B8-B558D0C364C1


Time Awake Since Boot: 3900000 seconds

System Integrity Protection: enabled

Crashed Thread:        26

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0xbfeb8b8c76c0fc02 -> 0xffff8b8c76c0fc02 (possible pointer authentication failure)
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [21856]

VM Regions Near 0xffff8b8c76c0fc02:
--> mapped file              7fffe0000000-7fffe2e88000 [ 46.5M] r--/r-- SM=COW  Object_id=ca6c06b5
    
[...]
Thread 26 Crashed:
0   ???                           	0xbfeb8b8c76c0fc02 0 + 13829300516175281154
1   libsystem_kernel.dylib        	0x00007fff203293c2 swtch_pri + 10
2   libcoreclr.dylib              	0x000000010c937f95 PAL_DispatchException + 357
3   libcoreclr.dylib              	0x000000010c937b47 PAL_DispatchExceptionWrapper + 10
4   ???                           	0xffff8b8c76c0fc02 0 + 18446616034136882178
5   ???                           	0x00000001137a46e1 ???
6   ???                           	0x00000001137a645d ???
7   ???                           	0x00000001137a3a8e ???
8   ???                           	0x00000001137a5f3c ???
9   ???                           	0x0000000113798972 ???
10  ???                           	0x0000000113797d8e ???
11  ???                           	0x000000011379775d ???
12  ???                           	0x00000001137975bd ???
13  ???                           	0x0000000113796ff6 ???
14  libcoreclr.dylib              	0x000000010cc223c9 CallDescrWorkerInternal + 124
15  libcoreclr.dylib              	0x000000010ca76ebf MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 1519
16  libcoreclr.dylib              	0x000000010ca87754 ThreadNative::KickOffThread_Worker(void*) + 404
17  libcoreclr.dylib              	0x000000010ca41b0b ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 315
18  libcoreclr.dylib              	0x000000010ca420c0 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32
19  libcoreclr.dylib              	0x000000010ca878cf ThreadNative::KickOffThread(void*) + 191
20  libcoreclr.dylib              	0x000000010c935e0a CorUnix::CPalThread::ThreadEntry(void*) + 426
21  libsystem_pthread.dylib       	0x00007fff2035e8fc _pthread_start + 224
22  libsystem_pthread.dylib       	0x00007fff2035a443 thread_start + 15

@mangod9 mangod9 modified the milestones: 6.0.0, 5.0.x Aug 3, 2021
@deeprobin
Copy link
Contributor

@mangod9 Is this still relevant for the .NET 5 milestone? (The EOS for this version is already on May 8, 2022).

@mangod9
Copy link
Member

mangod9 commented Feb 2, 2022

@k15tfu is this still blocking you? Given that .net 6 has been now released perhaps we could close this?

@deeprobin
Copy link
Contributor

@mangod9 I think we can close this

.NET 6 is the first fully supported SDK for Rosetta 2 emulation.

See dotnet/sdk#22380 for details.

For reference: #44897 (comment)

/cc @jkotas

@mangod9
Copy link
Member

mangod9 commented Feb 4, 2022

cool, thanks

@mangod9 mangod9 closed this as completed Feb 4, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants