[PATCH] x86_64 strace personality switching

Dmitry V. Levin ldv at altlinux.org
Mon Dec 26 22:20:16 UTC 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20111227/cce76dac/attachment.bin>


More information about the Strace-devel mailing list