Bug 429588 - printf truncates output when followed by execl
printf truncates output when followed by execl
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-01-21 15:30 EST by Magnus Fromreide
Modified: 2008-01-22 05:30 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-22 05:30:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Magnus Fromreide 2008-01-21 15:30:54 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20071128 Iceweasel/;Firefox/ (Debian-

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-

How reproducible:

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 15:32:26 EST
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.