Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 71869 - STRACE has bug for "-i" options
Summary: STRACE has bug for "-i" options
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://sourceforge.net/tracker/index....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-20 11:04 UTC by Bash
Modified: 2005-06-01 10:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
fix (strace-4.5.8-undefIP.patch,656 bytes, patch)
2004-11-20 11:06 UTC, Bash
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bash 2004-11-20 11:04:58 UTC
I've found issue, that fake_execve() called before trace process (child) ready.
It is not important in common use, because fake_execve() just print
pretty formatted line (with argc, argv[] and environ). But if we pass
"-i" arg to strace, fake_execve() -> printleader() -> if(iflag)
->printcall() try to determine "Instruction Pointer" by calling
upeek() -> ptrace(PTRACE_PEEKUSER, ...). And very often (on fast CPU)
ptrace() fail in case that trace process (child) not ready for it, BUT if runs, it produces wrong Inst. Pointer address.

Reproducible: Sometimes
Steps to Reproduce:
$ strace -i cat /dev/null
upeek: ptrace(PTRACE_PEEKUSER,13426,48,0): No such process
[????????] execve("/bin/cat", ["cat", "/dev/null"], [/* 37 vars */]) = 0
...
Comment 1 Bash 2004-11-20 11:06:33 UTC
Created attachment 44376 [details, diff]
fix
Comment 2 Bash 2004-11-20 11:07:02 UTC
Comment on attachment 44376 [details, diff]
fix


My solution is remove fake_execve() function call and insert
kill(getpid(), SIGSTOP) function before execve(TARGET_BIN,....).
Comment 3 SpanKY gentoo-dev 2005-06-01 10:37:37 UTC
they've applied a fix in 4.5.10 upstream ... please re-open if 4.5.11 doesnt
work properly still