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
Hi,
we have got a complex Avalonia (tried v11.0.11 and v11.2.6) desktop app and we are experiencing random deadlocks (sometimes first run hanged, sometimes 100 or more tries went ok) when we are trying to do UI testing using Avalonia xUnit Headless package (NUnit also hanged). This is really annoying because we are not able to create reliable CI/CD bacuase of this.
When we tried to get dump using dotnet-dump (or dotnet-trace) then this hanged too. Only using spindump worked and gave us the following output comfirming that there is an deadlock on the kernel level (two threads waiting for each other):
Date/Time: 2025-04-02 18:53:37.130 +0200
End time: 2025-04-02 18:53:47.127 +0200
OS Version: macOS 15.3.2 (Build 24D81)
Architecture: arm64e
Report Version: 55
Data Source: Stackshots
Shared Cache: 5700D77A-6190-36E0-884D-FEE6D586D62F slid base address 0x18476c000, slide 0x476c000 (System Primary)
Shared Cache: 30EB0E49-EBB3-34EC-A62A-EAAC33A8C7A2 slid base address 0x7ff815f08000, slide 0x15f08000 (Rosetta)
Shared Cache: 2CE61F01-A42A-375D-8D6E-89C3E585622D slid base address 0x1891c0000, slide 0x91c0000 (DriverKit)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
we have got a complex Avalonia (tried v11.0.11 and v11.2.6) desktop app and we are experiencing random deadlocks (sometimes first run hanged, sometimes 100 or more tries went ok) when we are trying to do UI testing using Avalonia xUnit Headless package (NUnit also hanged). This is really annoying because we are not able to create reliable CI/CD bacuase of this.
Configuration:
macOS: 15.3.2
app and test architecture: x64 (using Rosetta2)
cpu: Apple Sillicon M3 (Arm64)
.NET SDK: 9.0.201
xUnit nuget: 2.9.3
xUnit Runner nuget: 3.0.2
AvaloniaUI nuget: 11.0.11 (also tried 11.2.6)
When we tried to get dump using dotnet-dump (or dotnet-trace) then this hanged too. Only using spindump worked and gave us the following output comfirming that there is an deadlock on the kernel level (two threads waiting for each other):
Date/Time: 2025-04-02 18:53:37.130 +0200
End time: 2025-04-02 18:53:47.127 +0200
OS Version: macOS 15.3.2 (Build 24D81)
Architecture: arm64e
Report Version: 55
Data Source: Stackshots
Shared Cache: 5700D77A-6190-36E0-884D-FEE6D586D62F slid base address 0x18476c000, slide 0x476c000 (System Primary)
Shared Cache: 30EB0E49-EBB3-34EC-A62A-EAAC33A8C7A2 slid base address 0x7ff815f08000, slide 0x15f08000 (Rosetta)
Shared Cache: 2CE61F01-A42A-375D-8D6E-89C3E585622D slid base address 0x1891c0000, slide 0x91c0000 (DriverKit)
Command: dotnet
Path: /usr/local/share/dotnet/x64/dotnet
Codesigning ID: dotnet-55554944d2c84aeb814f39048bc0563da76cae94
Team ID: UBF8T346G9
Architecture: x86_64 (translated)
Parent: dotnet [97220] [unique pid 593303]
Responsible: Terminal [1202]
PID: 97222
Time Since Fork: 528s
Deadlocked: 2 threads - Thread 0x457a02, Thread 0x457a07 ".NET TP Worker"
Blocked by Deadlock: 1 thread - Thread 0x45a689
Duration: 10.00s
Steps: 999 (10ms sampling interval)
Hardware model: Mac15,3
Active cpus: 8
HW page size: 16384
VM page size: 16384
Time Since Boot: 545242s
Time Awake Since Boot: 142912s
Time Since Wake: 1633s
Fan speed: 0 rpm
Total CPU Time: 17.662s (38.4G cycles, 90.4G instructions, 0.42c/i)
Advisory levels: Battery -> 2, User -> 2, ThermalPressure -> 0, Combined -> 2
Free disk space: 592.11 GB/926.35 GB, low space threshold 3072 MB
Vnodes Available: 73.81% (194249/263168)
Models: none
Deadlock: dotnet [97222] [unique pid 593305] thread 0x457a07 ".NET TP Worker" -> dotnet [97222] [unique pid 593305] thread 0x457a02 -> dotnet [97222] [unique pid 593305] thread 0x457a07 ".NET TP Worker"
Blocked by Deadlock: 1 task - dotnet [97222] [unique pid 593305]
Preferred User Language: cs-CZ
Country Code: CZ
OS Cryptex File Extents: 1
Heavy format: stacks are sorted by count
Use -i and -timeline to re-report with chronological sorting
Process: dotnet [97222] [unique pid 593305]
UUID: D2C84AEB-814F-3904-8BC0-563DA76CAE94
Path: /usr/local/share/dotnet/x64/dotnet
Codesigning ID: dotnet-55554944d2c84aeb814f39048bc0563da76cae94
Team ID: UBF8T346G9
Shared Cache: 30EB0E49-EBB3-34EC-A62A-EAAC33A8C7A2 slid base address 0x7ff815f08000, slide 0x15f08000 (Rosetta)
Architecture: x86_64 (translated)
Parent: dotnet [97220] [unique pid 593303]
Responsible: Terminal [1202]
UID: 1162186508
Footprint: 323.85 MB
Time Since Fork: 528s
Num samples: 999 (1-999)
Note: Suspended for 1 sample
Num threads: 31
Deadlocked: 2 threads - Thread 0x457a02, Thread 0x457a07 ".NET TP Worker"
Blocked by Deadlock: 1 thread - Thread 0x45a689
Thread 0x45794d 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x45794f Thread name "com.apple.rosetta.exceptionserver" 999 samples (1-999) priority 31 (base 31)
999 ??? (runtime + 70848) [0x7ff7ffc844c0]
999
999 ??? (runtime + 16032) [0x7ff7ffc76ea0]
*998 ??? (kernel.release.t8122 + 240448) [0xfffffe0008712b40]
*1 ??? (kernel.release.t8122 + 240448) [0xfffffe0008712b40] (suspended)
Thread 0x457952 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 240448) [0xfffffe0008712b40] (suspended)
Thread 0x457953 Thread name ".NET SynchManager" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 5678516) [0xfffffe0008c425b4] (suspended)
Thread 0x457954 Thread name ".NET EventPipe" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 30836) [0xfffffe00086df874]
*999 ??? (kernel.release.t8122 + 30896) [0xfffffe00086df8b0]
*999 ??? (kernel.release.t8122 + 1763204) [0xfffffe0008886784]
*999 ??? (kernel.release.t8122 + 7126120) [0xfffffe0008da3c68]
*999 ??? (kernel.release.t8122 + 6073832) [0xfffffe0008ca2de8]
*999 ??? (kernel.release.t8122 + 5677968) [0xfffffe0008c42390]
*999 ??? (kernel.release.t8122 + 590156) [0xfffffe000876814c]
*999 ??? (kernel.release.t8122 + 596388) [0xfffffe00087699a4] (suspended)
Thread 0x457955 Thread name ".NET DebugPipe" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 30836) [0xfffffe00086df874]
*999 ??? (kernel.release.t8122 + 30896) [0xfffffe00086df8b0]
*999 ??? (kernel.release.t8122 + 1763204) [0xfffffe0008886784]
*999 ??? (kernel.release.t8122 + 7126120) [0xfffffe0008da3c68]
*999 ??? (kernel.release.t8122 + 2528124) [0xfffffe000894137c]
*999 ??? (kernel.release.t8122 + dotnet/runtime@2524488) [0xfffffe0008940548]
*999 ??? (kernel.release.t8122 + 2621332) [0xfffffe0008957f94]
*999 fifo_open + 1056 (kernel.release.t8122 + 2726536) [0xfffffe0008971a88]
*999 ??? (kernel.release.t8122 + 5930756) [0xfffffe0008c7ff04]
*999 lck_mtx_sleep + 228 (kernel.release.t8122 + 496728) [0xfffffe0008751458]
*999 ??? (kernel.release.t8122 + 590156) [0xfffffe000876814c]
*999 ??? (kernel.release.t8122 + 596388) [0xfffffe00087699a4] (suspended)
Thread 0x457956 Thread name ".NET Debugger" 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x457957 999 samples (1-999) priority 33 (base 33)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x457958 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x457959 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x45795a Thread name ".NET TP Worker" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x45795b 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x45795c 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x45795d 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x45795e Thread name ".NET TP Worker" 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x45795f 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 5678516) [0xfffffe0008c425b4] (suspended)
Thread 0x457960 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x457963 Thread name ".NET TP Worker" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x457966 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x457967 Thread name ".NET TP Worker" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x457968 999 samples (1-999) priority 31 (base 31)
999
999 ??? (runtime + 141652) [0x7ff7ffc95954]
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x457969 999 samples (1-999) priority 31 (base 31)
999
999 ??? (runtime + 141652) [0x7ff7ffc95954]
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x45796a 999 samples (1-999) priority 31 (base 31)
999
999 ??? (runtime + 141652) [0x7ff7ffc95954]
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x45796c 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 240448) [0xfffffe0008712b40] (suspended)
Thread 0x4579ce Thread name ".NET SigHandler" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 30836) [0xfffffe00086df874]
*999 ??? (kernel.release.t8122 + 30896) [0xfffffe00086df8b0]
*999 ??? (kernel.release.t8122 + 1763204) [0xfffffe0008886784]
*999 ??? (kernel.release.t8122 + 7126120) [0xfffffe0008da3c68]
*999 ??? (kernel.release.t8122 + 6061244) [0xfffffe0008c9fcbc]
*999 ??? (kernel.release.t8122 + 6060752) [0xfffffe0008c9fad0]
*999 ??? (kernel.release.t8122 + 6087928) [0xfffffe0008ca64f8]
*999 ??? (kernel.release.t8122 + 5930756) [0xfffffe0008c7ff04]
*999 lck_mtx_sleep + 228 (kernel.release.t8122 + 496728) [0xfffffe0008751458]
*999 ??? (kernel.release.t8122 + 590156) [0xfffffe000876814c]
*999 ??? (kernel.release.t8122 + 596388) [0xfffffe00087699a4] (suspended)
Thread 0x4579ec Thread name ".NET TP Worker" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x4579f7 Thread name ".NET TP Worker" 999 samples (1-999) priority 31 (base 31)
999
*999 ??? (kernel.release.t8122 + 776632) [0xfffffe00087959b8] (suspended)
Thread 0x457a02 999 samples (1-999) priority 31 (base 31)
999
*867 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a07 - part of a deadlock)
*131 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a07)
*1 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (suspended, blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a07)
Thread 0x457a07 Thread name ".NET TP Worker" 999 samples (1-999) priority 31 (base 31)
999
*867 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a02 - part of a deadlock)
*131 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a02)
*1 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (suspended, blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a02)
Thread 0x457a0a 999 samples (1-999) priority 31 (base 31)
999
*999 psynch_cvcontinue + 0 (com.apple.kec.pthread + 17956) [0xfffffe000ba7f184] (suspended)
Thread 0x45a689 999 samples (1-999) priority 31 (base 31)
999 ??? (runtime + 80168) [0x7ff7ffc86928]
999
999 ??? (runtime + 15720) [0x7ff7ffc76d68]
*998 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a07)
*1 ??? (kernel.release.t8122 + 6101884) [0xfffffe0008ca9b7c] (suspended, blocked by turnstile waiting for dotnet [97222] [unique pid 593305] thread 0x457a07)
Binary Images:
0x1049b2000 - 0x1049c5fff dotnet (0) /usr/local/share/dotnet/x64/dotnet
0x7ff7ffc73000 - 0x7ff7ffcb2fff runtime (342) <11B18945-107E-3E0D-91FA-B5D5ADA3C0C4> /usr/libexec/rosetta/runtime
*0xfffffe00086d8000 - 0xfffffe0008f9bfff kernel.release.t8122 (11215.81.4) <11F36980-B7BB-30DE-98D4-D52EEA979C99>__TEXT_EXEC /System/Library/Kernels/kernel.release.t8122
*0xfffffe000ba7ab60 - 0xfffffe000ba80787 com.apple.kec.pthread (535) __TEXT_EXEC com.apple.kec.pthread
Process: AccessibilityVisualsAgent [91787] [unique pid 587870]
UUID: 9525C44B-57F0-3FC8-93AE-EEE0FE10225D
Path: /System/Library/PrivateFrameworks/AccessibilitySupport.framework/Versions/A/Resources/AccessibilityVisualsAgent.app/Contents/MacOS/AccessibilityVisualsAgent
Identifier: com.apple.AccessibilityVisualsAgent
Version: 1.0 (387.5.2)
Build Version: 11
Project Name: AccessibilitySupport
Source Version: 387005002000000
Is First Party: Yes
Beta Identifier: 07525918-8D51-58D5-91B4-457E918933C9
Shared Cache: 5700D77A-6190-36E0-884D-FEE6D586D62F slid base address 0x18476c000, slide 0x476c000 (System Primary)
Architecture: arm64e
Parent: launchd [1]
UID: 1162186508
Sudden Term: Tracked (allows idle exit)
Footprint: 13.03 MB
Time Since Fork: 1629s
Num samples: 999 (1-999)
Num threads: 3
Note: 1 idle work queue thread omitted
Thread 0x44dfc5 999 samples (1-999) priority 31 (base 31)
999 start + 2840 (dyld + 25204) [0x184838274]
999 ??? (AccessibilityVisualsAgent + 42776) [0x104ada718]
999 -[NSApplication run] + 480 (AppKit + 190580) [0x188809874]
999 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 (AppKit + 10099748) [0x18917cc24]
999 _DPSNextEvent + 660 (AppKit + 243784) [0x188816848]
999 _BlockUntilNextEventMatchingListInModeWithFilter + 76 (HIToolbox + 1119496) [0x190213508]
999 ReceiveNextEventCommon + 676 (HIToolbox + 1119048) [0x190213348]
999 RunCurrentEventLoopInMode + 292 (HIToolbox + 1094960) [0x19020d530]
999 CFRunLoopRunSpecific + 588 (CoreFoundation + 505652) [0x184c9e734]
999 __CFRunLoopRun + 1212 (CoreFoundation + 508588) [0x184c9f2ac]
999 __CFRunLoopServiceMachPort + 160 (CoreFoundation + 514636) [0x184ca0a4c]
999 mach_msg + 24 (libsystem_kernel.dylib + 4764) [0x184b7729c]
999 mach_msg_overwrite + 480 (libsystem_kernel.dylib + 39672) [0x184b7faf8]
999 mach_msg2_trap + 8 (libsystem_kernel.dylib + 3924) [0x184b76f54]
*999 ??? (kernel.release.t8122 + 240448) [0xfffffe0008712b40]
Thread 0x44e077 Thread name "com.apple.NSEventThread" 999 samples (1-999) priority 37 (base 37)
999 thread_start + 8 (libsystem_pthread.dylib + 8444) [0x184bb30fc]
999 _pthread_start + 136 (libsystem_pthread.dylib + 29412) [0x184bb82e4]
999 _NSEventThread + 148 (AppKit + 1442424) [0x18893b278]
999 CFRunLoopRunSpecific + 588 (CoreFoundation + 505652) [0x184c9e734]
999 __CFRunLoopRun + 1212 (CoreFoundation + 508588) [0x184c9f2ac]
999 __CFRunLoopServiceMachPort + 160 (CoreFoundation + 514636) [0x184ca0a4c]
999 mach_msg + 24 (libsystem_kernel.dylib + 4764) [0x184b7729c]
999 mach_msg_overwrite + 480 (libsystem_kernel.dylib + 39672) [0x184b7faf8]
999
999 mach_msg2_trap + 8 (libsystem_kernel.dylib + 3924) [0x184b76f54]
*999 ??? (kernel.release.t8122 + 240448) [0xfffffe0008712b40]
Binary Images:
0x104ad0000 - 0x104aebfff com.apple.AccessibilityVisualsAgent 1.0 (387.5.2) <9525C44B-57F0-3FC8-93AE-EEE0FE10225D> /System/Library/PrivateFrameworks/AccessibilitySupport.framework/Versions/A/Resources/AccessibilityVisualsAgent.app/Contents/MacOS/AccessibilityVisualsAgent
0x184832000 - 0x1848b3f3f dyld (1245.1) <398A133C-9BCB-317F-A064-A40D3CEA3C0F> /usr/lib/dyld
0x184b76000 - 0x184bb0ff7 libsystem_kernel.dylib (11215.81.4) /usr/lib/system/libsystem_kernel.dylib
0x184bb1000 - 0x184bbdfff libsystem_pthread.dylib (535) <642FAF7A-874E-37E6-8ABA-2B0CC09A3025> /usr/lib/system/libsystem_pthread.dylib
0x184c23000 - 0x185117fff com.apple.CoreFoundation 6.9 (3302.1.400) <190E6A36-FCAA-3EA3-94BB-7009C44653DA> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x1887db000 - 0x189c17fff com.apple.AppKit 6.9 (2575.40.6) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x190102000 - 0x190409fff com.apple.HIToolbox 2.1.1 (1219.3) <950F1236-ACAF-379D-819F-6C6B0B5DEABD> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
*0xfffffe00086d8000 - 0xfffffe0008f9bfff kernel.release.t8122 (11215.81.4) <11F36980-B7BB-30DE-98D4-D52EEA979C99>__TEXT_EXEC /System/Library/Kernels/kernel.release.t8122
We do not use sync wait for async code (like GetAwaiter().GetResult()) which could cause deadlock of xUnit runner. Do you have any ideas? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions