Bug 429588 - printf truncates output when followed by execl
Summary: printf truncates output when followed by execl
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 8
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-21 20:30 UTC by Magnus Fromreide
Modified: 2008-01-22 10:30 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-22 10:30:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Example that demonstrates the bug (11.27 KB, text/plain)
2008-01-21 20:32 UTC, Magnus Fromreide
no flags Details

Description Magnus Fromreide 2008-01-21 20:30:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071128 Iceweasel/2.0.0.6;Firefox/2.0.0.6 (Debian-2.0.0.11-1)

Description of problem:
When I call execl right after printf and write a big chunk of text through printf then the printf call get truncated.

Version-Release number of selected component (if applicable):
glibc-2.7-2 kernel-2.6.23.9-85.fc8

How reproducible:
Always


Steps to Reproduce:
1. make libc-bug
2. strace -e write ./libc-bug 2>&1 | sed -e 's/\(\.\.\., [1-9][0-9]*\).*\() = [1-9][0-9]*\)$/\1 \2/g' | head -4

(The strace is only there to make the problem more visible, the bug happens without it as well)

Actual Results:
I get the following output:

write(1, "Starting \"exec ls -l /usr/share/"..., 1024 ) = 1024
write(1, "heme.elc /usr/share/emacs/22.1/l"..., 10240 ) = 10240
write(2, "ls: ", 4ls: )                     = 4
write(2, "cannot access /usr/share/emacs/2"..., 54 ) = 54


Expected Results:
I should get the following output: (This is the output of make libc-bug CFLAGS=-DNOBUG run throug the result script)

write(1, "Starting \"exec ls -l /usr/share/"..., 1024 ) = 1024
write(1, "heme.elc /usr/share/emacs/22.1/l"..., 10240 ) = 10240
write(1, "lc /usr/share/emacs/22.1/lisp/vt"..., 158lc /usr/share/emacs/22.1/lisp/vt-control.elc /usr/share/emacs/22.1/lisp/x-dnd.elc /usr/share/emacs/22.1/lisp/xml.elc /usr/share/emacs/22.1/lisp/xt-mouse.elc"
) = 158


Additional info:

Comment 1 Magnus Fromreide 2008-01-21 20:32:26 UTC
Created attachment 292409 [details]
Example that demonstrates the bug


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