Subject: Re: bug#9612: sort: avoid a NaN-induced infloop
From: Jim Meyering <[email-masked]>
To: [email-masked]
Date: Thu, 06 Oct 2011 16:56:57 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Jim Meyering wrote:
> Jim Meyering wrote:
>> Who would have thought that including a few NaNs in the input to sort
>> would make it infloop.
>>
>> The original failure arose only when sort was reading from a pipe:
>>
>>     yes -- -nan | head -156903 | sort -g > /dev/null
>>
>> But it's not always easy to reproduce.
> ...
>> [ I'm about to file the glibc bug
> ...
>
> I've done that:
>
>   RFE: strtold: do not include uninitialized bytes when converting "NaN"
>   http://sourceware.org/bugzilla/show_bug.cgi?id=13246

In the above BZ comments, Jakub Jelinek proposed something more robust,
but I think it's not necessary.  If we find an optimizer that thinks the
added memset is useless, we'll discover it via the failing test, so I'd
prefer not to add the volatile/union hack.

I'm closing this.