Skip to content

Orphaned sail_riscv_sim processes on Ctrl+C or task failure #1238

@karabambus

Description

@karabambus

Describe the bug
When a act run is cancelled (Ctrl+C) or a task failure causes early exit, any sail_riscv_sim processes already launched by worker threads are not terminated. They become orphaned OS processes and continue consuming CPU until the OS is rebooted or they are killed manually. If the sail processes are themselves hung, they run indefinitely and saturate all cores.

To Reproduce
Steps to reproduce the behavior:
For this to have real effect - test should hang and run indefinitely. Canceling this tests with CTRL + C reproduces this behavior.
Good target is removing F_SUPPORTED from rvtest_config.h and running F tests then canceling during hang.

Additional context
KeyboardInterrupt is delivered only to the main thread. The worker threads are unaffected - they continue blocking on their subprocess.run() call. When the ThreadPoolExecutor context manager exits, it calls executor.shutdown(wait=False, cancel_futures=True), which cancels not-yet-started futures but cannot stop threads already running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Test FrameworkIssue or pull request related to the test selection/runtime frameworkbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions