[PATCH][BZ #11432] next_line() in getsysstats.c skips lines due to broken else block

Carlos O'Donell carlos@systemhalted.org
Fri Mar 26 00:46:00 GMT 2010


On Thu, Mar 25, 2010 at 12:22 PM, Ryan Arnold <rsa@us.ibm.com> wrote:
> Bugzilla 11432 describes a bug where next_line() in getsystats.c skips
> lines due to a broken else block and therefore __get_nprocs() returns an
> incorrect number of CPUs:
>
> http://sourceware.org/bugzilla/show_bug.cgi?id=11432
>
> In the bugzilla there's a sample /proc/stat file that can be bind
> mounted over /proc/stat and a testcase that demonstrates the problem.
>
> I came up with a corrected else block in the bugz and show how it's
> redundant to what's already in next_line().
>
> The following patch removes the else block as redundant.  The testcase
> passes with this block removed.
>
> Since this required a bind mounted /proc/stat file I'm not sure how a
> test-suite check could be derived from it.

Can you build a shared library that could override the appropriate
functions and simulate the failure?

For example could you record all reads/writes to certain files, and
play them back to the testcase?

Cheers,
Carlos.



More information about the Libc-alpha mailing list