Bug 163613 - exit, exit_group process status code not propagated
Summary: exit, exit_group process status code not propagated
Keywords:
Status: CLOSED DUPLICATE of bug 105371
Alias: None
Product: Fedora
Classification: Fedora
Component: strace
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Roland McGrath
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-19 14:39 UTC by John Reiser
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-07-19 21:12:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Reiser 2005-07-19 14:39:17 UTC
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:

Comment 1 Roland McGrath 2005-07-19 21:12:00 UTC

*** This bug has been marked as a duplicate of 105371 ***


Note You need to log in before you can comment on or make changes to this bug.