GNU bug report logs - #9612
sort: avoid a NaN-induced infloop

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Tue, 27 Sep 2011 14:50:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 9612 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 9612 <at> debbugs.gnu.org
Subject: Re: bug#9612: sort: avoid a NaN-induced infloop
Date: Tue, 27 Sep 2011 19:24:25 +0200
Andreas Schwab wrote:
> Jim Meyering <jim <at> meyering.net> writes:
>
>> The statement "long double x = NAN;" (inside glibc's strtold) leaves many
>> bits of "x" uninitialized.
>
> You are looking at padding bits, which have unspecified contents.

I realize that they are unspecified.
That is why I did not claim that this is a POSIX violation.
POSIX says little about what strtold must do for a "NaN" string.
However, I am dismayed that with glibc's strtold the values of those bits
is not deterministic.  That makes sorting NaN values obtained from strtold
unnecessarily hard.




This bug report was last modified 13 years and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.