Bug 189663 - pr with -m option and tab in file causes abort
Summary: pr with -m option and tab in file causes abort
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils   
(Show other bugs)
Version: 5
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2006-04-22 11:08 UTC by Andrew Kroeger
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: coreutils-5.95-1.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-27 01:38:39 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
backtrace and memory map generated before abort (2.95 KB, text/plain)
2006-04-22 11:08 UTC, Andrew Kroeger
no flags Details

Description Andrew Kroeger 2006-04-22 11:08:34 UTC
Created attachment 128112 [details]
backtrace and memory map generated before abort

Comment 1 Andrew Kroeger 2006-04-22 11:08:34 UTC
Description of problem:
With environment variable LANG=en_US.UTF-8 and the pr command with the "-m"
option, if one of the files to be merged contains a tab character, glibc
generates the error "*** glibc detected *** pr: free(): invalid next size
(fast): 0x000000000050e070 ***" and pr aborts.  Note that with LANG=C, the error
does not occur.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. echo -e "\t" > X
2. cat /dev/null > Y
3. pr -m X Y
Actual results:
pr generates output and aborts while cleaning up.  The output generated before
the abort appears to be correct.  I will provide backtrace and memory map as an

Expected results:
pr execution completes successfully without aborting and generates the expected
merged output.

Additional info:
- I am running with all updates released as of 21-Apr-2006.

- Using the following steps (files without a tab character) works as expected:
1. echo "A" > X
2. echo "B" > Y
3. pr -m X Y

- I traced the cause of the error to the "free (clump_buff);" call on line 3100
of coreutils-5.93/src/pr.c, but clump_buff is not NULL at that point.

- Looking further into the pr.c code, I saw interaction with the clump_buff
buffer that is apparently designed to work with multi-byte characters.  That led
to the discovery that LANG=en_US.UTF-8 causes the error but LANG=C works as

Comment 2 Tim Waugh 2006-05-15 13:50:40 UTC
Fixed in CVS.

Comment 3 Tim Waugh 2006-05-16 13:26:50 UTC
Please try this test update:


Does that fix the problem for you?

Comment 4 Andrew Kroeger 2006-05-16 14:39:44 UTC
Yes, the update solves the problem.

Comment 5 Andrew Kroeger 2007-01-27 01:38:39 UTC
Not sure of the Bugzilla protocol -- I couldn't find any information on
reporters closing their own bugs.  Please e-mail me if I'm not supposed to do this.

Fixed for me in coreutils-5.95-1.1 -- Apparently another fix was made to pr for
multibyte locales in coreutils-5.95-1.3

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