You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was running "go test" for a project I'm working on. After switching to an Apple Silicon Macbook Pro I started experiencing random crashes. Which don't reproduce on an Intel-based Mac I was using previously.
What did you expect to see?
Should not crash.
What did you see instead?
Sometimes the tests crashed, although most of the time they pass. Hard to reproduce. Crashes are different too. Sometimes the "go test" program hanged/deadlocked. I'm not sure if all of this related to the same bug, or maybe these all are different bugs, but I think all of this somehow related to macOS Monterey or arm64 architecture, or a combination of both.
So far I've got:
Crash 1
SIGABRT with malloc: Heap corruption detected, free list is damaged at 0x60000125f660
Sampling process 49308 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling engine.test (pid 49308) every 1 millisecond
Process: engine.test [49308]
Path: /private/var/folders/*/engine.test
Load Address: 0x10465c000
Identifier: engine.test
Version: ???
Code Type: ARM64
Platform: macOS
Parent Process: go [49281]
Call graph:
2067 Thread_418737 DispatchQueue_1: com.apple.main-thread (serial)
+ 2066 runtime.goexit.abi0 (in engine.test) + 4 [0x1046ffc54]
+ ! 2066 runtime.main (in engine.test) + 540 [0x1046cdbdc]
+ ! 2066 runtime.doInit (in engine.test) + 112 [0x1046dbb80]
+ ! 2066 runtime.doInit (in engine.test) + 112 [0x1046dbb80]
+ ! 2066 runtime.doInit (in engine.test) + 112 [0x1046dbb80]
+ ! 2066 runtime.doInit (in engine.test) + 112 [0x1046dbb80]
+ ! 2066 runtime.doInit (in engine.test) + 312 [0x1046dbc48]
+ ! 2066 vendor/golang.org/x/net/http2/hpack.init (in engine.test) + 1216 [0x104a46d80]
+ ! 2066 runtime.mapassign (in engine.test) + 104 [0x1046a50d8]
+ ! 2066 runtime.raceReadObjectPC (in engine.test) + 68 [0x1046dd204]
+ ! 2066 runtime.racereadrangepc (in engine.test) + 56 [0x1046ddb38]
+ ! 2066 racefuncenter (in engine.test) + 56 [0x104700538]
+ ! 2066 __tsan_func_enter (in engine.test) + 232 [0x10466441c]
+ ! 2026 cthread_yield (in libsystem_pthread.dylib) + 20 [0x196d4a390]
+ ! : 2022 swtch_pri (in libsystem_kernel.dylib) + 8 [0x196d11a5c]
+ ! : 4 DYLD-STUB$$swtch_pri (in libsystem_pthread.dylib) + 8 [0x196d51e58]
+ ! 18 __tsan_func_enter (in engine.test) + 228,232 [0x104664418,0x10466441c]
+ ! 11 DYLD-STUB$$ioctl (in engine.test) + 4 [0x104e4b9dc]
+ ! 11 cthread_yield (in libsystem_pthread.dylib) + 4,24 [0x196d4a380,0x196d4a394]
+ 1 cthread_yield (in libsystem_pthread.dylib) + 20 [0x196d4a390]
+ 1 _sigtramp (in libsystem_platform.dylib) + 0 [0x196d644ac]
2067 Thread_418738
+ 2067 runtime.asmcgocall.abi0 (in engine.test) + 200 [0x1046ffac8]
+ 2066 runtime.usleep_trampoline (in engine.test) + 20 [0x1047010f4]
+ ! 2066 usleep (in libsystem_c.dylib) + 68 [0x196c1fca4]
+ ! 2066 nanosleep (in libsystem_c.dylib) + 216 [0x196c1fd88]
+ ! 2066 __semwait_signal (in libsystem_kernel.dylib) + 8 [0x196d14ebc]
+ 1 runtime.pthread_kill_trampoline (in engine.test) + 24 [0x104701558]
+ 1 pthread_kill (in libsystem_pthread.dylib) + 288 [0x196d4d15c]
+ 1 __pthread_kill (in libsystem_kernel.dylib) + 8 [0x196d199b8]
2067 Thread_418739
+ 2067 runtime.asmcgocall.abi0 (in engine.test) + 200 [0x1046ffac8]
+ 2067 runtime.pthread_cond_wait_trampoline (in engine.test) + 24 [0x1047014a8]
+ 2067 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x196d4dab4]
+ 2067 __psynch_cvwait (in libsystem_kernel.dylib) + 8 [0x196d150c0]
2067 Thread_418740
+ 2067 runtime.asmcgocall.abi0 (in engine.test) + 201 [0x1046ffac9]
+ 2067 runtime.pthread_cond_wait_trampoline (in engine.test) + 24 [0x1047014a8]
+ 2067 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x196d4dab4]
+ 2067 __psynch_cvwait (in libsystem_kernel.dylib) + 8 [0x196d150c0]
2067 Thread_418741
+ 2067 runtime.asmcgocall.abi0 (in engine.test) + 200 [0x1046ffac8]
+ 2067 runtime.pthread_cond_wait_trampoline (in engine.test) + 24 [0x1047014a8]
+ 2067 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x196d4dab4]
+ 2067 __psynch_cvwait (in libsystem_kernel.dylib) + 8 [0x196d150c0]
2067 Thread_418742
+ 2067 runtime.asmcgocall.abi0 (in engine.test) + 200 [0x1046ffac8]
+ 2067 runtime.pthread_cond_wait_trampoline (in engine.test) + 24 [0x1047014a8]
+ 2067 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x196d4dab4]
+ 2067 __psynch_cvwait (in libsystem_kernel.dylib) + 8 [0x196d150c0]
2067 Thread_418743
+ 2067 runtime.asmcgocall.abi0 (in engine.test) + 200 [0x1046ffac8]
+ 2067 runtime.pthread_cond_wait_trampoline (in engine.test) + 24 [0x1047014a8]
+ 2067 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x196d4dab4]
+ 2067 __psynch_cvwait (in libsystem_kernel.dylib) + 8 [0x196d150c0]
2067 Thread_418744
2067 runtime.asmcgocall.abi0 (in engine.test) + 200 [0x1046ffac8]
2067 runtime.pthread_cond_wait_trampoline (in engine.test) + 24 [0x1047014a8]
2067 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x196d4dab4]
2067 __psynch_cvwait (in libsystem_kernel.dylib) + 8 [0x196d150c0]
Total number in stack (recursive counted multiple, when >=5):
6 __psynch_cvwait (in libsystem_kernel.dylib) + 0 [0x196d150b8]
6 _pthread_cond_wait (in libsystem_pthread.dylib) + 1228 [0x196d4dab4]
6 runtime.asmcgocall.abi0 (in engine.test) + 200 [0x1046ffac8]
6 runtime.pthread_cond_wait_trampoline (in engine.test) + 24 [0x1047014a8]
Sort by top of stack, same collapsed (when >= 5):
__psynch_cvwait (in libsystem_kernel.dylib) 12402
__semwait_signal (in libsystem_kernel.dylib) 2066
swtch_pri (in libsystem_kernel.dylib) 2022
__tsan_func_enter (in engine.test) 18
DYLD-STUB$$ioctl (in engine.test) 11
cthread_yield (in libsystem_pthread.dylib) 11
(lldb) process attach --pid 52114
warning: (arm64) /private/var/folders/sp/fyc644ws6wgb3_zh332vy1bh0000gn/T/go-build938459180/b367/bdd.test(0x0000000104b68000) address 0x0000000104b68000 maps to more than one section: bdd.test.__TEXT and bdd.test.__TEXT
warning: (arm64) /private/var/folders/sp/fyc644ws6wgb3_zh332vy1bh0000gn/T/go-build938459180/b367/bdd.test(0x0000000104b68000) address 0x0000000105134000 maps to more than one section: bdd.test.__DATA_CONST and bdd.test.__DATA_CONST
warning: (arm64) /private/var/folders/sp/fyc644ws6wgb3_zh332vy1bh0000gn/T/go-build938459180/b367/bdd.test(0x0000000104b68000) address 0x00000001053e8000 maps to more than one section: bdd.test.__DATA and bdd.test.__DATA
Process 52114 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x104d64e0c)
frame #0: 0x0000000196bd9938 libobjc.A.dylib`_setThisThreadIsInitializingClass(objc_class*) + 176
libobjc.A.dylib`_setThisThreadIsInitializingClass:
-> 0x196bd9938 <+176>: str w9, [x19]
0x196bd993c <+180>: sbfiz x1, x9, #3, #32
0x196bd9940 <+184>: bl 0x196bff5b4 ; symbol stub for: realloc
0x196bd9944 <+188>: str x0, [x19, #0x8]
Target 0: (bdd.test) stopped.
Executable module set to "/private/var/folders/sp/fyc644ws6wgb3_zh332vy1bh0000gn/T/go-build938459180/b367/bdd.test".
Architecture set to: arm64e-apple-macosx-.
(lldb) thread list
Process 52114 stopped
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Was running "go test" for a project I'm working on. After switching to an Apple Silicon Macbook Pro I started experiencing random crashes. Which don't reproduce on an Intel-based Mac I was using previously.
What did you expect to see?
Should not crash.
What did you see instead?
Sometimes the tests crashed, although most of the time they pass. Hard to reproduce. Crashes are different too. Sometimes the "go test" program hanged/deadlocked. I'm not sure if all of this related to the same bug, or maybe these all are different bugs, but I think all of this somehow related to macOS Monterey or arm64 architecture, or a combination of both.
So far I've got:
Crash 1
SIGABRT
withmalloc: Heap corruption detected, free list is damaged at 0x60000125f660
Go stacktrace
Apple crash report
Crash 2
SIGABRT
with"type":"EXC_BAD_ACCESS","signal":"SIGABRT","subtype":"KERN_INVALID_ADDRESS'
Go stacktrace
Apple crash report
Crash 3
Another
Heap corruption detected
, different go stacktraceGo stacktrace
Apple crash report
Crash 4
Another SIGABRT, maybe an interesting/helpful stacktrace? Unfortunately, I don't have an Apple report for this one.
Go stacktrace
Hang up 1
My test suite just hanged with one process consuming 99.9% cpu.
lldb stracktrace
swtch_pri + 8, queue = 'com.apple.main-thread', stop reason = signal SIGURG thread #2: tid = 0x663b2, 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8thread #3: tid = 0x663b3, 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 thread #4: tid = 0x663b4, 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8thread #5: tid = 0x663b5, 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 thread #6: tid = 0x663b6, 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8thread #7: tid = 0x663b7, 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 thread #8: tid = 0x663b8, 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8(lldb) thread backtrace all
swtch_pri + 8 frame #1: 0x0000000196d4a390 libsystem_pthread.dylib
cthread_yield + 20frame #2: 0x000000010466441c engine.test
__tsan_func_enter + 232 frame #3: 0x0000000104700538 engine.test
racefuncenter + 56frame #4: 0x00000001046ddb38 engine.test
runtime.racereadrangepc + 56 frame #5: 0x00000001046dd204 engine.test
runtime.raceReadObjectPC + 68frame #6: 0x00000001046a50d8 engine.test
runtime.mapassign + 104 frame #7: 0x0000000104a46d80 engine.test
vendor/golang.org/x/net/http2/hpack.init + 1216frame #8: 0x00000001046dbc48 engine.test
runtime.doInit + 312 frame #9: 0x00000001046dbb80 engine.test
runtime.doInit + 112frame #10: 0x00000001046dbb80 engine.test
runtime.doInit + 112 frame #11: 0x00000001046dbb80 engine.test
runtime.doInit + 112frame #12: 0x00000001046dbb80 engine.test
runtime.doInit + 112 frame #13: 0x00000001046cdbdc engine.test
runtime.main + 540thread #2
frame #0: 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 frame #1: 0x0000000196d4dae0 libsystem_pthread.dylib
_pthread_cond_wait + 1272frame #2: 0x00000001047014dc engine.test
runtime.pthread_cond_timedwait_relative_np_trampoline + 28 thread #3 frame #0: 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8frame #1: 0x0000000196d4dab4 libsystem_pthread.dylib
_pthread_cond_wait + 1228 frame #2: 0x00000001047014a8 engine.test
runtime.pthread_cond_wait_trampoline + 24frame #3: 0x00000001046ffac8 engine.test
runtime.asmcgocall.abi0 + 200 thread #4 frame #0: 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8frame #1: 0x0000000196d4dae0 libsystem_pthread.dylib
_pthread_cond_wait + 1272 frame #2: 0x00000001047014dc engine.test
runtime.pthread_cond_timedwait_relative_np_trampoline + 28thread #5
frame #0: 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 frame #1: 0x0000000196d4dab4 libsystem_pthread.dylib
_pthread_cond_wait + 1228frame #2: 0x00000001047014a8 engine.test
runtime.pthread_cond_wait_trampoline + 24 frame #3: 0x00000001046ffac8 engine.test
runtime.asmcgocall.abi0 + 200thread #6
frame #0: 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 frame #1: 0x0000000196d4dab4 libsystem_pthread.dylib
_pthread_cond_wait + 1228frame #2: 0x00000001047014a8 engine.test
runtime.pthread_cond_wait_trampoline + 24 frame #3: 0x00000001046ffac8 engine.test
runtime.asmcgocall.abi0 + 200thread #7
frame #0: 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 frame #1: 0x0000000196d4dab4 libsystem_pthread.dylib
_pthread_cond_wait + 1228frame #2: 0x00000001047014a8 engine.test
runtime.pthread_cond_wait_trampoline + 24 frame #3: 0x00000001046ffac8 engine.test
runtime.asmcgocall.abi0 + 200thread #8
frame #0: 0x0000000196d150c0 libsystem_kernel.dylib
__psynch_cvwait + 8 frame #1: 0x0000000196d4dab4 libsystem_pthread.dylib
_pthread_cond_wait + 1228frame #2: 0x00000001047014a8 engine.test
runtime.pthread_cond_wait_trampoline + 24 frame #3: 0x00000001046ffac8 engine.test
runtime.asmcgocall.abi0 + 200Activity monitor sample process
Hang up 2
Same here, different stacktrace.
lldb stacktrace
(lldb) thread backtrace
_setThisThreadIsInitializingClass(objc_class*) + 176 frame #1: 0x0000000196bd9680 libobjc.A.dylib
initializeNonMetaClass + 644frame #2: 0x0000000196bd9490 libobjc.A.dylib
initializeNonMetaClass + 148 frame #3: 0x0000000196bd9490 libobjc.A.dylib
initializeNonMetaClass + 148frame #4: 0x0000000196bd9048 libobjc.A.dylib
initializeAndMaybeRelock(objc_class*, objc_object*, mutex_tt<false>&, bool) + 156 frame #5: 0x0000000196bd8dfc libobjc.A.dylib
lookUpImpOrForward + 1016frame #6: 0x0000000196bd8724 libobjc.A.dylib
_objc_msgSend_uncached + 68 frame #7: 0x0000000196ab6a04 libxpc.dylib
xpc_atfork_child + 136frame #8: 0x00000001a17e3ab8 libSystem.B.dylib
libSystem_atfork_child + 64 frame #9: 0x0000000196c37fe4 libsystem_c.dylib
fork + 112frame #10: 0x0000000104c0ccbc bdd.test
runtime.syscall + 44 frame #11: 0x0000000104c0b18c bdd.test
runtime.asmcgocall.abi0 + 124I'll see if I can make a repro, although it may take a while, I don't have much experience debugging such things.
The text was updated successfully, but these errors were encountered: