Hi all, I've found a "bug" in sort when running it through a big file (1GB) : sort -o sorted sort_test.txt This gives a segmentation fault: # gdb ./sort sort.core GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-unknown-openbsd5.2"... Core was generated by `sort'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/lib/libc.so.65.0...done. Loaded symbols for /usr/lib/libc.so.65.0 Reading symbols from /usr/libexec/ld.so...done. Loaded symbols for /usr/libexec/ld.so #0 0x00000000004036be in fsort (binno=49, depth=1, infiles={top = 0, names = 0x21800000000}, nfiles=1338, outfp=0x20b50e9e0, ftbl=0x20e56c800) at fsort.c:159 159 fstack[tfiles.top + ntfiles].fp= ftmp(); (gdb) bt #0 0x00000000004036be in fsort (binno=49, depth=1, infiles={top = 0, names = 0x21800000000}, nfiles=1338, outfp=0x20b50e9e0, ftbl=0x20e56c800) at fsort.c:159 #1 0x0000000000403484 in fsort (binno=-1, depth=0, infiles={top = -117512, names = 0x7f7ffffe34f8}, nfiles=1, outfp=0x20b50e9e0, ftbl=0x20e56c800) at fsort.c:210 #2 0x000000000040556f in main (argc=Variable "argc" is not available.) at sort.c:304
This was reproduced on various machines all running amd64 5.2. I wasn't able to test this on -current but sort hasn't change in a while. You can download the sort_test.txt file here: http://cosmico.net/tmp/sort_test.txt.bz2 cheers, --rodolfo