Front page | perl.perl5.porters |
Postings from December 2010
From: H.Merijn Brand
December 17, 2010 03:08
Message ID: firstname.lastname@example.org
After way too many hours of debugging, I finally found - with a little
help from the postgres developers - a real annoying issue with sockets
on HP-UX 11.31, which I think is worthwhile sharing with you as it can
or might happen on other architectures as well.
Unix knows about two types of sockets ...
Default DSB sockets:
int getsockopt (
UNIX 03 Only (X/Open Sockets):
int getsockopt (
void *__restrict optval,
socklen_t *__restrict optlen
Some background information can be found in 'man 7 xopen_networking:
xopen_networking - X/Open Networking Interfaces
X/Open has defined Sockets and IP Address Resolution interfaces in
X/Open CAE Specification, Networking Services, Issue 4 (UNIX 95),
X/Open CAE Specification, Networking Services, Issue 5 (UNIX 98), and
The Single UNIX Specification, Version 3, System Interfaces (UNIX 03).
X/Open has also defined XTI in X/Open CAE Specification, Networking
Services, Issue 4 (UNIX 95) and X/Open CAE Specification, Networking
Services, Issue 5 (UNIX 98). Beginning in UNIX 03, XTI is no longer
part of The Single UNIX Specification.
For more information on the specifications or a detailed description
of the X/Open Networking Interfaces, please refer to the above
specifications at The Open Group website, http://www.opengroup.org.
Prior to HP-UX 11i v3, HP-UX is certified to UNIX 95 on PA-RISC and
Integrity systems. Beginning with HP-UX 11i v3, HP-UX is certified to
UNIX 95 on PA-RISC systems and to UNIX 95 and UNIX 03 on Integrity
Now for the problem ...
Perl by default uses the default BSD sockets if nothing is specified to
do different. All tests pass, and everything works fine, as all
compiled perl modules will use the same default BSD sockets. Until ...
DBD::Pg starts failing to connect, whereas postgres' own test suite
passes all tests. What happened?
Postgres build process has put two extra defines in a template for
HP-UX, that makes the build process use the xopen socket system. Now
libpg.so expects xopen calls, and perl doesn't. Bang!
I've just rebuilt perl-5.12.2 with those extra requirements and all
tests passed. I will now install all the modules I also installed on
5.10.1 and test if everything still works. If so, and DBD::Pg will now
also pass (as well as all my other DBD's, like DBD::Oracle for which I
fear the worst), I will most likely apply a patch to hints/hpux.sh to
make xopen sockets the default on HP-UX 11.31 and up.
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.3 and AIX 5.2 and 5.3.
by H.Merijn Brand