Skip to content

killPid returns false when successfully killing on Windows. Make it return true! #47675

Closed

Description

@lrhn

The killPid static method of Process tries to send a signal to a process. It returns true if the signal was delivered (whether it was a kill-signal or not).

However, on Windows, it just kills the process in a non-signal based way. It then returns false, probably because no signal was delivered.
It would be better if it returned true if a process with that Pid existed (and it was killed), and false if no process with that Pid existed.

Activity

  1. added
    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
    type-enhancementA request for a change that isn't a bug
    on Nov 11, 2021
  2. aam commented on Jan 13, 2022

    @aam
    Contributor

    @lrhn , looking at the source code https://github.com/dart-lang/sdk/blob/main/runtime/bin/process_win.cc#L922 it seems it should return true if TerminateProcess was successful. false can also be returned if we failed to (get permission to) attach to the subject process.

    Do you have a repro for the problem you describe?

  3. lrhn commented on Jan 14, 2022

    @lrhn
    MemberAuthor

    I agree that the source code looks like it does the right thing.

    I was reporting this bug based on someone else's experience. Likely something like flutter/flutter#96320 (comment), but I no longer remember how I first became aware of it.

  4. added
    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
    and removed
    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
    on Apr 21, 2024
  5. self-assigned this
    on May 15, 2024
  6. aam commented on May 15, 2024

    @aam
    Contributor

    Please reopen with reproduction steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ioos-windowstype-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