Bug 11768 - bug with bzip2 error code
bug with bzip2 error code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: bzip2 (Show other bugs)
6.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-05-30 16:34 EDT by mal
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-30 16:34:09 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 mal 2000-05-30 16:34:09 EDT
There is a bug with exit code in bzip2-0.9.5d-2 (Redhat 6.2)
Create a small file AA  (4 bytes),
and try to tar it to the tape /dev/st1
which does not exists.
tar prints error message (as it should be),
but exits with the code 0, what is incorrect.
It looks like bzip does not catch non-zero exit code of tar.

echo AAA >AA
tar Icvf /dev/st1 AA
tar (grandchild): /dev/st1: Cannot open: No such device
tar (grandchild): Error is not recoverable: exiting now
but the exit code of tar is 0.
This is incorrect.
But when you do tar without bizp2  compression
tar cvf /dev/st1 AA
tar exits with error code 2 as it should be.

Looks like a bug in bzip2 program.
Similar bug was in gzip program.
I was telled it was fixed in gzip 1.3.
Comment 1 Trond Eivind Glomsrxd 2000-05-31 10:51:16 EDT
I get error code 2 with bzip2 as well:

[root@hoser /root]# tar zcvf /dev/st1 AAA
tar: AAA: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
[root@hoser /root]# tar (grandchild): /dev/st1: Cannot open: No such device
tar (grandchild): Error is not recoverable: exiting now

[root@hoser /root]# echo $?
2
[root@hoser /root]# tar Icvf /dev/st1 AAA
tar: AAA: Cannot stat: No such file or directory
tar (grandchild): /dev/st1: Cannot open: No such device
tar (grandchild): Error is not recoverable: exiting now
tar: Error exit delayed from previous errors
[root@hoser /root]# echo $?
2
[root@hoser /root]# tar cvf /dev/st1 AAA
tar: /dev/st1: Cannot open: No such device
tar: Error is not recoverable: exiting now
[root@hoser /root]# echo $?
2
[root@hoser /root]#

I use bzip2 1.0, which is in Rawhide
Comment 2 mal 2000-05-31 11:34:46 EDT
I tried these packages from Rewhide
rpm -q tar gzip
tar-1.13.17-4
gzip-1.3-3
on RedHat 6.2

It does not work. The error code is 0.

1.create a file AAA (you did not create a file in your example)
echo AAA >/tmp/AAA
2. tar it to unexisting tape.
[root@localhost /tmp]# tar zcvf /dev/st1 /tmp/AAA 
tar: Removing leading `/'' from member names
tmp/AAA
tar (grandchild): /dev/st1: Cannot open: No such device
tar (grandchild): Error is not recoverable: exiting now
[root@localhost /tmp]# echo $?
0
[root@localhost /tmp]#

See, error code is 0.

In the same time without a compression
[root@localhost /tmp]# tar cvf /dev/st1 /tmp/AAA 
tar: /dev/st1: Cannot open: No such device
tar: Error is not recoverable: exiting now
[root@localhost /tmp]# echo $?
2
[root@localhost /tmp]# 

See, error code with compression is 0, without compression is 2.
something does not work.

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