Bug 11768 - bug with bzip2 error code
Summary: bug with bzip2 error code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bzip2
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-05-30 20:34 UTC by mal
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-05-30 20:34:09 UTC
Embargoed:


Attachments (Terms of Use)

Description mal 2000-05-30 20:34:09 UTC
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 14:51:16 UTC
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 15:34:46 UTC
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.