|
From: | Paul Eggert |
Subject: | bug#55212: GNU Linux "sort -g" can hang indefinitely when run on standard input if NaNs are involved |
Date: | Mon, 2 May 2022 10:16:37 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 |
On 5/2/22 06:31, Pádraig Brady wrote:
This is a bit slower of course, but since an edge case not a big concern:
Yes, my thoughts too. There are ways to speed up common lots-o-NaN cases portably (I toyed with the idea of using ieee754.h), but I went with the simple approach for now.
A nit: 'time' needs to be at the end of the pipeline: $ yes nan | head -n128095 | bash -c 'time src/sort -g' >/dev/null real 0m0.552s user 0m0.551s sys 0m0.001s $ yes nan | head -n128095 | bash -c 'time sort -g' >/dev/null real 0m0.392s user 0m0.382s sys 0m0.009s 512-day $ yes nan | head -n128095 | bash -c 'time sort -g' >/dev/null [Here I had to control-C since 'sort' inflooped.]
[Prev in Thread] | Current Thread | [Next in Thread] |