NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/39308: sort +1n failure



>Number:         39308
>Category:       bin
>Synopsis:       sort +1n failure
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 07 08:25:00 +0000 2008
>Originator:     Simon Burge
>Release:        NetBSD 4.0, NetBSD -current as of 20080807
>Organization:
>Environment:
Architecture: any?  fails on i386 and amd64  not tried on big-endian.
>Description:
        "sort +1n" is failing to numerically sort the second field of a
        file.  Note that the input is important and very touchy.  The
        "x 4" line can have any number of "x"s before the 4, and seems
        like any number of these lines will work.  Shorten the number of
        "x"s at the start of most of the "xxxxxxxxxxxxx 2" lines seems
        to be enough to make it sort properly, as will changing an "x"
        after the "4" or deleting a line most of the time.

>How-To-Repeat:
        Uudecode the following file and run:

                zcat testfile.bz2 | sort +1n | sed -n -e 1p -e \$p

        and observe that 4 is less than 2 (!):

                x 4
                xxxxxxxxxxxxx 2 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

        begin-base64 644 testfile.bz2
        QlpoOTFBWSZTWW1WSR4CIjXb/AAwQAAUACAAEf//////////////8ABAAnuUkSAc
        DTTTQaGhoZGgGQBoaA00ZAAAwmIDQ4Gmmmg0NDQyNAMgDQ0BpoyAABhMQGgmqqo0
        GhoNDQaAGhkaBiZBoGTQZDCDI0AApVSQGjQaZAyaADIAMg0AAAA0BkNH6py4pCi3
        m9wa32/uAmFU4KnCJwyOIVWTBN5UplVCy4I3oKb5Im/JFwCouDIhllIZhFLmSgua
        RJzqSjnwodCJBxVUo41KiccIpyJRJyVBTlKqJy6iJzCCmeVCshCK7ECV2YKVkypV
        dqUqrtlCdwqh3UQd4qDq1IHWKA0YFWlJVXXgVdipRdlILtUpGnEi7YUnclBd0Ene
        Kkd+iI8EIegqFoKJokq9Mk0pK9Ui9aj2RV7VK06GoR7pT3qXwRqi+EnxR8i+Y1C+
        lPqJ9lH3ovxFfmK1UjWin6Iv3UX8QtcU/qR/orAkw11EqKezBRKimFRKimMkhBYY
        ikgixKJUUxFIYyiVFMQhEif8XckU4UJBtVkkeA==
        ====

        Note that the above file unzips to a ~7.5MB file.

>Fix:
        None given.  Some overflow somewhere given the ease with which it
        will and wont work?



Home | Main Index | Thread Index | Old Index