From: Dmitry V. L. <ld...@al...> - 2011-12-26 22:20:26
|
Hi, On Fri, Apr 29, 2011 at 12:13:14AM -0400, Michael A Fetterman wrote: > strace on x86_64 sometimes gets confused by interrupted system calls. > This happens routinely when tracing a large tree of processes. > > You get things like this: > > 1405 vfork( <unfinished ...> > <various output from other processes omitted> > 1405 <... vfork resumed> ) = 1406 > 1405 close(6) = 0 > 1405 read(5, <unfinished ...> > <various output from other processes omitted> > 1405 <... close resumed> ) = 38 > > Note that strange "unfinished read" which is "resumed" as a close() syscall !! > > What's going on? > Here's a big hint: > In 32-bit mode, the "read" syscall is sysycall #3. > In 64-bit mode, the "close" syscall is syscall #3. > > Process 1405 was a 32-bit process. > In between the "unfinished read" and the "resumed close" there was other output, > some of which was the handling of a 64-bit process's syscall. > That caused the syscall "personality" in strace to switch to 64-bit, and nothing > ever switched it back. Michael, thanks for reporting this issue, and sorry for long delay - the message was accidentally overlooked. > The fix is below... Unfortunately, that patch no longer applies to the current HEAD. I've prepared a new fix: http://strace.git.sourceforge.net/git/gitweb.cgi?p=strace/strace;a=commitdiff;h=v4.6-179-ga5a839a Branch ldv/master also has one more fix for x86 support on x86-64. Please give it a try. -- ldv |