https://bugzilla.novell.com/show_bug.cgi?id=352419 Summary: strace shows wrong system call Product: openSUSE 10.2 Version: Final Platform: x86-64 OS/Version: openSUSE 10.2 Status: NEW Severity: Normal Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: opensuse.org@contacts.eelis.net QAContact: qa@suse.de Found By: Customer Consider the following small program: #include <stdio.h> #include <unistd.h> int main () { printf("--------------------\n"); __asm__("movl $2, %eax; int $0x80"); printf("[i am %d]\n", getpid()); } When compiled and run with gcc t.c && ./a.out I get: -------------------- [i am 10869] [i am 10868] This is what I would expect, as the assembly code performs a fork() (because 2 is SYS_fork on i386, and from what I understand the "int $0x80" performs an emulated i386 system call). However, when I run strace ./a.out I get: execve("./a.out", ["./a.out"], [/* 81 vars */]) = 0 brk(0) = 0x602000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b039717c000 uname({sys="Linux", node="groen", ...}) = 0 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=218416, ...}) = 0 mmap(NULL, 218416, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b039717d000 close(3) = 0 open("/lib64/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\333"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1595305, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b03971b3000 mmap(NULL, 3412216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b039737e000 fadvise64(3, 0, 3412216, POSIX_FADV_WILLNEED) = 0 mprotect(0x2b03974b7000, 2093056, PROT_NONE) = 0 mmap(0x2b03976b6000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x138000) = 0x2b03976b6000 mmap(0x2b03976bb000, 16632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b03976bb000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b03976c0000 arch_prctl(ARCH_SET_FS, 0x2b03976c06f0) = 0 mprotect(0x2b03976b6000, 12288, PROT_READ) = 0 mprotect(0x600000, 4096, PROT_READ) = 0 munmap(0x2b039717d000, 218416) = 0 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 11), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b039717d000 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 Note how a call to open() is reported instead of a call to fork(). Also note how fork() /is/ executed (we see both "[i am 10873]" and "[i am 10872]"). My guess is that strace thinks it's a call to open() because 2 is SYS_open on x86_64. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.