sort utility goes berzerk (x86_64)

Houder houder@xs4all.nl
Sat Nov 25 13:23:00 GMT 2017


Hi,

Anyone seeing this as well? sort goes berzerk on my system when piped into
head (or less) when it is fed with a 'specially prepared' input file.

 - only happens on x86_64
 - does not happen for 'LC_COLLATE=C sort tt | head'

'specially prepared' input file? (see bottom of post).

Henri

64-@@ sort tt | head
abcde    1xxxxx0123456789
abcde    2xxxxx0123456789
abcde    3xxxxx0123456789
abcde    4xxxxx0123456789
abcde    5xxxxx0123456789
abcde    6xxxxx0123456789
abcde    7xxxxx0123456789
abcde    8xxxxx0123456789
abcde    9xxxxx0123456789
abcde   10xxxxx0123456789
 <==== prompt does not return
 note: sort.exe cannot be killed using 'kill -9'
 note: sort.exe is using a high amount of CPU ... (loop?)
 note: file tt is obtained as follows ./genfl.sh > tt (see bottom of post)

# sort is terminated from another instance of bash, using:
64-@@ taskkill /f /im sort.exe
SUCCESS: The process "sort.exe" with PID 3680 has been terminated.

-----
64-@@ uname -a
CYGWIN_NT-6.1 Seven 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64 Cygwin

64-@@ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

64-@@ cat genfl.sh
#!/bin/bash

# sorting seems not to obey LC_COLLATE=en_US.UTF-8

awk '
#BEGIN  { cnt = 4000 }
#BEGIN  { cnt = 5000 }
#BEGIN  { cnt = 5050 } # sort going berzerk
#BEGIN  { cnt = 5500 } # sort going berzerk
#BEGIN  { cnt = 6000 } # sort going berzerk
#BEGIN  { cnt = 8000 } # sort going berzerk
BEGIN   { cnt = 8150 } # sort going berzerk
#BEGIN  { cnt = 8200 }
#BEGIN  { cnt = 8500 }
#BEGIN  { cnt = 9000 }
#BEGIN  { cnt = 10000 }
#BEGIN  { cnt = 12000 }
#BEGIN  { cnt = 16000 }
END     {
          for (i = 1; i <= cnt; i++) {
            str = "0123456789"
            printf "abcde%5dxxxxx%s\n", i, str
          }
        } ' /dev/null

=====


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list