From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4 Description of problem: Strace always exits with process status code 0. Instead, strace should propagate the exit or exit_group status code of the process being traced. This would make strace more transparent because 'strace' could be inserted or removed without affecting a parent process which relies on the process status exit code. Here are test cases: -----exit42.S #include <asm/unistd.h> _start: .globl _start movl $42,%ebx movl $__NR_exit,%eax int $0x80 -----exit_group42.S #include <asm/unistd.h> _start: .globl _start movl $42,%ebx movl $__NR_exit_group,%eax int $0x80 ----- $ gcc -o exit42 -nostdlib -nostartfiles exit42.S $ gcc -o exit_group42 -nostdlib -nostartfiles exit_group42.S Version-Release number of selected component (if applicable): strace-4.5.11-1 How reproducible: Always Steps to Reproduce: 1. Compile and run testcases from Description. 2. 3. Actual Results: $ ./exit42 $ echo $? ## '$?' is bash syntax for exit status code of previous process 42 $ strace ./exit42 execve("./exit42", ["./exit42"], [/* 32 vars */]) = 0 _exit(42) = ? $ echo $? 0 ## different from non-strace case $ ./exit_group42 $ echo $? 42 $ strace ./exit_group42 execve("./exit_group42", ["./exit_group42"], [/* 32 vars */]) = 0 exit_group(42) = ? $ echo $? 0 ## different from non-strace case $ Expected Results: The process exit status code under strace should be the same as without strace; in these two cases: 42. Additional info:
*** This bug has been marked as a duplicate of 105371 ***