Bug 170088 - bits/resource.ph has syntax errors
bits/resource.ph has syntax errors
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: perl (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
David Lawrence
Depends On:
Blocks: 168429 172256
  Show dependency treegraph
Reported: 2005-10-07 00:47 EDT by Bojan Smojver
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version: RHSA-2005-880
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-12-20 09:30:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bojan Smojver 2005-10-07 00:47:34 EDT
Description of problem:
/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/bits/resource.ph file, as
shipped with the package has syntax errors in lines 15, 17, 19 - 23.

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

How reproducible:

Steps to Reproduce:
1. Include the file in some other Perl (i.e. require 'resource.ph';)
2. Try to run.
3. Get: Compilation failed in require at XXXX.perl line YYY.
Actual results:
Compilation fails due to syntax errors.

Expected results:
The file should be shipped without syntax errors.

Additional info:
Comment 1 Jason Vas Dias 2005-11-01 13:37:09 EST
This problem is not specific to RHEL-4, but occurs with all linux perl versions.

There is no 'resource.ph' - you mean 'sys/resource.ph', which includes 
'bits/resource.ph' .

The include dependencies are:

'sys/resource.ph' -> 'bits/resource.ph' -> 'bits/types.h' -> 'stddef.ph' .

Unfortunately, there is no 'stddef.ph' - there is only 'linux/stddef.ph' .

You can workaround this problem by adding this directory to @INC:
'push @INC, "/usr/lib/perl-${PERL_VERSION}/${ARCH}-linux-thread-multi/linux";
 require "sys/resource.ph";

It appears that the 'linux/' include directory is in the gcc standard 
include path, but not in the perl standard @INC path.

I'll consider adding this directory to the standard @INC path in the next
PERL version.
Comment 2 Bojan Smojver 2005-11-01 14:10:36 EST
I have no idea what all this really means as I'm not really a Perl guy, but
maybe there is a way to fix syntax errors by including different files. Anyway,
the compiler doesn't like lines like this (I picked these from one of my FC4
boxes, but RHEL4 has similar lines):

eval("sub  () { 6; }") unless defined(&);
eval("sub  () { 1; }") unless defined(&);
eval("sub  () { 7; }") unless defined(&);
eval("sub  () { 8; }") unless defined(&);
eval("sub  () { 9; }") unless defined(&);
eval("sub  () { 10; }") unless defined(&);
eval("sub  () { 11; }") unless defined(&);

Basically, it appears that there must be something _after_ sub and _before_ ()
in order for the line to be valid Perl. Like this:

eval("sub RLIMIT_CPU () { 0; }") unless defined(&RLIMIT_CPU);

When I hose the lines with nothing after sub, everything works.

Current Rawhide ( perl-5.8.7-0.5.fc5) doesn't have any of these syntax errors.
The files looks different.
Comment 3 Jason Vas Dias 2005-11-01 14:24:22 EST
OK, sorry, it appears there are 2 problems here :

1. perl-5.8.5's h2ph generates incorrect headers with missing names for
   subroutines, as in :
   eval("sub  () { x; }") unless defined(&);
   should be:
   eval("sub CONST_NAME () { x; }") unless defined(&CONST_NAME);
   This problem is specific to the perl-5.8.5 version in RHEL-4 . 

2. The C-standard headers (eg. stddef.h, stdarg.h, syslimits.h)
   are not being picked  up from the right location on 
   Linux / glibc / gcc systems :


   but instead are being looked for in incorrect locations, eg.
     /usr/include/linux/stddef.h  : stddef.h used by the kernel
     syslimits.h : not found

   resulting in missing include dependencies for all PERL versions on Linux.
Comment 4 Jason Vas Dias 2005-11-01 16:06:43 EST
This bug, which describes problem 1 in comment #3:
> 1. perl-5.8.5's h2ph generates incorrect headers with missing names for
>    subroutines
is a duplicate of upstream an perl bug:
 # 34498 -  h2ph unable to parse definitions inside enumerations
   ( http://rt.perl.org/rt3/Ticket/Display.html?id=34498 )
that is fixed with the h2ph from perl-5.8.7 .
I've generated a patch from perl-5.8.7 to the RHEL-4 5.8.5 h2ph which fixes
this problem, in versions >= perl-5.8.5-17.RHEL4 .
This should be in a RHEL-4 update release shortly.

Problem 2 of comment #3:
> 2. The C-standard headers (eg. stddef.h, stdarg.h, syslimits.h)
>    are not being picked  up

is covered by bug 172236, also to be fixed in perl-5.8.5-17.RHEL4.

Comment 5 Bojan Smojver 2005-11-01 16:54:08 EST
Brilliant. Thanks!
Comment 7 Sean O'Connell 2005-11-28 17:08:23 EST
Is there an ETA for perl-5.8.5-17?
Comment 8 Jason Vas Dias 2005-11-28 17:25:11 EST
(In reply to comment #7)
> Is there an ETA for perl-5.8.5-17?

perl-5.8.5-17.RHEL4 is a candidate for the next RHEL-4 update release (U3).

Meanwhile, it can be downloaded from:

Please try out this version  and let me know of any issues - thanks.
Comment 9 Bojan Smojver 2005-12-01 16:57:40 EST
Sorry, I've been a little lazy on this. Downloading now...
Comment 10 Fedora Update System 2005-12-01 18:56:27 EST
From User-Agent: XML-RPC

perl-5.8.5-18.FC3 has been pushed for FC3, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 11 Bojan Smojver 2005-12-04 18:48:58 EST
The looks good here. No complaints so far.
Comment 14 Red Hat Bugzilla 2005-12-20 09:30:16 EST
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 the 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.