Skip to content

Flaky SIGSEGV in parallel test runs during GPU teardown #420

Description

@mohamedtahaguelzim

cargo test --workspace with the default parallel test threads intermittently dies with SIGSEGV around GPU test teardown. Observed locally on dev (2 of 3 runs) and on refactor/projection-self-ownership (1 of 5 runs); --test-threads=1 is stable across many runs on both branches.

The GPU tests each acquire their own adapter/device via gpu_or_skip(), so a parallel run creates and drops several GpuContexts concurrently. The crash pattern (segfault at teardown, timing-dependent, disappears single-threaded) points at a driver or wgpu instance teardown race between concurrent contexts rather than at any single test.

Not observed in CI so far (lavapipe adapter, RECO_REQUIRE_GPU=1).

Possible directions, unverified:

  • share one GpuContext across tests behind a OnceLock, dropping the per-test contexts entirely
  • serialize GPU tests with a mutex in test_support while leaving CPU tests parallel
  • reproduce under a debugger to confirm the faulting component (driver vs wgpu) before choosing

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogKanban: not yet startedbugSomething isn't workingmediumCode quality, missing tests, documentation drifttestingTest coverage, CI, build

    Type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions