Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 456566 - @INC path too large
Summary: @INC path too large
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: perl
Version: 4.8
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Stepan Kasal
QA Contact: BaseOS QE
Depends On:
TreeView+ depends on / blocked
Reported: 2008-07-24 18:08 UTC by Jerrad Pierce
Modified: 2009-05-18 20:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 489909 (view as bug list)
Last Closed: 2009-05-18 20:08:29 UTC
Target Upstream Version:

Attachments (Terms of Use)
proposed patch (deleted)
2008-08-13 17:46 UTC, Stepan Kasal
no flags Details | Diff

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0961 normal SHIPPED_LIVE perl bug fix update 2009-05-18 13:31:22 UTC

Description Jerrad Pierce 2008-07-24 18:08:19 UTC
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 17:41:24 UTC
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 17:46:45 UTC
Created attachment 314228 [details]
proposed patch

Comment 3 RHEL Product and Program Management 2008-09-05 17:04:57 UTC
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 14:36:48 UTC
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/ stops to work after the upgrade.

# pflogsumm /var/log/maillog 
Can't locate Date/ 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 20:08:29 UTC
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.