Bug 982691 - virt-sandbox exit code wraps back to 0 at 256,512 etc.
virt-sandbox exit code wraps back to 0 at 256,512 etc.
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: libvirt-sandbox (Show other bugs)
19
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Daniel Berrange
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-09 11:10 EDT by Martin Jenner
Modified: 2013-07-09 11:15 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-09 11:15:54 EDT
Type: Bug
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 Martin Jenner 2013-07-09 11:10:46 EDT
Description of problem: 

The exit code after running virt-sandbox wraps at number 256,512 etc. back to 0.


Version-Release number of selected component (if applicable):
F19 RC1
kernel-3.9.5-301.fc19.x86_64
libvirt-sandbox-0.2.0-1.fc19.x86_64
libvirt-1.0.5.1-1.fc19.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a test command/script to execute inside the container

# cat <<EOF >/usr/local/bin/exit-code-test.sh 
#!/bin/bash

exit 256
EOF
# chmod 755 /usr/local/bin/exit-code-test.sh

2. run the above command/script using virt-sandbox

# virt-sandbox -c lxc:/// -n container-001 /usr/local/bin/exit-code-test.sh
# echo $?

For my testing I just repeated steps 1 and 2 editing the exit value in script exit-code-test.sh between test runs.


Actual results:
Exit code wraps at 256 and returns value 0

Expected results:
Exit code should not wrap around and return the actual exit code of the command
Comment 1 Daniel Berrange 2013-07-09 11:15:54 EDT
Err, that's nothing todo with libvirt-sandbox. This is simply a UNIX limitation. You can't have any exit code > 255, since only 8 bits are available. You can see this just using bash directly

# bash
$ exit 256
# echo $?
0

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