Bug 96638 - once-test fails
Summary: once-test fails
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: build-system (show other bugs)
Version: unspecified
Hardware: PowerPC Linux (All)
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
Depends on:
Reported: 2016-06-22 16:03 UTC by than
Modified: 2018-07-30 10:30 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description than 2016-06-22 16:03:45 UTC
The once-test fails for 8.99 versions

Version-Release number of selected component (if applicable):

FAIL: once-test
Running suite(s): Once
0%: Checks: 1, Failures: 1, Errors: 0
tests/once-test.c:74:F:once:once_test:0: Assertion 'pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) == 0' failed
FAIL once-test (exit status: 1)

imo it's a bug in the check which just run the threads on all CPUs even some CPUS are on active, for example on ppc64/ppc64le in koji (fedora build enviroment)

i did a patch which resolves this issue for me.

diff -up pulseaudio-8.99.2/src/tests/once-test.c.than pulseaudio-8.99.2/src/tests/once-test.c
--- pulseaudio-8.99.2/src/tests/once-test.c.than        2016-06-22 10:20:57.127583628 -0400
+++ pulseaudio-8.99.2/src/tests/once-test.c     2016-06-22 10:59:38.905573634 -0400
@@ -70,7 +70,7 @@ static void thread_func(void *data) {
-    CPU_SET((size_t) (pa_atomic_inc(&i_cpu) % n_cpu), &mask);
+    CPU_SET(pthread_getaffinity_np(pthread_self(), sizeof(mask), &mask), &mask);
     fail_unless(pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) == 0);
Comment 1 than 2017-01-17 12:25:25 UTC
could someone please review the patch? it would be great if it can be merged into next update.

Comment 2 Tanu Kaskinen 2017-01-24 05:19:55 UTC
Sorry for late reply. The current code indeed does bad assumptions about the availability of cpus. The fix doesn't seem quite right, however. Unless I'm mistaken, your patch is equivalent to just removing the setaffinity call, because you set the affinity to the same value that is already set for the thread.

Note also that we have another fix applied for pa_ncpus():

That changes things so that we don't try to use more cpus than what are online. That might or might not fix the problem that you're seeing. The once-test code still makes the assumption that the cpus that are online are numbered 0, 1, 2, etc. which may be incorrect.
Comment 3 GitLab Migration User 2018-07-30 10:30:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/475.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.