Bug 1201630 - File fails with some jpg files
Summary: File fails with some jpg files
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: 21
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2015-03-13 07:05 UTC by nvwarr
Modified: 2015-06-30 00:03 UTC (History)
3 users (show)

Fixed In Version: file-5.22-4.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-06-25 08:25:03 UTC
Type: Bug

Attachments (Terms of Use)

Description nvwarr 2015-03-13 07:05:59 UTC
Description of problem:

With some .jpg files, file gives an error "name use count (30) exceeded"

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

 file-5.22-2.fc21.x86_64 (Fedora 21 updates)
 file-5.22-2.fc22.x86_64 (Fedora 22 alpha)

have the problem, but

 file-5.19-7.fc21.x86_64 (Fedora 21 without updates)

does not. So this is a regression in Fedora 21, caused by the update.

How reproducible:


Steps to Reproduce:
1. wget 'http://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Apollo_11_Launch2.jpg/192px-Apollo_11_Launch2.jpg'

2. file 192px-Apollo_11_Launch2.jpg

Actual results:

file returns:
"192px-Apollo_11_Launch2.jpg: ERROR: JPEG image data, JFIF standard 1.01, resolution (DPI), density 300x300, segment length 16, baseline, precision 8, 192x240, frames 3, comment: "File source: http://commons.wikimedia.org/wiki/File:Apollo_11_", baseline, precision 8, 192x240, frames 3name use count (30) exceeded"

and returns an error code.

Expected results:

file-5.19-7.fc21.x86_64 returns:
"192px-Apollo_11_Launch2.jpg: JPEG image data, JFIF standard 1.01, comment: "File source: http://commons.wikimedia.org/wiki/File:Apollo_11_""

and no error code.

Additional info:

Increasing the value in the line:

#define FILE_NAME_MAX                   30

in src/file.h to something larger, seems to work around the problem.

Note, that it is not the length of the filename, which triggers this message. You can rename it to 1.jpg and still you still get the error.

Building an rpm package, which includes an image like this fails with a message "Recognition of file" followed by the name and the message produced by file. As a result, packages which built successfully before the update to Fedora 21, now fail to build. Fedora 22 (alpha) also has the same problem.

Comment 1 Gwyn Ciesla 2015-03-27 15:02:35 UTC
This is causing FTBFS for pingus, on the file /usr/share/pingus/images/textures/easter_sky.jpg

Comment 2 nvwarr 2015-03-27 15:29:33 UTC
Jon, the problem is also in Fedora 22 (alpha), but I don't see how to have two versions and it seems silly to have two bug reports filed for the same bug.

Comment 3 Gwyn Ciesla 2015-03-27 15:32:02 UTC
I changed it to 21 because it affects that and all higher versions.  If it's found to affect f20 it should be changed to that.

Comment 4 nvwarr 2015-04-22 09:31:56 UTC
The problem is still there with fedora 22 (beta).

Comment 5 Nils Philippsen 2015-06-18 12:43:11 UTC
I've dug into this a little and found that two upstream commits fix the issue when applied to our 5.22 package. These are from the github mirror of upstream CVS -- https://github.com/file/file:

commit 78c2b81ccb511a740049ffe8ca5410433aae7d4e
Author: Christos Zoulas <christos@zoulas.com>
Date:   Fri Jan 2 21:29:39 2015 +0000

    Bug + portability fixes from the NetBSD build.

commit 9f0601f3c03ffc561a2638c35eaf24308c7b3a72
Author: Christos Zoulas <christos@zoulas.com>
Date:   Fri Jan 2 22:40:27 2015 +0000

    Explain recursion better and avoid double recursion in the masked entries

Incidentally, the commits are the two that immediately follow the upstream release of file-5.22 (tag FILE5_22).

Comment 6 Fedora Update System 2015-06-22 06:13:40 UTC
file-5.22-4.fc22 has been submitted as an update for Fedora 22.

Comment 7 Fedora Update System 2015-06-22 06:25:34 UTC
file-5.22-4.fc21 has been submitted as an update for Fedora 21.

Comment 8 Fedora Update System 2015-06-23 09:15:09 UTC
Package file-5.22-4.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing file-5.22-4.fc22'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 9 nvwarr 2015-06-24 06:46:28 UTC
This update fixes the problem. Thanks for your fast response.

Comment 10 Fedora Update System 2015-06-25 08:25:03 UTC
file-5.22-4.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2015-06-30 00:03:23 UTC
file-5.22-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

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