Bug 143782 - rpm 4.4.1 - rpmfcClassify: Assertion `ftype != ((void *)0)' failed
rpm 4.4.1 - rpmfcClassify: Assertion `ftype != ((void *)0)' failed
Product: Fedora
Classification: Fedora
Component: file (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2004-12-27 14:30 EST by Robert Scheck
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-07 08:23:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robert Scheck 2004-12-27 14:30:13 EST
Description of problem:
Building of a RPM package using 4.4.1-0.4 from ftp.jbj.org dies 
with the following:

--- snipp ---
Processing files: mod_perl-1.99_19-0
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.28309
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd mod_perl-1.99_19
+ DOCDIR=/var/tmp/mod_perl-root/usr/share/doc/mod_perl-1.99_19
+ export DOCDIR
+ rm -rf /var/tmp/mod_perl-root/usr/share/doc/mod_perl-1.99_19
+ /bin/mkdir -p /var/tmp/mod_perl-root/usr/share/doc/mod_perl-1.99_19
+ cp -pr Changes INSTALL LICENSE README docs /var/tmp/mod_perl-root/usr/share/doc/mod_perl-1.99_19
+ exit 0
error: magic_file(ms, "/var/tmp/mod_perl-root/usr/share/doc/mod_perl-1.99_19/docs/user/handlers/connection_cycle.dia") faileds: gzip compressed data, from Unix
rpmbuild: rpmfc.c:1224: rpmfcClassify: Assertion `ftype != ((void *)0)' failed.
Abgebrochen [means something like 'aborted']
--- snapp ---

'ls -l' to the file:
-rw-r--r--    1 root     root         2312 Nov 29 19:40 /var/tmp/mod_perl-root/usr/share/doc/mod_perl-1.99_19/docs/user/handlers/connection_cycle.dia

'file' to the file:
/var/tmp/mod_perl-root/usr/share/doc/mod_perl-1.99_19/docs/user/handlers/connection_cycle.dia: gzip compressed data, from Unix

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

How reproducible:
Everytime, see below.

Steps to Reproduce:
1. Take mod_perl-1.99_17-1 from Rawhide
2. Bump version tag to _19 and release tag to whatever you like
3. Change Source0's URL, that it matches for -2.0.0-RC2-XMas
4. Add to %setup -q the string "-n %{name}-2.0.0-RC2-XMas" 
5. Try to build the RPM. 
6. Die with the error written above.
Actual results:
No rpm was built.

Expected results:
A rpm should be built.

Additional info:
Hope, you've had nice holidays, jbj ;-)
Comment 1 Robert Scheck 2004-12-27 14:42:08 EST
Oh, I forgot to say, that it seems, that the problem was introduced 
with rpm 4.4.x, because my rebuild using rpm 4.3.x went fine. Hope
that helps you.
Comment 2 Jeff Johnson 2004-12-29 06:38:02 EST
Ptr to *.src.rpm please.
Comment 3 Robert Scheck 2004-12-29 11:15:10 EST
MD5SUM: 1098a7880088a9b4585fb88a42cdd502
Comment 4 Robert Scheck 2005-01-03 08:10:52 EST
[03:26:51] < jbj> rsc: #143782 solved. turns out libmagic equiv of 
file -z is a bit dain bread, nuking MAGIC_COMPRESS fixes mod_perl. 
perhaps connection_cycle.dia needs re-compress. no matter what, 
libmagic is a bit stupid about partial block uncompresses. 
[13:48:57] < jbj> rsc_: rpm-4.4.1 was attempting equivalent of 
file(1) -z to identify what was compressed. doesn't work, don't do 
that was the fix.

Changelog of rpm-4.4.1-0.5 contains:
- revert MAGIC_COMPRESS, real fix is in libmagic (#143782).

So does a bug report for libmagic exist?
Comment 5 Jeff Johnson 2005-01-03 08:45:24 EST
Re-assigned to file.
Comment 6 Jeff Johnson 2005-01-03 08:49:05 EST
file -z .../connection_cycle.dia (from the mod_perl package)
is a reproducer, look for " ... ERROR: ..." in the output.
Comment 7 Radek Vokal 2005-01-05 07:00:36 EST
Well, what kind of files are these? There sth rotten. I've renamed the
files to unzip them. First let's see that the bug is still here

# file *.gz
bucket_brigades.dia.gz:  gzip compressed data, from Unix
connection_cycle.dia.gz: gzip compressed data, from Unix

# file -z *.gz
bucket_brigades.dia.gz:  XML document text (gzip compressed data, from
connection_cycle.dia.gz: ERROR: gzip compressed data, from Unix

And now unzip .. Seems to be broken..

# gunzip connection_cycle.dia.gz
gunzip: connection_cycle.dia.gz: invalid compressed data--crc error
gunzip: connection_cycle.dia.gz: invalid compressed data--length error

Hmm, but I can view the file in midnight commander so I tried

# zcat connection_cycle.dia.gz

some xml stuff, but at the end I can still see this

zcat: connection_cycle.dia.gz: invalid compressed data--crc error
zcat: connection_cycle.dia.gz: invalid compressed data--length error

So writing the data to another file

# zcat connection_cycle.dia.gz > test.dia
zcat: connection_cycle.dia.gz: invalid compressed data--crc error
zcat: connection_cycle.dia.gz: invalid compressed data--length error

Zipping it

# gzip test.dia
# file -z test.dia.gz
test.dia.gz: XML document text (gzip compressed data, was "test.dia",
from Unix)

Here I go, the `file` seems to be fine but the file seems broken to me. 
Comment 8 Robert Scheck 2005-01-28 13:25:26 EST
Rebuilding of MAKEDEV- (from Red Hat Enterprise 
Linux 3 or clones) using rpm-4.4.1-0.7 also fails with the same error, 
but here at the file /var/tmp/MAKEDEV-root/dev/adbmouse :-(
Comment 9 Jeff Johnson 2005-01-28 13:54:23 EST
zcat (from gzip) and zlib are similar but different forms of
compression. Don't be tricked.

You are almost certainly correct that the file is strangely

However,  the real issue is file and -z handling through libmagic, not
the strangely compressed file. file has flip-flopped from using a gzip
pipe to using zlib several times over the years.

zlib is arguably more efficient than a gzip pipe.

And "ERROR" should not be returned in-band within the libmagic buffer
no matter whether gzip pipe or zlib linkage is used by file.

Does that clarify the problem?
Comment 11 Robert Scheck 2005-01-31 11:39:51 EST
Ignore comment #8 please, this is bug #146623 - but with the same
error message.
Comment 12 Radek Vokal 2005-03-07 08:23:55 EST
I think the file output is correct so I don't see a problem here. The
ERROR is returned because the file which it is trying to uncompress is
broken - what kind of output do you expect here while it has to say
that there's sth rotten in the file. 

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