develooper Front page | perl.perl5.porters | Postings from August 2001

[ID 20010801.037] IO::Socket Oddity on Solaris on 5.6.1

Thread Next
From:
Peter Scott
Date:
August 1, 2001 13:14
Subject:
[ID 20010801.037] IO::Socket Oddity on Solaris on 5.6.1
Message ID:
4.3.2.7.2.20010801124906.00adc430@mail.webquarry.com
I get a broken pipe error when creating a socket on perl 5.6.1 on Solaris 
2.5.1. It occurs when I add a timeout to the socket creation.  Found it 
when playing with an LWP script, I isolated it to this:

% perl -MIO::Socket -e 'IO::Socket::INET->new(PeerAddr => 
"ice-www.larc.nasa.gov", PeerPort => 80, Timeout => 180)'

That produces the error 'Broken pipe'. This doesn't:

% perl -MIO::Socket -e 'IO::Socket::INET->new(PeerAddr => "ice-www. 
larc.nasa.gov", PeerPort => 80)'

It's only on that address, BTW - pick another web server and it's fine 
(!).  Also it does not reproduce on Linux (RH 6.2).

Here's my perl config, and I'll follow it with the last steps of a trace (I 
have no idea what's wrong).  It's entirely possible that this machine lacks 
some patch, but it's never showed up before.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
   Platform:
     osname=solaris, osvers=2.5.1, archname=sun4-solaris-2.5.1
     uname='sunos eisws5 5.5.1 generic_103640-19 sun4u sparc sunw,ultra-1 '
     config_args='-de -Dcc=gcc -B/usr/ccs/bin/ -Uusemymalloc 
-Dprefix=/opt/perl -Uinstallusrbinperl -Darchname=sun4-solaris-2.5.1 
-Ubincompat5005'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
     useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
   Compiler:
     cc='gcc -B/usr/ccs/bin/', ccflags ='-I/usr/ets/include ',
     optimize='-O',
     cppflags='-I/usr/ets/include'
     ccversion='', gccversion='2.8.1', gccosandvers='solaris2.5.1'
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=4
     alignbytes=8, usemymalloc=n, prototype=define
   Linker and Libraries:
     ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/ets/lib '
     libpth=/usr/ets/lib /usr/lib /usr/ccs/lib
     libs=-lsocket -lnsl -lgdbm -ldbm -ldb -ldl -lm -lc
     perllibs=-lsocket -lnsl -ldl -lm -lc
     libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
     cccdlflags='-fPIC', lddlflags='-G -L/usr/ets/lib'


Characteristics of this binary (from libperl):
   Compile-time options: USE_LARGE_FILES
   Built under solaris
   Compiled at Jun 11 2001 16:34:33
   @INC:
     /opt/perl/lib/5.6.1/sun4-solaris-2.5.1
     /opt/perl/lib/5.6.1
     /opt/perl/lib/site_perl/5.6.1/sun4-solaris-2.5.1
     /opt/perl/lib/site_perl/5.6.1
     /opt/perl/lib/site_perl
     .


IO::Socket::connect(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Socket.pm:114):
114:                if (!$sel->can_write($timeout)) {
   DB<2> s
IO::Select::can_write(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:112):
112:     my $vec = shift;
   DB<2> n
IO::Select::can_write(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:113):
113:     my $timeout = shift;
   DB<2>
IO::Select::can_write(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:114):
114:     my $w = $vec->[VEC_BITS];
   DB<2>
IO::Select::can_write(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:116):
116:     defined($w) && (select(undef,$w,undef,$timeout) > 0)
117:        ? handles($vec, $w)
118:        : ();
   DB<2> s
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:219):
219:     my $vec = shift;
   DB<2> n
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:220):
220:     my $bits = shift;
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:221):
221:     my @h = ();
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:222):
222:     my $i;
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:223):
223:     my $max = scalar(@$vec) - 1;
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2> n
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:227):
227:       next unless defined $vec->[$i];
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:228):
228:       push(@h, $vec->[$i])
229:          if !defined($bits) || vec($bits, $i - FIRST_FD, 1);
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:225):
225:     for ($i = FIRST_FD; $i <= $max; $i++)
226:      {
   DB<2>
IO::Select::handles(/afs/jpl/rep/f/fil/uai/perl/lib/5.6.1/sun4-solaris-2.5.1/IO/Select.pm:232):
232:     @h;
   DB<2>
Broken pipe



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About