Bug 163613 - exit, exit_group process status code not propagated
exit, exit_group process status code not propagated
Status: CLOSED DUPLICATE of bug 105371
Product: Fedora
Classification: Fedora
Component: strace (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-19 10:39 EDT by John Reiser
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-07-19 17:12:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Reiser 2005-07-19 10:39:17 EDT
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 17:12:00 EDT

*** 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.