fake_execve() called before trace process (child) ready (strace-4.5.8, LINUX(#ifndef USE_PROCFS))

Vasya Pupkin ptushnik at gmail.com
Thu Nov 18 06:44:03 UTC 2004


   Hi All,
 
  I'v 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.
 
 $ strace -i cat /dev/null
 upeek: ptrace(PTRACE_PEEKUSER,13426,48,0): No such process
 [????????] execve("/bin/cat", ["cat", "/dev/null"], [/* 37 vars */]) = 0
 
My solution is remove fake_execve() function call and insert
kill(getpid(), SIGSTOP) function before execve(TARGET_BIN,....).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strace-4.5.8-undefIP.patch
Type: application/octet-stream
Size: 656 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20041118/c30b7914/attachment.obj>


More information about the Strace-devel mailing list