This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #11432] next_line() in getsysstats.c skips lines due to broken else block
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: rsa at us dot ibm dot com
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 25 Mar 2010 20:43:11 -0400
- Subject: Re: [PATCH][BZ #11432] next_line() in getsysstats.c skips lines due to broken else block
- References: <1269534157.16656.102.camel@localhost.localdomain>
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.