Bug 628213 - tac has a double-free bug (input line longer than 16KiB)
Summary: tac has a double-free bug (input line longer than 16KiB)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-28 16:42 UTC by Jim Meyering
Modified: 2013-03-13 20:41 UTC (History)
4 users (show)

Fixed In Version: coreutils-8.4-9.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-19 07:13:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jim Meyering 2010-08-28 16:42:26 UTC
Description of problem:
tac aborts due to a double free -- but only when an input line is longer than 16KiB

Steps to Reproduce:
1.valgrind tac <(printf %0$((2**14 + 1))d 0) > /dev/null
2.
3.
  
Actual results:
     Invalid free() / delete / delete[]
        at 0x4A04D72: free (vg_replace_malloc.c:325)
        by 0x402294: main (tac.c:669)
      Address 0x4c30040 is 0 bytes inside a block of size 16,388 free'd
        at 0x4A05255: realloc (vg_replace_malloc.c:476)
        by 0x4117B8: xrealloc (xmalloc.c:57)
        by 0x401A68: tac_seekable (tac.c:319)
        by 0x402379: main (tac.c:515)


Without valgrind, I get a backtrace, then this:

   zsh: abort (core dumped)  tac <(printf %0$((2**14 + 1))d 0) > /dev/null


Expected results:
  no double free/abort

Additional info:
  patch posted at http://bugs.debian.org/594666#10

Comment 1 Ondrej Vasik 2010-08-28 22:11:57 UTC
Thanks for heads-up, Jim.

Comment 2 Ondrej Vasik 2010-08-31 12:01:30 UTC
Built in rawhide as coreutils-8.5-5.fc15.

Comment 3 Fedora Update System 2010-10-01 11:53:17 UTC
coreutils-8.4-9.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/coreutils-8.4-9.fc13

Comment 4 Fedora Update System 2010-10-05 09:37:30 UTC
coreutils-8.4-9.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update coreutils'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/coreutils-8.4-9.fc13

Comment 5 Fedora Update System 2010-10-19 07:13:01 UTC
coreutils-8.4-9.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.