Bug 456566 - @INC path too large
@INC path too large
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: perl (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Stepan Kasal
Depends On:
  Show dependency treegraph
Reported: 2008-07-24 14:08 EDT by Jerrad Pierce
Modified: 2009-05-18 16:08 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 489909 (view as bug list)
Last Closed: 2009-05-18 16:08:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
proposed patch (2.37 KB, patch)
2008-08-13 13:46 EDT, Stepan Kasal
no flags Details | Diff

  None (edit)
Description Jerrad Pierce 2008-07-24 14:08:19 EDT
RH compiles perl with a hideously large @INC to allow people upgrading from
ancient package versions to use existing installed modules. This causes everyone
else to experience a performance hit due to the numerous stats involved, as well
as extremely large error messages.

The proper way to handle backwards compatibility is with $PERL5LIB.
This way people who don't need it can cull these superfluous directories
from @INC without having to compile perl from scratch.

It's particularly annoying as the current system hobbles even fresh installs.
Comment 1 Stepan Kasal 2008-08-13 13:41:24 EDT
Thank you for the bug report.
The list of directories is combined from some prefixes and a configuration variable named inc_version_list.  We cannot change this configuration, because we have to maintain backward compatibility.  (Now matter that this "long @INC" does not look very useful, some customer may rely on it.)
Fortunately, perl has a feature which removes from @INC all directories which do not exist.  Relying on this feature, it is sufficient to remove the directories from the rpm, so that they do not exist on usual installation, and they will disappear from the @INC path.
There is one more twist of this issue: RHEL-4 perl.spec contains a patch which removes the feature mentioned above, so that the non-existent directories stay in @INC.  This was probably introduced when perl.spec tried to make sure that all these directories are owned by perl.rpm and added code like
for dir in $(%{new_perl} -e 'print join("\n",@INC)'); do mkdir -p ${RPM_BUILD_ROOT}$dir; done
This patch (named perl-5.8.3-fullinc.patch) was removed when perl was updated to version 5.8.8, so it is not present in RHEL-5 nor recent Fedora releases.

To sum up: if we drop the unfortunate patch and remove the directories from the rpm, the annoyance will be solved, without any adverse effect to backward compatibility.
Comment 2 Stepan Kasal 2008-08-13 13:46:45 EDT
Created attachment 314228 [details]
proposed patch
Comment 3 RHEL Product and Program Management 2008-09-05 13:04:57 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 6 Petr Šplíchal 2009-02-25 09:36:48 EST
Well, the backward compatibility regarding this bug is a big question. Seems to me that this path shortening can really be quite dangerous. What about those modules which have a different version number and thus are placed in the directories to be removed from the @INC path? These will stop to work.

Unfortunately, the proposed patch does not handle this case: For example, the log summarizer for postfix which uses perl-Date-Calc module, on RHEL4 placed in /usr/lib64/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi/Date/Calc.pm stops to work after the upgrade.

# pflogsumm /var/log/maillog 
Can't locate Date/Calc.pm in @INC (@INC contains: /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl .) at /usr/sbin/pflogsumm line 362.
BEGIN failed--compilation aborted at /usr/sbin/pflogsumm line 362.
Comment 11 errata-xmlrpc 2009-05-18 16:08:29 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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