Bug 491596
Summary: | libmagic does not recognize pcf.gz files as font files | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Nicolas Mailhot <nicolas.mailhot> | ||||
Component: | rpm | Assignee: | Panu Matilainen <pmatilai> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | low | ||||||
Version: | rawhide | CC: | behdad, dnovotny, ffesti, fonts-bugs, jnovy, pmatilai, richard | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | 491510 | Environment: | |||||
Last Closed: | 2009-03-23 15:44:11 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 446451, 491510 | ||||||
Attachments: |
|
Description
Nicolas Mailhot
2009-03-23 08:40:22 UTC
To be exact, the issue here is that libmagic does recognize pcf.gz files correctly *if* MAGIC_COMPRESS flag is used, but the last I tried it in early February caolan said he started getting "cannot create pipe (Too many open files)" errors from magic_file() from within rpm on openoffice.org build. Didn't have a chance to investigate properly at that time so I just flipped it back to not using MAGIC_COMPRESS which "fixed" the issue. Looking it a bit more now, it seems that it's .zip files which cause fd leakage in libmagic (4.x and 5.0), other forms of compression seem to be ok. I should have a reproducer case for you shortly.. Created attachment 336274 [details]
Plug fd leak from pipe()
Ok, the issue is easily reproducable with just file(1) itself, any .zip file seems to do and run "valgrind --track-fds=yes file -z <zipfile>".
For example:
[pmatilai@localhost ~]$ valgrind --track-fds=yes file -z /usr/lib64/openoffice.org/basis3.0/share/config/images.zip
==11616== Memcheck, a memory error detector.
==11616== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==11616== Using LibVEX rev 1884, a library for dynamic binary translation.
==11616== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==11616== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
==11616== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==11616== For more details, rerun with: -v
==11616==
/usr/lib64/openoffice.org/basis3.0/share/config/images.zip: PNG image, 16 x 16, 8-bit/color RGBA, non-interlaced (Zip archive data, at least v2.0 to extract)
==11616==
==11616== FILE DESCRIPTORS: 4 open at exit.
==11616== Open file descriptor 4:
==11616== at 0x3E20AD8BD7: pipe (in /lib64/libc-2.9.so)
==11616== by 0x4C2F882: file_zmagic (compress.c:383)
==11616== by 0x4C34DA3: file_buffer (funcs.c:206)
==11616== by 0x4C272C6: file_or_fd (magic.c:357)
==11616== by 0x401228: process (file.c:431)
==11616== by 0x401CDB: main (file.c:343)
==11616==
The attached one-liner seems to be sufficient to fix, but check by yourself, I'm recovering from a nasty stomach flu and not feeling exactly bright and sharp atm...
hello Panu, thanks for the patch, I checked it and it seems to work; if I add it to the next rawhide build of libmagic, can I close this bug as RAWHIDE? Just toss this back to rpm once libmagic is fixed, I'll still need to enable the compress bit on rpm side of things before this is resolved. OK, the patch is added in file-5.00-5.fc11, so I'll reassign this... Okay, looking into compressed files re-enabled in rpm-4.7.0-0.beta1.6.fc11. Thanks Daniel for fixing these so quickly. |