FS#5365 - coreutils (fold command) problem

Attached to Project: Arch Linux
Opened by Henrik Holst (holst) - Wednesday, 06 September 2006, 23:38 GMT
Last edited by Tobias Powalowski (tpowa) - Friday, 29 December 2006, 13:25 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture not specified
Severity Low
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The fold command crashes! :-(
It works in a debian system (2.6.16 kernel), but I can't say for sure if it's an upstream problem or not.

Here are a log:

holst@box:~$ fold /etc/host.conf /etc/host.conf
<snipped contents of /etc/host.conf>
*** glibc detected *** fold: double free or corruption (fasttop): 0x0804db38 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7e8eab0]
/lib/libc.so.6(__libc_free+0x84)[0xb7e900f4]
fold[0x80496d2]
fold[0x8049ce2]
/lib/libc.so.6(__libc_start_main+0xd8)[0xb7e41808]
fold[0x8048ce1]
======= Memory map: ========
08048000-0804c000 r-xp 00000000 08:01 69470 /usr/bin/fold
0804c000-0804d000 rwxp 00004000 08:01 69470 /usr/bin/fold
0804d000-0806e000 rwxp 0804d000 00:00 0 [heap]
b7b00000-b7b21000 rwxp b7b00000 00:00 0
b7b21000-b7c00000 ---p b7b21000 00:00 0
b7cd9000-b7e2b000 r-xp 00000000 08:01 64985 /usr/lib/locale/locale-archive
b7e2b000-b7e2c000 rwxp b7e2b000 00:00 0
b7e2c000-b7f43000 r-xp 00000000 08:01 436357 /lib/libc-2.4.so
b7f43000-b7f45000 r-xp 00116000 08:01 436357 /lib/libc-2.4.so
b7f45000-b7f47000 rwxp 00118000 08:01 436357 /lib/libc-2.4.so
b7f47000-b7f4b000 rwxp b7f47000 00:00 0
b7f54000-b7f5e000 r-xp 00000000 08:01 69096 /usr/lib/libgcc_s.so.1
b7f5e000-b7f5f000 rwxp 00009000 08:01 69096 /usr/lib/libgcc_s.so.1
b7f5f000-b7f61000 rwxp b7f5f000 00:00 0
b7f61000-b7f7b000 r-xp 00000000 08:01 436376 /lib/ld-2.4.so
b7f7b000-b7f7c000 r-xp 00019000 08:01 436376 /lib/ld-2.4.so
b7f7c000-b7f7d000 rwxp 0001a000 08:01 436376 /lib/ld-2.4.so
bfad7000-bfaed000 rw-p bfad7000 00:00 0 [stack]
ffffe000-fffff000 ---p 00000000 00:00 0 [vdso]
Aborted
holst@box:~$


The fold version is:

fold (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Friday, 23 February 2007, 21:44 GMT
Reason for closing:  Fixed
Additional comments about closing:  was a bug in the i18n patch
Comment by Henrik Holst (holst) - Wednesday, 06 September 2006, 23:49 GMT
A friend has triend and reproduced the bug on a Gentoo system; so I guess it's upstream.

Linux silo.nodlab.net 2.6.17-gentoo-r7 #3 SMP Tue Sep 5 20:13:42 CEST 2006 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz GNU/Linux

silo ~ # fold /etc/host.conf /etc/host.conf
<SNIP>
*** glibc detected *** fold: double free or corruption (top): 0x0804d1a0 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7f04cb0]
/lib/libc.so.6(__libc_free+0x84)[0xb7f062f4]
fold[0x80496f2]
fold[0x8049d02]
/lib/libc.so.6(__libc_start_main+0xd8)[0xb7eb7878]
fold[0x8048d01]
======= Memory map: ========
08048000-0804c000 r-xp 00000000 03:02 293330 /usr/bin/fold
0804c000-0804d000 rw-p 00004000 03:02 293330 /usr/bin/fold
0804d000-0806e000 rw-p 0804d000 00:00 0 [heap]
b7d00000-b7d21000 rw-p b7d00000 00:00 0
b7d21000-b7e00000 ---p b7d21000 00:00 0
b7e92000-b7e9c000 r-xp 00000000 03:02 296122 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libgcc_s.so.1
b7e9c000-b7e9d000 rw-p 00009000 03:02 296122 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libgcc_s.so.1
b7ea1000-b7ea2000 rw-p b7ea1000 00:00 0
b7ea2000-b7fb9000 r-xp 00000000 03:02 81532 /lib/libc-2.4.so
b7fb9000-b7fbb000 r--p 00116000 03:02 81532 /lib/libc-2.4.so
b7fbb000-b7fbd000 rw-p 00118000 03:02 81532 /lib/libc-2.4.so
b7fbd000-b7fc0000 rw-p b7fbd000 00:00 0
b7fc2000-b7fc5000 rw-p b7fc2000 00:00 0
b7fc5000-b7fdf000 r-xp 00000000 03:02 81521 /lib/ld-2.4.so
b7fdf000-b7fe0000 r--p 00019000 03:02 81521 /lib/ld-2.4.so
b7fe0000-b7fe1000 rw-p 0001a000 03:02 81521 /lib/ld-2.4.so
bfaf7000-bfb0d000 rw-p bfaf7000 00:00 0 [stack]
ffffe000-fffff000 ---p 00000000 00:00 0 [vdso]
Aborted
silo ~ #
Comment by Tobias Powalowski (tpowa) - Thursday, 07 September 2006, 06:44 GMT
i cannot reproduce it here
Comment by Henrik Holst (holst) - Friday, 08 September 2006, 03:53 GMT
How can I build this with abs and makepkg such that debugging information is added?

I have installed "gdb" and "ddd" but the fold binary lacks debugging symbols (apparently).
Comment by Jens Adam (byte) - Friday, 08 September 2006, 08:01 GMT
Add "options=(NOSTRIP)" to the PKGBUILD.
Comment by Henrik Holst (holst) - Sunday, 10 September 2006, 18:19 GMT
*** glibc detected *** /var/abs/base/coreutils/pkg/usr/bin/fold: double free or corruption (fasttop): 0x0804db38 ***
(no debugging symbols found)

Still I get the '(no debugging symbols found)' :-(
Comment by Roman Kyrylych (Romashka) - Wednesday, 08 November 2006, 23:40 GMT
I suppose this is fixed in coreutils 6.4 ?
Comment by Henrik Holst (holst) - Thursday, 09 November 2006, 00:22 GMT
holst@box:~$ fold --version
fold (GNU coreutils) 6.4
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
holst@box:~$ fold /etc/host.conf /etc/host.conf > /dev/null
*** glibc detected *** fold: double free or corruption (fasttop): 0x0804e1f0 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7e15750]
/lib/libc.so.6(__libc_free+0x84)[0xb7e16da4]
fold[0x80496e2]
fold[0x8049cf2]
/lib/libc.so.6(__libc_start_main+0xd8)[0xb7dc7808]
fold[0x8048cf1]
======= Memory map: ========
08048000-0804c000 r-xp 00000000 08:01 66760 /usr/bin/fold
0804c000-0804d000 rwxp 00004000 08:01 66760 /usr/bin/fold
0804d000-0806e000 rwxp 0804d000 00:00 0 [heap]
b7a00000-b7a21000 rwxp b7a00000 00:00 0
b7a21000-b7b00000 ---p b7a21000 00:00 0
b7bb1000-b7db1000 r-xp 00000000 08:01 77257 /usr/lib/locale/locale-archive
b7db1000-b7db2000 rwxp b7db1000 00:00 0
b7db2000-b7ecc000 r-xp 00000000 08:01 436325 /lib/libc-2.4.so
b7ecc000-b7ece000 r-xp 00119000 08:01 436325 /lib/libc-2.4.so
b7ece000-b7ed0000 rwxp 0011b000 08:01 436325 /lib/libc-2.4.so
b7ed0000-b7ed4000 rwxp b7ed0000 00:00 0
b7edc000-b7ee6000 r-xp 00000000 08:01 69096 /usr/lib/libgcc_s.so.1
b7ee6000-b7ee7000 rwxp 00009000 08:01 69096 /usr/lib/libgcc_s.so.1
b7ee7000-b7ee9000 rwxp b7ee7000 00:00 0
b7ee9000-b7eea000 r-xp b7ee9000 00:00 0 [vdso]
b7eea000-b7f04000 r-xp 00000000 08:01 436324 /lib/ld-2.4.so
b7f04000-b7f05000 r-xp 00019000 08:01 436324 /lib/ld-2.4.so
b7f05000-b7f06000 rwxp 0001a000 08:01 436324 /lib/ld-2.4.so
bfce8000-bfcfd000 rw-p bfce8000 00:00 0 [stack]
Avbruten (SIGABRT)
holst@box:~$
Comment by Andreas Radke (AndyRTR) - Wednesday, 27 December 2006, 07:12 GMT
works on x86_64 with latest coreutils ver. 6.7
Comment by Henrik Holst (holst) - Wednesday, 27 December 2006, 12:43 GMT
holst@box:~$ fold --version
fold (GNU coreutils) 6.7
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

holst@box:~$ fold /etc/host.conf /etc/host.conf > /dev/null
*** glibc detected *** fold: double free or corruption (fasttop): 0x0804d1a0 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7ec9b00]
/lib/libc.so.6(__libc_free+0x89)[0xb7ecb199]
fold[0x80496f2]
fold[0x8049d02]
/lib/libc.so.6(__libc_start_main+0xd8)[0xb7e7b7c8]
fold[0x8048cf1]
======= Memory map: ========
08048000-0804c000 r-xp 00000000 08:01 66758 /usr/bin/fold
0804c000-0804d000 rwxp 00004000 08:01 66758 /usr/bin/fold
0804d000-0806e000 rwxp 0804d000 00:00 0 [heap]
b7d00000-b7d21000 rwxp b7d00000 00:00 0
b7d21000-b7e00000 ---p b7d21000 00:00 0
b7e65000-b7e66000 rwxp b7e65000 00:00 0
b7e66000-b7f8a000 r-xp 00000000 08:01 436359 /lib/libc-2.5.so
b7f8a000-b7f8b000 r-xp 00124000 08:01 436359 /lib/libc-2.5.so
b7f8b000-b7f8d000 rwxp 00125000 08:01 436359 /lib/libc-2.5.so
b7f8d000-b7f91000 rwxp b7f8d000 00:00 0
b7f9b000-b7fa5000 r-xp 00000000 08:01 65295 /usr/lib/libgcc_s.so.1
b7fa5000-b7fa6000 rwxp 00009000 08:01 65295 /usr/lib/libgcc_s.so.1
b7fa6000-b7fa8000 rwxp b7fa6000 00:00 0
b7fa8000-b7fa9000 r-xp b7fa8000 00:00 0 [vdso]
b7fa9000-b7fc3000 r-xp 00000000 08:01 436347 /lib/ld-2.5.so
b7fc3000-b7fc4000 r-xp 00019000 08:01 436347 /lib/ld-2.5.so
b7fc4000-b7fc5000 rwxp 0001a000 08:01 436347 /lib/ld-2.5.so
bfa54000-bfa6a000 rw-p bfa54000 00:00 0 [stack]
Aborted

32 bit environment. No locale set.
Arch Linux 0.8 (Voodoo)
Comment by Andreas Radke (AndyRTR) - Wednesday, 27 December 2006, 17:08 GMT
same here (x86_64). but i don't know why you give the command 2 files. as long as you give only one file it works well. i've never seen this command in that way. maybe you want it like that: fold /etc/host.conf > /etc/host.conf ?
Comment by Henrik Holst (holst) - Friday, 29 December 2006, 13:22 GMT
It does not make sence to try another test. This is how you recreate the bug (with a non-empty host.conf file):
[code]
$ fold /etc/host.conf /etc/host.conf > /dev/null
[/code]
The man page says you can do like this; so fold should not crash.
Comment by Tobias Powalowski (tpowa) - Friday, 29 December 2006, 13:24 GMT
this is a arch 64 bug and not a i686 one assigning to andy again
Comment by Andreas Radke (AndyRTR) - Friday, 29 December 2006, 14:17 GMT
i don't know exactly the usage for this command. but from what i read about it (http://www.computerhope.com/unix/ufold.htm) i guess you don't use the right syntax. or can you explain what the command should do?
Comment by Henrik Holst (holst) - Friday, 29 December 2006, 14:52 GMT
Why don't you use the GNU man page?

The man page of fold command in coreutils:

http://www.mypastebin.com/?code=143889507

It's rather clear that it should support many files.
Comment by Andreas Radke (AndyRTR) - Friday, 16 February 2007, 06:47 GMT
i can still reproduce it. another x86_64 developer doesn't have that bug. can you please try to contact the coreutils developers?

Loading...