This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]