Bug 170088 - bits/resource.ph has syntax errors
Summary: bits/resource.ph has syntax errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: perl
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jason Vas Dias
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 168429 172256
TreeView+ depends on / blocked
 
Reported: 2005-10-07 04:47 UTC by Bojan Smojver
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version: RHSA-2005-880
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-12-20 14:30:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:880 0 normal SHIPPED_LIVE Moderate: perl security update 2005-12-20 05:00:00 UTC

Description Bojan Smojver 2005-10-07 04:47:34 UTC
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):
perl-5.8.5-16.RHEL4

How reproducible:
Always.


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:
N/A

Comment 1 Jason Vas Dias 2005-11-01 18:37:09 UTC
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 19:10:36 UTC
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 19:24:22 UTC
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 :

     /usr/lib/gcc-${arch}-${os}/${gcc-version}/include/

   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 21:06:43 UTC
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 21:54:08 UTC
Brilliant. Thanks!

Comment 7 Sean O'Connell 2005-11-28 22:08:23 UTC
Is there an ETA for perl-5.8.5-17?

Comment 8 Jason Vas Dias 2005-11-28 22:25:11 UTC
(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:
  http://people.redhat.com/~jvdias/perl/RHEL-4

Please try out this version  and let me know of any issues - thanks.

Comment 9 Bojan Smojver 2005-12-01 21:57:40 UTC
Sorry, I've been a little lazy on this. Downloading now...

Comment 10 Fedora Update System 2005-12-01 23:56:27 UTC
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 23:48:58 UTC
The looks good here. No complaints so far.

Comment 14 Red Hat Bugzilla 2005-12-20 14:30:16 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 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.

http://rhn.redhat.com/errata/RHSA-2005-880.html



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