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

dotnet publish crashes with EXC_BAD_ACCESS (SIGBUS, SIGSEGV) on Apple M1 #48902

Closed
k15tfu opened this issue Mar 1, 2021 · 11 comments
Closed
Labels
arch-arm64 area-VM-coreclr os-macos-bigsur (macOS11) untriaged New issue has not been triaged by the area owner
Milestone

Comments

@k15tfu
Copy link
Contributor

k15tfu commented Mar 1, 2021

Hi! I see some crashes when running dev builds of .NET SDK for macOS arm64, downloaded from https://github.com/dotnet/installer/blob/master/README.md#installers-and-binaries (specifically, dotnet-sdk-6.0.100-preview.1.21108.2-osx-arm64):

Process:               dotnet [63388]
Path:                  /Users/USER/Downloads/*/dotnet
Identifier:            dotnet
Version:               0
Code Type:             ARM-64 (Native)
Parent Process:        ??? [1]
User ID:               502

Date/Time:             2021-02-27 21:58:13.935 +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: 530000 seconds
Time Since Wake:       100000 seconds

System Integrity Protection: enabled

Crashed Thread:        10

Exception Type:        EXC_BAD_ACCESS (SIGBUS)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x00000002871a0010
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Bus error: 10
Termination Reason:    Namespace SIGNAL, Code 0xa
Terminating Process:   exc handler [63388]

VM Regions Near 0x2871a0010:
    VM_ALLOCATE                 287130000-2871a0000    [  448K] rw-/rwx SM=ZER  
--> VM_ALLOCATE                 2871a0000-2871b0000    [   64K] rwx/rwx SM=ZER  
    VM_ALLOCATE                 2871b0000-2871f0000    [  256K] rw-/rwx SM=ZER  

[...]
Thread 10 Crashed:
0   libcoreclr.dylib              	0x0000000102d92060 EEJitManager::CleanupCodeHeaps() + 140
1   libcoreclr.dylib              	0x0000000102d92030 EEJitManager::CleanupCodeHeaps() + 92
2   libcoreclr.dylib              	0x0000000102b322a4 GCToEEInterface::GcStartWork(int, int) + 28
3   libcoreclr.dylib              	0x0000000102bfa9b8 SVR::gc_heap::garbage_collect(int) + 1464
4   libcoreclr.dylib              	0x0000000102bf9d5c SVR::gc_heap::gc_thread_function() + 688
5   libcoreclr.dylib              	0x0000000102bf9aac SVR::gc_heap::gc_thread_stub(void*) + 60
6   libcoreclr.dylib              	0x0000000102b3442c (anonymous namespace)::CreateNonSuspendableThread(void (*)(void*), void*, char16_t const*)::$_1::__invoke(void*) + 76
7   libcoreclr.dylib              	0x00000001029da18c CorUnix::CPalThread::ThreadEntry(void*) + 380
8   libsystem_pthread.dylib       	0x00000001a2e2206c _pthread_start + 320
9   libsystem_pthread.dylib       	0x00000001a2e1cda0 thread_start + 8

(full log is here dotnet_2021-02-27-215819.crash.txt)

, or

Process:               dotnet [94016]
Path:                  /Users/USER/Downloads/*/dotnet
Identifier:            dotnet
Version:               0
Code Type:             ARM-64 (Native)
Parent Process:        dotnet [94014]
User ID:               502

Date/Time:             2021-03-01 07:17:25.896 +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: 650000 seconds
Time Since Wake:       220000 seconds

System Integrity Protection: enabled

Crashed Thread:        19

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

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

VM Regions Near 0:
--> 
    __TEXT                      104560000-10456c000    [   48K] r-x/r-x SM=COW  /Users/*/Downloads/*

[...]
Thread 19 Crashed:
0   libcoreclr.dylib              	0x0000000104d20d00 WKS::gc_heap::mark_object_simple(unsigned char**) + 132
1   libcoreclr.dylib              	0x0000000104d240f0 WKS::gc_heap::mark_through_cards_for_segments(void (*)(unsigned char**), int) + 2920
2   libcoreclr.dylib              	0x0000000104d240f0 WKS::gc_heap::mark_through_cards_for_segments(void (*)(unsigned char**), int) + 2920
3   libcoreclr.dylib              	0x0000000104d192fc WKS::gc_heap::mark_phase(int, int) + 1112
4   libcoreclr.dylib              	0x0000000104d1664c WKS::gc_heap::gc1() + 880
5   libcoreclr.dylib              	0x0000000104d1eed0 WKS::gc_heap::garbage_collect(int) + 1928
6   libcoreclr.dylib              	0x0000000104d11ab8 WKS::GCHeap::GarbageCollectGeneration(unsigned int, gc_reason) + 920
7   libcoreclr.dylib              	0x0000000104d13a64 WKS::gc_heap::try_allocate_more_space(alloc_context*, unsigned long, unsigned int, int) + 780
8   libcoreclr.dylib              	0x0000000104d34f14 WKS::GCHeap::Alloc(gc_alloc_context*, unsigned long, unsigned int) + 164
9   libcoreclr.dylib              	0x0000000104c06544 AllocateObject(MethodTable*) + 208
10  libcoreclr.dylib              	0x0000000104c20f28 JIT_New(CORINFO_CLASS_STRUCT_*) + 112
11  ???                           	0x00000002836d3e7c 0 + 10794909308
12  ???                           	0x00000002836d3f38 0 + 10794909496
13  ???                           	0x00000002836d3f38 0 + 10794909496
14  ???                           	0x00000002836d3f38 0 + 10794909496
15  ???                           	0x00000002836d3f38 0 + 10794909496
16  ???                           	0x00000002836d3ddc 0 + 10794909148
17  ???                           	0x00000002836d3cd4 0 + 10794908884
18  ???                           	0x00000002836d28e8 0 + 10794903784
19  ???                           	0x00000002836d2420 0 + 10794902560
20  ???                           	0x00000002836d2324 0 + 10794902308
21  ???                           	0x00000002836d1b0c 0 + 10794900236
22  ???                           	0x00000002846e083c 0 + 10811738172
23  ???                           	0x00000002846990b0 0 + 10811445424
24  ???                           	0x00000002846945a0 0 + 10811426208
25  ???                           	0x000000028375036c 0 + 10795418476
26  ???                           	0x000000028374b110 0 + 10795397392
27  ???                           	0x0000000283749e0c 0 + 10795392524
28  ???                           	0x0000000283749d6c 0 + 10795392364
29  ???                           	0x0000000283749d18 0 + 10795392280
30  ???                           	0x0000000283747784 0 + 10795382660
31  ???                           	0x0000000283747504 0 + 10795382020
32  ???                           	0x000000028374731c 0 + 10795381532
33  ???                           	0x00000002837472cc 0 + 10795381452
34  ???                           	0x000000028373cbd0 0 + 10795338704
35  ???                           	0x000000028373c37c 0 + 10795336572
36  ???                           	0x000000028373c2dc 0 + 10795336412
37  ???                           	0x000000028373c28c 0 + 10795336332
38  ???                           	0x000000028373b1d4 0 + 10795332052
39  ???                           	0x000000028373a66c 0 + 10795329132
40  ???                           	0x000000028373a5cc 0 + 10795328972
41  ???                           	0x000000028373a578 0 + 10795328888
42  ???                           	0x0000000283739ec4 0 + 10795327172
43  ???                           	0x0000000283739ac4 0 + 10795326148
44  ???                           	0x0000000283739a24 0 + 10795325988
45  ???                           	0x00000002837399d4 0 + 10795325908
46  ???                           	0x0000000283739524 0 + 10795324708
47  ???                           	0x0000000283739344 0 + 10795324228
48  ???                           	0x00000002837392a4 0 + 10795324068
49  ???                           	0x0000000283739254 0 + 10795323988
50  ???                           	0x00000002837362d8 0 + 10795311832
51  ???                           	0x000000028373573c 0 + 10795308860
52  ???                           	0x00000002837356a0 0 + 10795308704
53  ???                           	0x0000000283735660 0 + 10795308640
54  ???                           	0x0000000283733100 0 + 10795299072
55  ???                           	0x00000002837322b4 0 + 10795295412
56  ???                           	0x0000000283732218 0 + 10795295256
57  ???                           	0x00000002837321d4 0 + 10795295188
58  ???                           	0x000000028372f2d4 0 + 10795283156
59  ???                           	0x000000028372e524 0 + 10795279652
60  ???                           	0x000000028372e484 0 + 10795279492
61  ???                           	0x000000028372e430 0 + 10795279408
62  ???                           	0x000000028372b288 0 + 10795266696
63  ???                           	0x0000000283729f44 0 + 10795261764
64  ???                           	0x0000000283729ea4 0 + 10795261604
65  ???                           	0x0000000283729e1c 0 + 10795261468
66  ???                           	0x00000002837299fc 0 + 10795260412
67  ???                           	0x00000002837298cc 0 + 10795260108
68  ???                           	0x0000000283729830 0 + 10795259952
69  ???                           	0x00000002837297ec 0 + 10795259884
70  ???                           	0x0000000283729060 0 + 10795257952
71  ???                           	0x0000000283728f24 0 + 10795257636
72  ???                           	0x0000000283728e88 0 + 10795257480
73  ???                           	0x0000000283728e44 0 + 10795257412
74  ???                           	0x0000000283728dd0 0 + 10795257296
75  ???                           	0x0000000283728cc4 0 + 10795257028
76  ???                           	0x0000000281f6334c 0 + 10770330444
77  ???                           	0x0000000281f96234 0 + 10770539060
78  ???                           	0x0000000281f62944 0 + 10770327876
79  ???                           	0x0000000283728b58 0 + 10795256664
80  ???                           	0x0000000283728a8c 0 + 10795256460
81  ???                           	0x0000000283724e10 0 + 10795240976
82  ???                           	0x000000028134e86c 0 + 10757662828
83  ???                           	0x0000000283724d18 0 + 10795240728
84  ???                           	0x0000000281f96234 0 + 10770539060
85  ???                           	0x000000028134e480 0 + 10757661824
86  ???                           	0x000000028134e168 0 + 10757661032
87  libcoreclr.dylib              	0x0000000104d3be88 CallDescrWorkerInternal + 132
88  libcoreclr.dylib              	0x0000000104bd1100 CallDescrWorkerWithHandler(CallDescrData*, int) + 136
89  libcoreclr.dylib              	0x0000000104bd1390 DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 192
90  libcoreclr.dylib              	0x0000000104be085c ThreadNative::KickOffThread_Worker(void*) + 148
91  libcoreclr.dylib              	0x0000000104b9ee00 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 260
92  libcoreclr.dylib              	0x0000000104b9f378 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32
93  libcoreclr.dylib              	0x0000000104be0938 ThreadNative::KickOffThread(void*) + 176
94  libcoreclr.dylib              	0x0000000104aaa18c CorUnix::CPalThread::ThreadEntry(void*) + 380
95  libsystem_pthread.dylib       	0x00000001a2e2206c _pthread_start + 320
96  libsystem_pthread.dylib       	0x00000001a2e1cda0 thread_start + 8

(full log is here dotnet_2021-03-01-071726.crash.txt)

Both crashes happened during dotnet publish --self-contained=true -c Debug -f net6.0 -r osx-arm64. Here is simple repro project Sol.tar.gz, steps:

  1. for i in {1..100}; do echo $i; $DOTNET_SDK/dotnet publish --self-contained=true -c Debug -f net6.0 -r osx-arm64 Sol.sln; rm -rf */bin */obj || break; done

macOS Big Sur 11.2.1
.NET SDK 6.0.100-preview.1.21108.2 arm64 (https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.1.21108.2/dotnet-sdk-6.0.100-preview.1.21108.2-osx-arm64.tar.gz)

Linked issues: #43313


By the way, this repro often fails with the following errors:

29
Microsoft (R) Build Engine version 16.9.0-preview-21103-02+198f3f262 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
.../dotnet-sdk-6.0.100-preview.1.21108.2-osx-arm64/sdk/6.0.100-preview.1.21108.2/NuGet.targets(131,5): error : Object reference not set to an instance of an object. [.../Sol/Sol.sln]

, and

31
Microsoft (R) Build Engine version 16.9.0-preview-21103-02+198f3f262 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.BackEnd.BinaryTranslator.BinaryWriteTranslator.TranslateDictionary[T](Dictionary`2& dictionary, IEqualityComparer`1 comparer, ObjectTranslator`1 objectTranslator)
   at Microsoft.Build.BackEnd.TranslatorHelpers.TranslateDictionary[T](ITranslator translator, Dictionary`2& dictionary, IEqualityComparer`1 comparer, NodePacketValueFactory`1 valueFactory)
   at Microsoft.Build.Evaluation.ToolsetProvider.Microsoft.Build.BackEnd.ITranslatable.Translate(ITranslator translator)
   at Microsoft.Build.BackEnd.TranslatorHelpers.Translate[T](ITranslator translator, T& instance, NodePacketValueFactory`1 valueFactory)
   at Microsoft.Build.Execution.BuildParameters.Microsoft.Build.BackEnd.ITranslatable.Translate(ITranslator translator)
   at Microsoft.Build.BackEnd.TranslatorHelpers.Translate[T](ITranslator translator, T& instance, NodePacketValueFactory`1 valueFactory)
   at Microsoft.Build.BackEnd.NodeConfiguration.Translate(ITranslator translator)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.NodeContext.SendData(INodePacket packet)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)
   at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
   at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
   at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
   at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
   at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass76_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0()
   at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location ---
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
@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 Mar 1, 2021
@jeffschwMSFT
Copy link
Member

Same issue as #48343

@ghost
Copy link

ghost commented Mar 1, 2021

Tagging subscribers to this area: @vitek-karas, @agocke
See info in area-owners.md if you want to be subscribed.

Issue Details

Hi! I see some crashes when running dev builds of .NET SDK for macOS arm64, downloaded from https://github.com/dotnet/installer/blob/master/README.md#installers-and-binaries (specifically, dotnet-sdk-6.0.100-preview.1.21108.2-osx-arm64):

Process:               dotnet [63388]
Path:                  /Users/USER/Downloads/*/dotnet
Identifier:            dotnet
Version:               0
Code Type:             ARM-64 (Native)
Parent Process:        ??? [1]
User ID:               502

Date/Time:             2021-02-27 21:58:13.935 +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: 530000 seconds
Time Since Wake:       100000 seconds

System Integrity Protection: enabled

Crashed Thread:        10

Exception Type:        EXC_BAD_ACCESS (SIGBUS)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x00000002871a0010
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Bus error: 10
Termination Reason:    Namespace SIGNAL, Code 0xa
Terminating Process:   exc handler [63388]

VM Regions Near 0x2871a0010:
    VM_ALLOCATE                 287130000-2871a0000    [  448K] rw-/rwx SM=ZER  
--> VM_ALLOCATE                 2871a0000-2871b0000    [   64K] rwx/rwx SM=ZER  
    VM_ALLOCATE                 2871b0000-2871f0000    [  256K] rw-/rwx SM=ZER  

[...]
Thread 10 Crashed:
0   libcoreclr.dylib              	0x0000000102d92060 EEJitManager::CleanupCodeHeaps() + 140
1   libcoreclr.dylib              	0x0000000102d92030 EEJitManager::CleanupCodeHeaps() + 92
2   libcoreclr.dylib              	0x0000000102b322a4 GCToEEInterface::GcStartWork(int, int) + 28
3   libcoreclr.dylib              	0x0000000102bfa9b8 SVR::gc_heap::garbage_collect(int) + 1464
4   libcoreclr.dylib              	0x0000000102bf9d5c SVR::gc_heap::gc_thread_function() + 688
5   libcoreclr.dylib              	0x0000000102bf9aac SVR::gc_heap::gc_thread_stub(void*) + 60
6   libcoreclr.dylib              	0x0000000102b3442c (anonymous namespace)::CreateNonSuspendableThread(void (*)(void*), void*, char16_t const*)::$_1::__invoke(void*) + 76
7   libcoreclr.dylib              	0x00000001029da18c CorUnix::CPalThread::ThreadEntry(void*) + 380
8   libsystem_pthread.dylib       	0x00000001a2e2206c _pthread_start + 320
9   libsystem_pthread.dylib       	0x00000001a2e1cda0 thread_start + 8

(full log is here dotnet_2021-02-27-215819.crash.txt)

, or

Process:               dotnet [94016]
Path:                  /Users/USER/Downloads/*/dotnet
Identifier:            dotnet
Version:               0
Code Type:             ARM-64 (Native)
Parent Process:        dotnet [94014]
User ID:               502

Date/Time:             2021-03-01 07:17:25.896 +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: 650000 seconds
Time Since Wake:       220000 seconds

System Integrity Protection: enabled

Crashed Thread:        19

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

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

VM Regions Near 0:
--> 
    __TEXT                      104560000-10456c000    [   48K] r-x/r-x SM=COW  /Users/*/Downloads/*

[...]
Thread 19 Crashed:
0   libcoreclr.dylib              	0x0000000104d20d00 WKS::gc_heap::mark_object_simple(unsigned char**) + 132
1   libcoreclr.dylib              	0x0000000104d240f0 WKS::gc_heap::mark_through_cards_for_segments(void (*)(unsigned char**), int) + 2920
2   libcoreclr.dylib              	0x0000000104d240f0 WKS::gc_heap::mark_through_cards_for_segments(void (*)(unsigned char**), int) + 2920
3   libcoreclr.dylib              	0x0000000104d192fc WKS::gc_heap::mark_phase(int, int) + 1112
4   libcoreclr.dylib              	0x0000000104d1664c WKS::gc_heap::gc1() + 880
5   libcoreclr.dylib              	0x0000000104d1eed0 WKS::gc_heap::garbage_collect(int) + 1928
6   libcoreclr.dylib              	0x0000000104d11ab8 WKS::GCHeap::GarbageCollectGeneration(unsigned int, gc_reason) + 920
7   libcoreclr.dylib              	0x0000000104d13a64 WKS::gc_heap::try_allocate_more_space(alloc_context*, unsigned long, unsigned int, int) + 780
8   libcoreclr.dylib              	0x0000000104d34f14 WKS::GCHeap::Alloc(gc_alloc_context*, unsigned long, unsigned int) + 164
9   libcoreclr.dylib              	0x0000000104c06544 AllocateObject(MethodTable*) + 208
10  libcoreclr.dylib              	0x0000000104c20f28 JIT_New(CORINFO_CLASS_STRUCT_*) + 112
11  ???                           	0x00000002836d3e7c 0 + 10794909308
12  ???                           	0x00000002836d3f38 0 + 10794909496
13  ???                           	0x00000002836d3f38 0 + 10794909496
14  ???                           	0x00000002836d3f38 0 + 10794909496
15  ???                           	0x00000002836d3f38 0 + 10794909496
16  ???                           	0x00000002836d3ddc 0 + 10794909148
17  ???                           	0x00000002836d3cd4 0 + 10794908884
18  ???                           	0x00000002836d28e8 0 + 10794903784
19  ???                           	0x00000002836d2420 0 + 10794902560
20  ???                           	0x00000002836d2324 0 + 10794902308
21  ???                           	0x00000002836d1b0c 0 + 10794900236
22  ???                           	0x00000002846e083c 0 + 10811738172
23  ???                           	0x00000002846990b0 0 + 10811445424
24  ???                           	0x00000002846945a0 0 + 10811426208
25  ???                           	0x000000028375036c 0 + 10795418476
26  ???                           	0x000000028374b110 0 + 10795397392
27  ???                           	0x0000000283749e0c 0 + 10795392524
28  ???                           	0x0000000283749d6c 0 + 10795392364
29  ???                           	0x0000000283749d18 0 + 10795392280
30  ???                           	0x0000000283747784 0 + 10795382660
31  ???                           	0x0000000283747504 0 + 10795382020
32  ???                           	0x000000028374731c 0 + 10795381532
33  ???                           	0x00000002837472cc 0 + 10795381452
34  ???                           	0x000000028373cbd0 0 + 10795338704
35  ???                           	0x000000028373c37c 0 + 10795336572
36  ???                           	0x000000028373c2dc 0 + 10795336412
37  ???                           	0x000000028373c28c 0 + 10795336332
38  ???                           	0x000000028373b1d4 0 + 10795332052
39  ???                           	0x000000028373a66c 0 + 10795329132
40  ???                           	0x000000028373a5cc 0 + 10795328972
41  ???                           	0x000000028373a578 0 + 10795328888
42  ???                           	0x0000000283739ec4 0 + 10795327172
43  ???                           	0x0000000283739ac4 0 + 10795326148
44  ???                           	0x0000000283739a24 0 + 10795325988
45  ???                           	0x00000002837399d4 0 + 10795325908
46  ???                           	0x0000000283739524 0 + 10795324708
47  ???                           	0x0000000283739344 0 + 10795324228
48  ???                           	0x00000002837392a4 0 + 10795324068
49  ???                           	0x0000000283739254 0 + 10795323988
50  ???                           	0x00000002837362d8 0 + 10795311832
51  ???                           	0x000000028373573c 0 + 10795308860
52  ???                           	0x00000002837356a0 0 + 10795308704
53  ???                           	0x0000000283735660 0 + 10795308640
54  ???                           	0x0000000283733100 0 + 10795299072
55  ???                           	0x00000002837322b4 0 + 10795295412
56  ???                           	0x0000000283732218 0 + 10795295256
57  ???                           	0x00000002837321d4 0 + 10795295188
58  ???                           	0x000000028372f2d4 0 + 10795283156
59  ???                           	0x000000028372e524 0 + 10795279652
60  ???                           	0x000000028372e484 0 + 10795279492
61  ???                           	0x000000028372e430 0 + 10795279408
62  ???                           	0x000000028372b288 0 + 10795266696
63  ???                           	0x0000000283729f44 0 + 10795261764
64  ???                           	0x0000000283729ea4 0 + 10795261604
65  ???                           	0x0000000283729e1c 0 + 10795261468
66  ???                           	0x00000002837299fc 0 + 10795260412
67  ???                           	0x00000002837298cc 0 + 10795260108
68  ???                           	0x0000000283729830 0 + 10795259952
69  ???                           	0x00000002837297ec 0 + 10795259884
70  ???                           	0x0000000283729060 0 + 10795257952
71  ???                           	0x0000000283728f24 0 + 10795257636
72  ???                           	0x0000000283728e88 0 + 10795257480
73  ???                           	0x0000000283728e44 0 + 10795257412
74  ???                           	0x0000000283728dd0 0 + 10795257296
75  ???                           	0x0000000283728cc4 0 + 10795257028
76  ???                           	0x0000000281f6334c 0 + 10770330444
77  ???                           	0x0000000281f96234 0 + 10770539060
78  ???                           	0x0000000281f62944 0 + 10770327876
79  ???                           	0x0000000283728b58 0 + 10795256664
80  ???                           	0x0000000283728a8c 0 + 10795256460
81  ???                           	0x0000000283724e10 0 + 10795240976
82  ???                           	0x000000028134e86c 0 + 10757662828
83  ???                           	0x0000000283724d18 0 + 10795240728
84  ???                           	0x0000000281f96234 0 + 10770539060
85  ???                           	0x000000028134e480 0 + 10757661824
86  ???                           	0x000000028134e168 0 + 10757661032
87  libcoreclr.dylib              	0x0000000104d3be88 CallDescrWorkerInternal + 132
88  libcoreclr.dylib              	0x0000000104bd1100 CallDescrWorkerWithHandler(CallDescrData*, int) + 136
89  libcoreclr.dylib              	0x0000000104bd1390 DispatchCallSimple(unsigned long*, unsigned int, unsigned long, unsigned int) + 192
90  libcoreclr.dylib              	0x0000000104be085c ThreadNative::KickOffThread_Worker(void*) + 148
91  libcoreclr.dylib              	0x0000000104b9ee00 ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 260
92  libcoreclr.dylib              	0x0000000104b9f378 ManagedThreadBase::KickOff(void (*)(void*), void*) + 32
93  libcoreclr.dylib              	0x0000000104be0938 ThreadNative::KickOffThread(void*) + 176
94  libcoreclr.dylib              	0x0000000104aaa18c CorUnix::CPalThread::ThreadEntry(void*) + 380
95  libsystem_pthread.dylib       	0x00000001a2e2206c _pthread_start + 320
96  libsystem_pthread.dylib       	0x00000001a2e1cda0 thread_start + 8

(full log is here dotnet_2021-03-01-071726.crash.txt)

Both crashes happened during dotnet publish --self-contained=true -c Debug -f net6.0 -r osx-arm64. Here is simple repro project Sol.tar.gz, steps:

  1. for i in {1..100}; do echo $i; $DOTNET_SDK/dotnet publish --self-contained=true -c Debug -f net6.0 -r osx-arm64 Sol.sln; rm -rf */bin */obj || break; done

macOS Big Sur 11.2.1
.NET SDK 6.0.100-preview.1.21108.2 arm64 (https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100-preview.1.21108.2/dotnet-sdk-6.0.100-preview.1.21108.2-osx-arm64.tar.gz)

Linked issues: #43313


By the way, this repro often fails with the following errors:

29
Microsoft (R) Build Engine version 16.9.0-preview-21103-02+198f3f262 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
.../dotnet-sdk-6.0.100-preview.1.21108.2-osx-arm64/sdk/6.0.100-preview.1.21108.2/NuGet.targets(131,5): error : Object reference not set to an instance of an object. [.../Sol/Sol.sln]

, and

31
Microsoft (R) Build Engine version 16.9.0-preview-21103-02+198f3f262 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.BackEnd.BinaryTranslator.BinaryWriteTranslator.TranslateDictionary[T](Dictionary`2& dictionary, IEqualityComparer`1 comparer, ObjectTranslator`1 objectTranslator)
   at Microsoft.Build.BackEnd.TranslatorHelpers.TranslateDictionary[T](ITranslator translator, Dictionary`2& dictionary, IEqualityComparer`1 comparer, NodePacketValueFactory`1 valueFactory)
   at Microsoft.Build.Evaluation.ToolsetProvider.Microsoft.Build.BackEnd.ITranslatable.Translate(ITranslator translator)
   at Microsoft.Build.BackEnd.TranslatorHelpers.Translate[T](ITranslator translator, T& instance, NodePacketValueFactory`1 valueFactory)
   at Microsoft.Build.Execution.BuildParameters.Microsoft.Build.BackEnd.ITranslatable.Translate(ITranslator translator)
   at Microsoft.Build.BackEnd.TranslatorHelpers.Translate[T](ITranslator translator, T& instance, NodePacketValueFactory`1 valueFactory)
   at Microsoft.Build.BackEnd.NodeConfiguration.Translate(ITranslator translator)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.NodeContext.SendData(INodePacket packet)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)
   at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
   at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
   at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
   at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
   at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass76_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0()
   at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location ---
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
Author: k15tfu
Assignees: -
Labels:

area-Host, untriaged

Milestone: -

@vitek-karas
Copy link
Member

@sdmaclea this feels like something which should be investigated on the runtime side.
I don't think it's the same issue as #48343.

@sdmaclea
Copy link
Contributor

sdmaclea commented Mar 3, 2021

This looks like multiple stability issues

  • One looks related to GC Holes in the runtime/JIT.
  • One looks related to Write No Execute permissions during EEJitManager::CleanupCodeHeaps()

@k15tfu
Copy link
Contributor Author

k15tfu commented Mar 22, 2021

Looks like #49942 fixes the issue with EEJitManager::CleanupCodeHeaps, thanks. @sdmaclea Is there any progress on others?

@sdmaclea
Copy link
Contributor

The others are issues with the garbage collection. I will look at the easily reproducible GC failures first #46330. The root cause might be related....

Once those are fixed, I'll look at #46365. Some of those failures looked similar. I would expect fixing those would resolve these issues too.

@sdmaclea
Copy link
Contributor

sdmaclea commented Apr 8, 2021

Based on my experience, the macOS 11.3 Beta 6 fixed a lot of these issues. It would be good to retest this with preview3 which just released.

@k15tfu
Copy link
Contributor Author

k15tfu commented Apr 14, 2021

@sdmaclea Thanks for suggestion. I don't see any crashes anymore but dotnet-sdk-6.0.100-preview.3.21202.5-osx-arm64 on macOS 11.3 Beta 7 still fails quite often with the following error: Object reference not set to an instance of an object.

@k15tfu
Copy link
Contributor Author

k15tfu commented Apr 14, 2021

I created another issue for those errors: #51250. cc @sdmaclea

@sdmaclea
Copy link
Contributor

I am going to close this. The crash has been fixed. And #51250 is a dup of the remaining issues

@ghost ghost locked as resolved and limited conversation to collaborators Jun 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-VM-coreclr os-macos-bigsur (macOS11) untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

4 participants