Skip to content

[DAP] Only kill positive pids on disconnection #55209

Open
@elliette

Description

@elliette

On disconnection, DAP kills all pids:

void terminatePids(ProcessSignal signal) {
// TODO(dantup): In Dart-Code DAP, we first try again with sigint and wait
// for a few seconds before sending sigkill.
for (var pid in pidsToTerminate) {
Process.killPid(pid, signal);
}
}

However, this set of pids contains the VM pid, which defaults to-1 if it was not set:

pid = json['pid'] ?? -1;

On Linux, killing -1 is a special case that means "kill all the process that you can." We had a case where this was killing a bunch of running processes on a users machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onanalyzer-stabilityarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.dds-dapDDS issues related to the Debug Adapter Protocol (DAP) implementationtype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions