Skip to content

Commit 496f7d7

Browse files
authored
Fix broken debugger/debuggee startup handshake protocol on macOS26. (#5530)
As identified by dotnet/runtime#116545, macOS26 have broken semaphores in case debugger and debuggee have been signed with different team ids, currently only mentioned for iOS/iPadOS, https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-26-release-notes, but testing shows its broken for regular apps as well. This PR adds support for a different startup handshake protocol for debugger/debuggee using FIFO file (aka named pipes) on Apple platforms due to limitation introduced in macOS26. All other POSIX platforms will continue to use the semaphore based handshake protocol. The implementation is backward compatible on Apple platforms. Implementation will always setup semaphores to support runtimes using semaphore protocol, but on Apple platforms it will also create the new FIFO files, it will then spawn a separate background thread checking the FIFO files for connections and handling the protocol. In case runtime supports new FIFIO based protocol, background thread will handle complete protocol and signal/wait semaphores, making the underlying protocol transparent for the startup thread, it will always use the semaphores. In case runtime doesn't support FIFO files, runtime will signal/wait on the semaphores as normal coordinating with the debugger startup thread. In the case runtime doesn't support FIFO files, the background thread will just sit and wait on connections until canceled. Unregister cancel out background thread in case runtime didn't support FIFO files. Since this fix supports both semaphores and FIFO files on Apple platform it is compatible with old runtimes using semaphores as well as new runtimes that supports the FIFO based handshake protocol. In order for this change to work E2E, the debugger needs to use changes introduced in this PR with a runtime including dotnet/runtime#118120. Until both debugger and debuggee have been update, debug launch on macOS26 won't work. Names of the two new FIFO files follow the same naming pattern as we have for existing debugger FIFO's, using suffix currently used for the startup and continue semaphores, "st" for startup and "co" for continue, example of full FIFO names: /var/folders/d0/l_56x0lx6l7bbrv3pfr128xc0000gn/T/clr-debug-pipe-11462-1753451225-st /var/folders/d0/l_56x0lx6l7bbrv3pfr128xc0000gn/T/clr-debug-pipe-11462-1753451225-co
1 parent 481bc26 commit 496f7d7

File tree

1 file changed

+580
-9
lines changed

1 file changed

+580
-9
lines changed

0 commit comments

Comments
 (0)