Skip to content

bug: test_pipewire_teardown_wait: hangs on PipeWire 0.3.60 to 0.3.76 #3596

Closed

Description

@rdoupe

Location

test/cmocka/test_pipewire_teardown_wait.c:63-72 (since #3593):

struct pw_properties *props = pw_properties_new("thread-loop.start-signal", "true", NULL);
obs_pw->thread_loop = pw_thread_loop_new("PipeWire teardown test", &props->dict);
...
assert_int_equal(pw_thread_loop_start(obs_pw->thread_loop), 0);
pw_thread_loop_wait(obs_pw->thread_loop);

Class

Logic error (a test hang on supported PipeWire versions).

How it is reached

test/cmocka/tests.d/test_pipewire_teardown_wait.cmake builds the test for PipeWire 0.3.60 and newer (find_package(PipeWire 0.3.60 QUIET)). PipeWire's thread loop only reads thread-loop.start-signal from 0.3.77 on: src/pipewire/thread-loop.c has no start-signal at 0.3.60, 0.3.65, 0.3.68, 0.3.72 or 0.3.75, and has it at 0.3.77 and later. On 0.3.60 to 0.3.76 (Debian 12 ships 0.3.65) the property is ignored, the loop thread never signals, and the unconditional pw_thread_loop_wait() blocks until the ctest timeout. CI's runners have PipeWire 1.x, so CI doesn't see it. Found while reviewing a rebase onto #3593.

Proposed fix and failing test

Wait for the start signal only where the library honours it: raise this test's minimum to 0.3.77, or keep 0.3.60 and, below 0.3.77 (pw_check_library_version(0, 3, 77)), synchronize another way, for example by scheduling a no-op with pw_loop_invoke() from the loop thread and waiting for it under the lock. RED: the test run against a PipeWire 0.3.65 build (a Debian 12 container) hangs past its timeout; GREEN: it passes there and on 1.x.

Activity

  1. added
    bug
    on Nov 4, 2026
  2. rdoupe commented on Nov 4, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: the PipeWire 0.3.60 to 0.3.76 hang in test_pipewire_teardown_wait

    1. RED evidence: build PipeWire 0.3.65 (Debian 12's version) from source and run the current test against it; it blocks in the unconditional pw_thread_loop_wait() until the timeout, because thread-loop.start-signal is only read from 0.3.77 on.
    2. GREEN: drop the start-signal property and synchronize in a way every supported version honours: add an event source to the loop before starting it, signal it after pw_thread_loop_start(), and wait under the lock until its callback (which only runs on the loop thread, after it has entered the loop) has set a flag and signalled. This keeps the bug: test_pipewire_teardown_wait hung for 10 minutes in the asan job #3577 guarantee (the loop thread is in the loop before the stop) and keeps the 0.3.60 minimum.
    3. Check it passes against 0.3.65 and the host's 1.x, under ctest with no TMPDIR, and run the local gate lanes.

    PR expected today.

  3. added
    ready
    on Nov 4, 2026
  4. rdoupe commented on Nov 4, 2026

    @rdoupe
    CollaboratorAuthor

    Fixed by PR #3602 (merged through the merge queue). The teardown test no longer asks for thread-loop.start-signal, which PipeWire reads only from 0.3.77 on. It now waits for an event source's callback on the loop thread, which works on every version the test builds for, so the 0.3.60 minimum stays. A second case covers the loop built without the property, so CI's 1.x runners now exercise the pre-0.3.77 behaviour too. Checked against PipeWire 0.3.65 and 1.6.9. The knowledge note docs/knowledge/pipewire-stop-after-start.md was updated to match.

    Left: nothing. No follow-up issue is needed, and there is no tracking issue to tick.

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

Metadata

Metadata

Assignees

Labels

bugready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions