Skip to content

Ark: Deadlock between the DAP and the kernel #5024

@lionel-

Description

@lionel-

Run this and type <f10> rapidly (or click step over). R should quickly deadlock.

f <- function() {
  for (i in 1:1000) {
    assign(as.character(i), i)
  }
  browser()
  repeat {
    NULL
  }
}

f()

Here are the two blocked threads:

Image
Image

This happens because a DAP "variables" request attempts to call R with an r_task() whereas the kernel attempts to take a lock on the DAP.

Both of these components try to pull information from each other. One way to fix this would be to push the information via a channel instead, like we do with the LSP after each top-level command.

Metadata

Metadata

Assignees

Labels

area: debuggerIssues related to Debuggingarea: kernelsIssues related to Jupyter kernels and LSP serverslang: r

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions