Skip to content

bug: test_context_names segfaults intermittently in test_canvas_sources (Tier 2 Linux, Rust ON) #2049

Closed

Description

@zackees

Bug

test_context_names (cmocka, Tier 2 Linux, Rust ON) crashed once with a segfault in its test_canvas_sources case. A rerun of the same job on the same commit passed.

[ RUN      ] test_canvas_sources
Could not run test: Test failed with exception: Segmentation fault(11)Test teardown failed
...
The following tests FAILED:
	 16 - test_context_names (Failed)

The crash is intermittent, which fits a lifetime race. The new weak-canvas release in #2041 (and #2017/#2038 before it) is the first place to look: a source's canvas reference released or read on one thread while the canvas is torn down on another.

Next steps

Activity

  1. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Claiming: #2049.

    1. Reproduce locally: build Tier 2 Linux (Rust ON) and run test_context_names in a loop. The log says "Test teardown failed", so the crash is probably in obs_shutdown after test_canvas_sources.
    2. RED: a test that makes the crash deterministic. GREEN: the fix in libobs.
  2. added
    claimed
    on Oct 24, 2026
  3. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    PR #2052 fixes two use-after-frees in obs_canvas_destroy: reading hh.next from a released scene, and HASH_CLEAR (from #2041) reading the table through a list head the destruction task thread may already have freed. With both fixes, Tier 2 tests ON passed (run 40067156166). The crash was intermittent, so one green run is limited evidence; reopen if test_context_names segfaults again.

  4. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Seen again in merge-queue run 40066825554 (both Tier 2 Linux jobs, tests ON and OFF), ejecting #2050 (obs-ffmpeg only).

  5. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Still happening after the close: nightly run 40063131689, job "Rust Tier 2 macos-26" (headSha 56732d6, which already has #2022 and #2041). It crashed in the Cargo [obs-c-reference] suite: test_context_names → test_canvas_sources, "Segmentation fault: 11 … Test teardown failed". The CMake OFF and hybrid ON suites passed, and lldb didn't reproduce it in 30 runs. So this is a timing-dependent teardown crash on both backends and both platforms, not only Rust ON.

  6. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Correction: I reopened this by mistake. Nightly 40063131689 ran on 56732d6, which does not contain #2052's fix (a35c779). It's the same crash that was already fixed, so I'm closing it again.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions