Skip to content

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Jan 28, 2026

Branched on #1016.

Follow up to posit-dev/positron#11407 and posit-dev/positron#11497 where we disabled the exthost restart test on Windows (Slack discussion at https://positpbc.slack.com/archives/C06DNFJSHPD/p1769113239000079).

Not sure what this only surfaced on Windows, but the cause was an Ark crash due to sloppy Unwraps on connection events. This PR makes sure connection errors are propagated, logged, and cause the DAP server to shut down gracefully.

It was a bit tricky to debug because the logs were not showing the crash. The only clue that surfaced was a message in the Console:

Screenshot 2026-01-28 at 12 07 27

and these messages in the Supervisor logs:

10:00:05 [DEBUG] (2) kcserver::kernel_session::process: End of output stream (kind: Stderr)
10:00:05 [DEBUG] (18) kcserver::kernel_session::process: End of output stream (kind: Stdout)
10:00:05 [INFO] Child process for session r-68064bdf exited with status: exit code: 0xc0000409
10:00:05 [DEBUG] (17) kcserver::kernel_state: [session r-68064bdf] status 'idle' => 'exited' (child process exited)
10:00:05 [DEBUG] (17) kcserver::heartbeat: [session r-68064bdf] Stopping heartbeat monitor (exit event signaled).

0xc0000409 is the code for STATUS_STACK_BUFFER_OVERRUN.

Attaching Ark with a debugger then restarting the exthost gave enough time to the process to emit log messages before exit, revealing the DAP panic.

@lionel- lionel- requested a review from DavisVaughan January 28, 2026 11:10
Copy link
Contributor

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As usual, I'm a very big fan of less unwrap()s 😄

Comment on lines +154 to +159
let event = match event {
Ok(event) => event,
Err(err) => {
// Channel closed, sender dropped
log::info!("DAP: Event channel closed: {err:?}");
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is it getting dropped on the sender side when the ext host restarts suddenly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we've hit that code path, it's a defensive fix. It would happen if the DAP comm closed before the DAP connection I think.

@lionel- lionel- merged commit 9600a40 into bugfix/breakpoints-windows Jan 28, 2026
8 checks passed
@lionel- lionel- deleted the bugfix/dap-disconnection branch January 28, 2026 15:43
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants