[Bug 352419] New: strace shows wrong system call
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.
https://bugzilla.novell.com/show_bug.cgi?id=352419 Bernhard Walle <bwalle@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bwalle@novell.com AssignedTo|pth@novell.com |schwab@novell.com -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=352419 User chris@chris-lamb.co.uk added comment https://bugzilla.novell.com/show_bug.cgi?id=352419#c1 Chris Lamb <chris@chris-lamb.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@chris-lamb.co.uk --- Comment #1 from Chris Lamb <chris@chris-lamb.co.uk> 2008-01-11 15:58:40 MST --- Fixed in Debian BTS - http://bugs.debian.org/459820 -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=352419 Philipp Thomas <pth@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|pth@novell.com |bnc-team-screening@forge.pr | |ovo.novell.com -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=352419 Chuanye Han <cyhan@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cyhan@novell.com AssignedTo|bnc-team-screening@forge.pr |stefan.fent@novell.com |ovo.novell.com | -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=352419 User stefan.fent@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=352419#c3 Stefan Fent <stefan.fent@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |opensuse.org@contacts.eelis | |.net --- Comment #3 from Stefan Fent <stefan.fent@novell.com> 2009-03-04 06:00:47 MST --- Adding this patch leads to a strace segfault while following the 32bit child process (strace -f) (BTW, why would you do this?) -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=352419 User opensuse.org@contacts.eelis.net added comment https://bugzilla.novell.com/show_bug.cgi?id=352419#c4 Eelis - <opensuse.org@contacts.eelis.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|opensuse.org@contacts.eelis | |.net | --- Comment #4 from Eelis - <opensuse.org@contacts.eelis.net> 2009-03-04 13:19:22 MST --- (In reply to comment #3)
Adding this patch leads to a strace segfault while following the 32bit child process (strace -f) (BTW, why would you do this?)
I don't have any particular use case for writing programs like the one I mentioned. This bug was discovered in a ptrace supervisor I wrote for a project of mine, and I noticed that strace had the same defect. I simply assumed that the intent was for strace to accurately show the system calls performed for /any/ program, hence this report. :-) -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=352419 Stefan Fent <stefan.fent@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- 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.
participants (1)
-
bugzilla_noreply@novell.com