Package: strace
Version: 4.5.14-2
Severity: normal

-- BEGIN TESTCASE PROGRAM --

#include <stdio.h>
#include <unistd.h>

int main ()
{
 printf("--------------------\n");
 __asm__("movl $2, %eax; int $0x80");
 printf("[i am %d]\n", getpid());
 return 0;
}

-- END TESTCASE PROGRAM --

The testcase code executes fork() by calling it directly. That is,
putting 2 (SYS_fork on i386) into eax and doing int 0x80. Let's see how
this runs on amd64:

--------------------
[i am 10869]
[i am 10868]

Yep, forks. Now let's see what strace tells about it:

<snip>
write(1, "--------------------\n", 21--------------------
)  = 21
open(umovestr: Input/output error
0x1, O_WRONLY|0x14[i am 10873]
)                = 10873
--- SIGCHLD (Child exited) @ 0 (0) ---
getpid()                                = 10872
write(1, "[i am 10872]\n", 13[i am 10872]
)          = 13
exit_group(13)                          = ?
Process 10872 detached


The heading line is printed, then there's an open() printed instead of a
fork, yet it did fork.

Possible cause: 2 is SYS_fork on i386, and this int 0x80 is i386 way of
syscalling. amd64 way is SYSCALL orsomethingicantremember, and 2 is
SYS_open on amd64. I don't know whether strace is confused, or whether
ptrace() gives out something silly.





-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-amd64
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages strace depends on:
ii  libc6                  2.3.6.ds1-13etch4 GNU C Library: Shared libraries

strace recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to