Hi,

On 4 July 2016 at 14:40, John Paul Adrian Glaubitz
<[email protected]> wrote:
> Hello!
>
> pulseaudio currently fails to build from source on systems with dynamic CPU 
> configurations.
>
> More precisely, the once-test fails [1] since pa_ncpu() in 
> src/pulsecore/core-util.c returns
> a wrong number of available CPUs. The source code assumes that 
> sysconf(_SC_NPROCESSORS_CONF)
> reports the number of currently available CPUs. However, since the operating 
> system may
> dynamically disable individual CPUs, this number will not report the of CPUs 
> that are
> actually available. This is also documented in the glibc manual [2].
>
> Following the glibc manual, this can be trivially fixed by using 
> _SC_NPROCESSORS_ONLN instead
> of _SC_NPROCESSORS_CONF which also fixes the once-test on sparc64.
>
> I will report this bug upstream,

Yes please.

> but please also consider adding this bug to the currently
> available pulseaudio package in Debian. Since dynamic CPU configurations may 
> also occur
> on other architectures, this bug is not specific to sparc64.

Sure. However, I have a question:

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index f816da9..f648af8 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -3179,8 +3179,8 @@ void pa_reduce(unsigned *num, unsigned *den) {
 unsigned pa_ncpus(void) {
     long ncpus;

-#ifdef _SC_NPROCESSORS_CONF
-    ncpus = sysconf(_SC_NPROCESSORS_CONF);
+#ifdef _SC_NPROCESSORS_ONLN
+    ncpus = sysconf(_SC_NPROCESSORS_ONLN);

Are there systems where _SC_NPROCEESSORS_CONF is available but
_SC_NPROCEESSORS_ONLN isn't? If so, this should probably be a new
case, not replace the existing one.

I may be a bit slow in uploading, so feel free to NMU this change if
you want it faster.

-- 

Saludos,
Felipe Sateler

_______________________________________________
pkg-pulseaudio-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-pulseaudio-devel

Reply via email to