Bug 2297 - sys/socket.ph croaks
sys/socket.ph croaks
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
5.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Crutcher Dunnavant
:
: 4183 4633 7676 8575 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-04-20 20:06 EDT by mcr
Modified: 2008-05-01 11:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-18 15:38:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mcr 1999-04-20 20:06:05 EDT
The definitions in /usr/include/socketbits.h that say things
like:
  SOCK_STREAM = 1,              /* Sequenced, reliable,
connection-based
                                   byte streams.  */
#define SOCK_STREAM SOCK_STREAM

 completely upset perl's h2ph, which when you distribute
the resulting garbage causes anything that does require
"sys/socket.ph" to barf.
This is both with:
[root@venus include]# rpm -qf /usr/include/socketbits.h
glibc-devel-2.0.5c-10
phobos-[~/.vnc] mcr 144 %rpm -qf /usr/include/socketbits.h
glibc-devel-2.0.6-9

but, since this file was generated during RPM build, the
version that I have is not relevant.
Specifically, this causes vncserver to go into an infinite
loop and consume all available memory.
This is also a problem in perl-5.004m7-1.i386.rpm and
perl-5.004m4-1.
The fixed socketbits.h file would be attached if I didn't
have to use this silly web interface.
Comment 1 Jeff Johnson 1999-04-21 12:14:59 EDT
Reply to this message with the fixed socketbits.h and neither
of us has to use this silly web interface :-)
Comment 2 Cristian Gafton 1999-08-29 22:26:59 EDT
*** Bug 4633 has been marked as a duplicate of this bug. ***

This problem has been noted in a couple of other bug reports
but they were for RH5.2 or not specific to this problem.

H2ph cannot handle the way that glibc embeds defines inside
enumerations. This code snippet from <bits/socket.h> shows
the cause of the problem:

enum __socket_type
{
  SOCK_STREAM = 1,              /* Sequenced, reliable,
connection-based
                                   byte streams.  */
#define SOCK_STREAM SOCK_STREAM
  SOCK_DGRAM = 2,               /* Connectionless,
unreliable datagrams
                                   of fixed maximum length.
*/

Somehow, h2ph either misses the SOCK_STREAM = 1 or overrides
it with #define SOCK_STREAM SOCK_STREAM.  This causes the
subsequent bits/socket.ph to have the follow function:

eval 'sub SOCK_STREAM () { &SOCK_STREAM;}' unless
defined(&SOCK_STREAM);

Which is obviously wrong and causes an infinite loop to
occur.  With some programs (aub was the only one I
explicitly tested), this causes perl eat memory and
eventually lock up the machine.

A brief glance at the srpm in rawhide shows that no patch
has been applied to h2ph so it probably won't fix this
problem.
Comment 3 Jeff Johnson 2000-01-15 10:14:59 EST
*** Bug 7676 has been marked as a duplicate of this bug. ***
Comment 4 Jeff Johnson 2000-01-15 10:15:59 EST
*** Bug 4183 has been marked as a duplicate of this bug. ***
Comment 5 Jeff Johnson 2000-01-18 15:38:59 EST
*** Bug 8575 has been marked as a duplicate of this bug. ***
Comment 6 Nalin Dahyabhai 2000-08-10 19:03:11 EDT
The current Raw Hide perl defines this in socket.ph:
	eval 'sub SOCK_STREAM () {1;}' unless defined(&SOCK_STREAM);

This perl script:
	require "asm/socket.ph";
	print SOCK_STREAM();
now prints "1".

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