RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2120692 - speedup magic matching
Summary: speedup magic matching
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: file
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Vincent Mihalkovič
QA Contact: Karel Volný
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-23 14:38 UTC by Vincent Mihalkovič
Modified: 2022-11-15 13:22 UTC (History)
5 users (show)

Fixed In Version: file-5.39-10.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 11:23:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-132000 0 None None None 2022-08-23 14:45:34 UTC
Red Hat Product Errata RHBA-2022:8406 0 None None None 2022-11-15 11:23:29 UTC

Description Vincent Mihalkovič 2022-08-23 14:38:52 UTC
From https://mailman.astron.com/pipermail/file/2022-March/000685.html:

rpm(1) and rpmlint(1) and probably other applications are using
libmagic to mass-determine the filetype
of files to process into a package. While looking at that, I noticed
that libmagic is quite slow when
it is processing large text-like files. This is because of many
complicated regexps being processed,
and the regexes are compiled repeatedly. regexp compilation is very
time consuming compared to regexp matching,
so it helps to do that only once and cache the result for further processing.

On a 64bit host this adds about 200kb of RAM usage, but it improves
matching speed by factor 2 - 4, which
is very noticeable when processing a larger directory of files.

follow-ups:
(0) https://mailman.astron.com/pipermail/file/2022-March/000685.html
(0) https://github.com/file/file/commit/4c8a4d8dbab1e73bfb30e391dcec49fcf269f84
    (0.1)  https://mailman.astron.com/pipermail/file/2022-March/000705.html
    (0.1) https://github.com/file/file/commit/7d438e28c16773e28a3707935c8e5d9927a515a7
    (0.2) https://mailman.astron.com/pipermail/file/2022-April/000718.html
    (0.2) https://github.com/file/file/commit/d1a00ae92b2cf09298615cf3aba474d8fec7380f
    (0.3) https://mailman.astron.com/pipermail/file/2022-April/000720.html
    (0.3) https://github.com/file/file/commit/4254a0afecfd2ae200c694dfcf93f4b4ac21652e

(1) https://mailman.astron.com/pipermail/file/2022-March/000688.html
(1) https://github.com/file/file/commit/a4b3abc4104d8a4eeb84a6242f2f1a830204a539
(2) https://mailman.astron.com/pipermail/file/2022-March/000693.html
(2) https://github.com/file/file/commit/d17d8e9ff8ad8e95fdf66239ccdcc2133d1ce5ce
(3) https://mailman.astron.com/pipermail/file/2022-March/000684.html
(3) https://github.com/file/file/commit/14b5d7aa0b55275969809fdf84e8a8caee857c0f

Version-Release number of selected component (if applicable):
file-5.39-8.el9

All this changes are already in fedora-37 from file-5.42-4.fc37

This Bugzilla was created to ensure backporting of these commits into RHEL-9.1.

Comment 9 errata-xmlrpc 2022-11-15 11:23:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (file bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8406


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