Skip to content

test: test_alsa_device_lost can take its thread baseline while an old thread still exits #3575

Closed

Description

@vpacher

What happens

The asan job failed on #3563 (run 41670689565, attempt 1) in destroy_while_away:

[  ERROR   ] --- 1 != 2
[   LINE   ] --- test/cmocka/test_alsa_device_lost.c:372: error: Failure!

The rerun passed on the same commit, and the failure has nothing to do with that PR.

Cause

destroy_while_away (:364) and update_while_away (:380) read thread_count() once at the start, then compare the settled count with it. In this failure the baseline was 2 and the settled count was 1, so the test ended with fewer threads than it started with. The source did not leave a thread behind.

I expect that the baseline counted a thread of the previous case that was still exiting. pthread_join() can return before the task leaves /proc/self/task. I did not reproduce this.

Proposed fix

Before the baseline, wait until the count is stable for a short time. The check after the destroy stays as it is.

Activity

  1. added
    bug
    ready
    on Nov 3, 2026
  2. vpacher commented on Nov 3, 2026

    @vpacher
    MemberAuthor

    Claiming: #3575

    1. PR: wait for a stable thread count before the baseline in destroy_while_away and update_while_away.

    First PR today.

  3. added a commit that references this issue on Nov 4, 2026
    929eef7
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