Bug 72986 - file command hangs on empty gzipped files
Summary: file command hangs on empty gzipped files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: file
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Martin Bacovsky
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-29 18:19 UTC by P Fudd
Modified: 2007-04-18 16:46 UTC (History)
0 users

Fixed In Version: 4.17-6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-03 16:07:12 UTC
Embargoed:


Attachments (Terms of Use)
Reports compressed empty files as 'empty', not 'data' (619 bytes, patch)
2002-10-29 03:37 UTC, P Fudd
no flags Details | Diff

Description P Fudd 2002-08-29 18:19:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.19-rc3 i686)

Description of problem:
If you try to run the 'file -z' command on an empty file that's been gzipped,
file locks up.

Version-Release number of selected component (if applicable):
file-3.37-5

How reproducible:
Always

Steps to Reproduce:
1.touch emptyfile
2.gzip emptyfile
3.file -z emptyfile.gz
	

Actual Results:  The command line didn't come back.  ps shows that gzip is a
zombie, but file isn't paying attention.

Expected Results:  It should have said:
emptyfile.gz: empty (gzip compressed data, deflated, original filename,
`emptyfile', last modified: Thu Aug 29 11:05:18 2002, os: Unix)

Additional info:

Actually, this happens with any file smaller than 73 bytes and then gzipped.
 dd if=/usr/share/dict/words of=hello count=1 bs=72 ; gzip hello ; file -z
hello.gz

Comment 1 Trond Eivind Glomsrxd 2002-08-30 20:09:41 UTC
Reproduced. Only happens with -z...

Comment 2 Jeff Johnson 2002-10-27 15:50:08 UTC
Fixed in file-3.39-1:	
	bash$ touch xxx
	bash$ gzip xxx
	bash$ file -z xxx.gz 
	xxx.gz: data (gzip compressed data, was "xxx", from Unix)
	bash$ file --version
	file-3.39
	magic file from /usr/share/magic
	bash$ rpm -q file
	file-3.39-1


Comment 3 P Fudd 2002-10-28 01:25:27 UTC
Er, shouldn't it say 'xxx.gz: empty (gzip compressed data, was "xxx", from Unix)'

Comment 4 Jeff Johnson 2002-10-28 13:21:04 UTC
Probably. The bug was that "file -z" hung, however.

Comment 5 P Fudd 2002-10-29 03:37:07 UTC
Created attachment 82505 [details]
Reports compressed empty files as 'empty', not 'data'

Comment 6 P Fudd 2002-10-29 03:38:43 UTC
I've included a patch to fix the 'xxx.gz: data (gzip compressed data, was "xxx",
from Unix)' problem.  It now reports 'empty', not 'data' in the case of empty files.

Comment 7 P Fudd 2005-07-06 23:12:10 UTC
This bug is still present in FC4.

Comment 8 Martin Bacovsky 2006-08-03 16:07:12 UTC
Bug was caused by adding '\0' to content after decompression, so content was
never empty. Fixed.


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