Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 29 Nov 2014 15:36:33 -0800
From: Isaac Dunham <ibid.ag@...il.com>
To: musl@...ts.openwall.com
Subject: __sched_cpucount returns garbage

Hello,
I noticed that nproc ended up on the toybox TODO list (via Tizen), and went
poking about via strace and ltrace to see where it got the cpu count from.

In the process, I discovered that __sched_cpucount is returning garbage;
on Alpine Linux on my N270-based netbook (1 physical core but 
hyperthreading makes it look like 2),
nproc
outputs a random number of CPUs ranging from 413 to 472.
ltrace indicates that this is calling __sched_cpucount() and printing 
its return value.

nproc --all
calls sysconf(_SC_NPROCESSORS_CONF) and gets the proper number of CPUs.

Thanks,
Isaac Dunham

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.