Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get IO::Socket::IP into core for seamless v4/v6 support #12707

Closed
p5pRT opened this issue Jan 17, 2013 · 46 comments
Closed

Get IO::Socket::IP into core for seamless v4/v6 support #12707

p5pRT opened this issue Jan 17, 2013 · 46 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Jan 17, 2013

Migrated from rt.perl.org#116433 (status was 'resolved')

Searchable as RT116433$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 17, 2013

From @wolfsage

Created by wolfsage@gmail.com

There've been efforts to get IO​::Socket​::IP into the core distribution to
replace IO​::Socket​::INET, but they've stalled a bit.

Doing this would allow IPv4 and IPv6 support to be shipped with Perl.

I believe that this is a good idea, and in #p5p we came up with the
following plan​:

1. Encourage people to switch to IO​::Socket​::IP now
2. Branch Blead, test core Perl with an IO​::Socket​::IP drop-in replacement
of IP​::Socket​::INET
3. Once 2 is complete, Smoke CPAN against the changes
4. Evaluate results. Do most (all) things work? Will patches fix a few
modules if broken?
5. If results are good, get IO​::Socket​::IP into the core distribution,
along side IO​::Socket​::INET
6. Encourage people to switch to IO​::Socket​::IP, this will carry more wait
since it's in core, maybe.
7. Eventually, deprecate and evict IO​::Socket​::INET from the core
distribution.

Perl Info

Flags:
    category=library
    severity=low

Site configuration information for perl 5.10.1:

Configured by Debian Project at Fri Apr 22 18:29:38 UTC 2011.

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

  Platform:
    osname=linux, osvers=2.6.24-28-server,
archname=i486-linux-gnu-thread-multi
    uname='linux roseapple 2.6.24-28-server #1 smp wed aug 18 21:17:51 utc
2010 i686 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5
-Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local
-Dsitelib=/usr/local/share/perl/5.10.1
-Dsitearch=/usr/local/lib/perl/5.10.1 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm
-DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.1
-Dd_dosuid -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing
-pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/lib64
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=/lib/libc-2.11.1.so, so=so, useshrplib=true,
libperl=libperl.so.5.10.1
    gnulibc_version='2.11.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib
-fstack-protector'

Locally applied patches:



@INC for perl 5.10.1:
    /home/mhorsfall/perl5/lib/perl5/i686-linux
    /home/mhorsfall/perl5/lib/perl5/i486-linux-gnu-thread-multi
    /home/mhorsfall/perl5/lib/perl5
    /etc/perl
    /usr/local/lib/perl/5.10.1
    /usr/local/share/perl/5.10.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.10
    /usr/share/perl/5.10
    /usr/local/lib/site_perl
    .


Environment for perl 5.10.1:
    HOME=/home/mhorsfall
    LANG=C
    LANGUAGE=en_US:en
    LC_MESSAGES=en_US.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=/home/mhorsfall/bin:/home/mhorsfall/perl5/perlbrew/bin:/home/mhorsfall/perl5/bin:/home/mhorsfall/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

PERL5LIB=/home/mhorsfall/perl5/lib/perl5/i686-linux:/home/mhorsfall/perl5/lib/perl5:
    PERLBREW_BASHRC_VERSION=0.33
    PERLBREW_HOME=/home/mhorsfall/.perlbrew
    PERLBREW_PATH=/home/mhorsfall/perl5/perlbrew/bin
    PERLBREW_ROOT=/home/mhorsfall/perl5/perlbrew
    PERL_BADLANG (unset)
    PERL_LOCAL_LIB_ROOT=/home/mhorsfall/perl5
    PERL_MB_OPT=--install_base /home/mhorsfall/perl5
    PERL_MM_OPT=INSTALL_BASE=/home/mhorsfall/perl5
    SHELL=/bin/bash

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 17, 2013

From @wolfsage

I've done some preliminary setup and testing, but I need to do more
before I move on. However it's quite late and I need sleep.

I hope to get to more soon (tomorrow, this weekend).

Cheers,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 17, 2013

From [Unknown Contact. See original ticket]

I've done some preliminary setup and testing, but I need to do more
before I move on. However it's quite late and I need sleep.

I hope to get to more soon (tomorrow, this weekend).

Cheers,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 17, 2013

@wolfsage - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Feb 4, 2013

From @leonerd

On Wed, Jan 16, 2013 at 07​:17​:57PM -0800, Matthew Horsfall via RT wrote​:

I've done some preliminary setup and testing, but I need to do more
before I move on. However it's quite late and I need sleep.

Hi there,

Thanks for taking a start at this one.

How is progress? What's working currently...? Is there anything that
needs doing at the moment?

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Feb 5, 2013

From @wolfsage

On Mon, Feb 4, 2013 at 7​:27 AM, Paul LeoNerd Evans
<leonerd@​leonerd.org.uk>wrote​:

Hi there,

Thanks for taking a start at this one.

How is progress? What's working currently...? Is there anything that
needs doing at the moment?

Paul,

I hadn't got much done on this, but as discussed earlier in chat, I've
created a release that's up-to-date with blead with IO​::Socket​::IP in-place
of IO​::Socket​::INET.

There are 3 tests that fail that may or may not be important (at least one
of them relies on the internals of IO​::Socket​::INET which are no longer
there)​:

Failed 3 tests out of 2252, 99.87% okay.
  ../dist/IO/t/io_multihomed.t
  ../dist/IO/t/io_sock.t
  ../dist/IO/t/io_udp.t

The full test output is attached.

If you'd like to download and hack on the branch to try to fix these, you
can clone my repo at​:

git​://github.com/wolfsage/perl-1.git

Something like​:

  git clone git​://github.com/wolfsage/perl-1.git
  cd perl-1
  git checkout rt-116433
  ./Configure -d -Dusedevel
  make
  make test

If you clone this through github, feel free to push patches with pull
requests, otherwise please email me and I can incorporate them in.

Thanks,

And again, I apologize for taking so long to get back to this.

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Feb 5, 2013

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Mar 11, 2013

From @leonerd

On Mon, Feb 04, 2013 at 07​:52​:34PM -0500, Matthew Horsfall (alh) wrote​:

Paul,

I hadn't got much done on this, but as discussed earlier in chat, I've
created a release that's up-to-date with blead with IO​::Socket​::IP in-place
of IO​::Socket​::INET.

There are 3 tests that fail that may or may not be important (at least one
of them relies on the internals of IO​::Socket​::INET which are no longer
there)​:

Failed 3 tests out of 2252, 99.87% okay.
../dist/IO/t/io_multihomed.t
../dist/IO/t/io_sock.t
../dist/IO/t/io_udp.t

The full test output is attached.

Will take a look...

If you'd like to download and hack on the branch to try to fix these, you
can clone my repo at​:

git​://github.com/wolfsage/perl-1.git

Something like​:

git clone git​://github.com/wolfsage/perl-1.git
cd perl-1
git checkout rt-116433
./Configure -d -Dusedevel
make
make test

If you clone this through github, feel free to push patches with pull
requests, otherwise please email me and I can incorporate them in.

Thanks,

And again, I apologize for taking so long to get back to this.

dist/IO/t/io_multihomed ....................................... FAILED--expected test 2, saw test 5

This unit test employs Unwarranted Chumminess With Code Under Test.
Namely, it tries to subclass IO​::Socket​::INET then relies on lots of
internals on how it works, to ensure that the methods defined in the
package on lines 30-69 get called. With :​:IP having different internals,
these methods don't get called, so the output never prints

  ok 2
  ok 3
  ok 4

I can't see a way to change INET.pm to handle this case; the entire unit
test is just too fragile.

dist/IO/t/io_sock ............................................. IO​::Socket​: Unsupported socket domain at t/io_sock.t line 155.
IO​::Socket​: Unsupported socket domain at t/io_sock.t line 173.
FAILED--expected 26 tests, saw 10

Oops; this I expect is due to a lack of

  use IO​::Socket​::IP -register;

And a lack of

  Family => AF_INET in the @​_-passing case

And that IO​::Socket​::IP didn't construct a new unbound, unconnected
socket handle when presented with only a Family argument.

dist/IO/t/io_udp .............................................. # Failed test 7 - at t/io_udp.t line 72
FAILED at test 7

Fails on the ->connected test, because of IO​::Socket​::IP's subtly
different overridden behaviour. $self->peername caches, so it never
notices the missing value. getpeername($self) is required.

Now fixed upstream in IO​::Socket​::IP.

Find attached a combined patch with newer IO​::Socket​::IP and fixes to
the INET.pm wrapper.

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Mar 11, 2013

From @leonerd

0002-Newer-IO-Socket-IP-minor-bugfixes-to-fake-INET.pm-wr.patch
From 7974d32e0d5c18a40d55b34201a0a3c011d96ca8 Mon Sep 17 00:00:00 2001
From: "Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk>
Date: Mon, 11 Mar 2013 23:14:00 +0000
Subject: [PATCH 2/2] Newer IO::Socket::IP; minor bugfixes to fake INET.pm
 wrapper to make more of IO's unit tests pass

---
 cpan/IO-Socket-IP/lib/IO/Socket/IP.pm |   15 ++++++++++++---
 dist/IO/lib/IO/Socket/INET.pm         |    3 ++-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm
index c40bc67..26dc3de 100644
--- a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm
+++ b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm
@@ -1,7 +1,7 @@
 #  You may distribute under the terms of either the GNU General Public License
 #  or the Artistic License (the same terms as Perl itself)
 #
-#  (C) Paul Evans, 2010-2012 -- leonerd@leonerd.org.uk
+#  (C) Paul Evans, 2010-2013 -- leonerd@leonerd.org.uk
 
 package IO::Socket::IP;
 
@@ -9,7 +9,7 @@ use strict;
 use warnings;
 use base qw( IO::Socket );
 
-our $VERSION = '0.18';
+our $VERSION = '0.18_001';
 
 use Carp;
 
@@ -512,6 +512,15 @@ sub _configure
       }
    }
 
+   if( !@infos and defined $hints{family} ) {
+      # If there was a Family hint then create a plain unbound, unconnected socket
+      @infos = ( {
+         family   => $hints{family},
+         socktype => $hints{socktype},
+         protocol => $hints{protocol},
+      } );
+   }
+
    # In the nonblocking case, caller will be calling ->setup multiple times.
    # Store configuration in the object for the ->setup method
    # Yes, these are messy. Sorry, I can't help that...
@@ -633,7 +642,7 @@ sub connected
    my $self = shift;
    return defined $self->fileno &&
           !${*$self}{io_socket_ip_connect_in_progress} &&
-          defined $self->peername;
+          defined getpeername( $self ); # ->peername caches, we need to detect disconnection
 }
 
 =head1 METHODS
diff --git a/dist/IO/lib/IO/Socket/INET.pm b/dist/IO/lib/IO/Socket/INET.pm
index 3c04b57..e98461d 100644
--- a/dist/IO/lib/IO/Socket/INET.pm
+++ b/dist/IO/lib/IO/Socket/INET.pm
@@ -1,5 +1,6 @@
 package IO::Socket::INET;
 
+use IO::Socket::IP -register;
 use base qw( IO::Socket::IP );
 use Socket qw( PF_INET );
 
@@ -7,7 +8,7 @@ sub new
 {
   my $class = shift;
   return $class->SUPER::new(Family => PF_INET, PeerAddr => shift) if @_ == 1;
-  return $class->SUPER::new(@_);
+  return $class->SUPER::new(Family => PF_INET, @_);
 }
 
 1;
-- 
1.7.10.4

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 5, 2013

From @wolfsage

Alright, I've updated https://github.com/wolfsage/perl-1/tree/rt-116433
to include the new IO​::Socket​::IP from CPAN, as well as applied your
patch to IO​::Socket​::INET.pm.

I've removed multihomed.t since it's testing internal state of a module
we're replacing for this test.

All tests pass on my system, though META.JSON and META.YAML aren't up to
date since I'm having trouble rebuilding them...

rjbs / porters - can we get this branch smoked now? What do I need to do?

Thanks,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 6, 2013

From @rjbs

* Matthew Horsfall via RT <perlbug-followup@​perl.org> [2013-04-05T15​:39​:33]

All tests pass on my system, though META.JSON and META.YAML aren't up to
date since I'm having trouble rebuilding them...

Here, the manifest test is broken, too.

  porting/manifest.t (Wstat​: 0 Tests​: 10765 Failed​: 3)
  porting/regen.t (Wstat​: 0 Tests​: 33 Failed​: 2)
  ../dist/IO/t/io_sock.t (Wstat​: 1024 Tests​: 11 Failed​: 0)

I fixed the two porting tests and pushed the branch to
smoke-me/rjbs/io-socket-ip, but that failing IO test may be "everywhere."

The result is not immediately useful to me​:

  1..26
  ok 1
  ok 2
  ok 3
  ok 4
  ok 5
  ok 6
  ok 7
  ok 8
  ok 9
  ok 10
  ok 11
  Died at ../dist/IO/t/io_sock.t line 33, <GEN5> line 2.

There is a long pause between ok 11 and death.

--
rjbs

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 23, 2013

From @wolfsage

On Sat, Apr 6, 2013 at 10​:59 AM, Ricardo Signes via RT <
perlbug-followup@​perl.org> wrote​:

I fixed the two porting tests and pushed the branch to
smoke-me/rjbs/io-socket-ip, but that failing IO test may be "everywhere."

The result is not immediately useful to me​:

1..26
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
Died at ../dist/IO/t/io_sock.t line 33, <GEN5> line 2.

There is a long pause between ok 11 and death.

I finally reproduced this and tracked it down.

Here in io_sock.t line 172 on​:

# Then test UDP sockets
$server = IO​::Socket->new(Domain => AF_INET,
  Proto => 'udp',
  LocalAddr => 'localhost')
  || IO​::Socket->new(Domain => AF_INET,
  Proto => 'udp',
  LocalAddr => '127.0.0.1');
$port = $server->sockport;

The call to IO​::Socket->new() is creating a handle and then blessing it to
an IO​::Socket​::IP object. This skips the extra arguments in
IO​::Socket​::INET->new() which ensure that the IO​::Socket​::IP object does
IPv4 and causes the server to listen on IPv6 when it shouldn't.

Currently discussing options with LeoNerd to get this moving along.

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 23, 2013

From @wolfsage

Whoops, forgot cc...

On Tue, Apr 23, 2013 at 12​:34 PM, Matthew Horsfall (alh) <wolfsage@​gmail.com

wrote​:

On Sat, Apr 6, 2013 at 10​:59 AM, Ricardo Signes via RT <
perlbug-followup@​perl.org> wrote​:

I fixed the two porting tests and pushed the branch to
smoke-me/rjbs/io-socket-ip, but that failing IO test may be "everywhere."

The result is not immediately useful to me​:

1..26
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
Died at ../dist/IO/t/io_sock.t line 33, <GEN5> line 2.

There is a long pause between ok 11 and death.

I finally reproduced this and tracked it down.

Here in io_sock.t line 172 on​:

# Then test UDP sockets
$server = IO​::Socket->new(Domain => AF_INET,
Proto => 'udp',
LocalAddr => 'localhost')
|| IO​::Socket->new(Domain => AF_INET,
Proto => 'udp',
LocalAddr => '127.0.0.1');
$port = $server->sockport;

The call to IO​::Socket->new() is creating a handle and then blessing it to
an IO​::Socket​::IP object. This skips the extra arguments in
IO​::Socket​::INET->new() which ensure that the IO​::Socket​::IP object does
IPv4 and causes the server to listen on IPv6 when it shouldn't.

Currently discussing options with LeoNerd to get this moving along.

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 23, 2013

From @leonerd

On Tue, 23 Apr 2013 12​:34​:49 -0400
"Matthew Horsfall (alh)" <wolfsage@​gmail.com> wrote​:

Currently discussing options with LeoNerd to get this moving along.

This I'm classing as a bug in

  use IO​::Socket​::IP -register;

Because IO​::Socket​::new deletes the Domain argument, there is nothing
to tell the chosen subclass what domain the user wanted. This
previously hasn't been a problem because so far there was a 1​:1 mapping
from Domain to subclass. Since :​:IP wants both AF_INET and AF_INET6,
this presents a problem.

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 24, 2013

From @wolfsage

On Tue, Apr 23, 2013 at 12​:34 PM, Matthew Horsfall (alh) <
wolfsage@​gmail.com> wrote​:

Currently discussing options with LeoNerd to get this moving along.

-- Matthew Horsfall (alh)

LeoNerd pushed a dev branch to CPAN of IO​::Socket​::IP containing a fix for
this, I've updated and tested it locally and it appears to solve the issue.

rjbs has pulled it into the smoke me branch and now we're waiting testing
results.

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 25, 2013

From @leonerd

On Wed, 24 Apr 2013 12​:25​:41 -0400
"Matthew Horsfall (alh)" <wolfsage@​gmail.com> wrote​:

LeoNerd pushed a dev branch to CPAN of IO​::Socket​::IP containing a
fix for this, I've updated and tested it locally and it appears to
solve the issue.

rjbs has pulled it into the smoke me branch and now we're waiting
testing results.

FYI, that smoked OK so I've called it a real IO​::Socket​::IP 0.21

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 25, 2013

From @craigberry

On Wed, Apr 24, 2013 at 11​:25 AM, Matthew Horsfall (alh) <wolfsage@​gmail.com

wrote​:

On Tue, Apr 23, 2013 at 12​:34 PM, Matthew Horsfall (alh) <

wolfsage@​gmail.com> wrote​:

Currently discussing options with LeoNerd to get this moving along.

-- Matthew Horsfall (alh)

LeoNerd pushed a dev branch to CPAN of IO​::Socket​::IP containing a fix for
this, I've updated and tested it locally and it appears to solve the issue.

rjbs has pulled it into the smoke me branch and now we're waiting testing
results.

I built this branch as of

smoke-me/rjbs/io-socket-ip 2013-04-24.15​:51​:27
e037cbdbe1612475d113ff20adbd304172b1578e v5.17.10-53-ge037cbd

and got the following new test failures on VMS​:

  cpan/IO-Socket-IP/t/11sockopts ................................
FAILED--no leader found
  cpan/IO-Socket-IP/t/20nonblocking-connect ..................... FAILED
at test 9
  cpan/IO-Socket-IP/t/21nonblocking-connect-internet ............ FAILED
at test 3
  cpan/IO-Socket-IP/t/30nonblocking-connect ..................... FAILED
at test 9
  cpan/IO-Socket-IP/t/31nonblocking-connect-internet ............ FAILED
at test 3

11sockopts.t passes when run by itself outside of the test suite. The ones
ending in "connect" fail the test that looks like​:

ok( !$socket->blocking, '$socket->blocking' );

Something internally is setting the blocking flag to on even though the
value passed in as an argument to IO​::Socket​::IP->new says to turn it off.
That can be simplified to​:

$ perl blocking.pl
Blocking? : yes

where blocking.pl looks like​:

$ type blocking.pl
use strict;
use warnings;

use IO​::Socket​::IP;
use IO​::Socket​::INET;

my $testserver = IO​::Socket​::INET->new(
  Listen => 1,
  LocalHost => "127.0.0.1",
  Type => SOCK_STREAM,
) or die "Cannot listen on PF_INET - $@​";

my $socket = IO​::Socket​::IP->new(
  PeerHost => "127.0.0.1",
  PeerService => $testserver->sockport,
  Type => SOCK_STREAM,
  Blocking => 0,
);

print "Blocking? : " . ($socket->blocking ? 'yes' : 'no') . "\n";

The ones that end with "connect-internet" fail on the test that looks like​:

  ok( !$socket->connected, '$socket not yet connected' );

and elsewhere as well, though the other failures may be fallout from the
first​:

$ perl t/21nonblocking-connect-internet.t
ok 1 - defined $socket for cpanidx.org​:80
ok 2 - $socket has fileno
not ok 3 - $socket not yet connected
# Failed test '$socket not yet connected'
# at t/21nonblocking-connect-internet.t line 37.
not ok 4 - ->connect eventually succeeds
# Failed test '->connect eventually succeeds'
# at t/21nonblocking-connect-internet.t line 50.
ok 5 - $socket now connected
ok 6 - defined $socket for cpanidx.org​:6666
ok 7 - $socket has fileno
ok 8 - $socket not yet connected
not ok 9 - ->connect eventually fails with ECONNREFUSED
# Failed test '->connect eventually fails with ECONNREFUSED'
# at t/21nonblocking-connect-internet.t line 90.
# dollarbang = socket is not connected
1..9
# Looks like you failed 3 tests of 9.

I believe everything that goes wrong does so somewhere
in IO​::Socket​::IP​::_configure, but haven't really had time to dig very deep
yet.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 30, 2013

From @wolfsage

On Thu, Apr 25, 2013 at 5​:04 PM, Craig A. Berry <craig.a.berry@​gmail.com>wrote​:

I believe everything that goes wrong does so somewhere
in IO​::Socket​::IP​::_configure, but haven't really had time to dig very deep
yet.

Craig,

Any chance I or LeoNerd could get access to one of the failing systems so
we can do some playing around?

Thanks,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 1, 2013

From @craigberry

On Tue, Apr 30, 2013 at 9​:30 AM, Matthew Horsfall (alh)
<wolfsage@​gmail.com>wrote​:

On Thu, Apr 25, 2013 at 5​:04 PM, Craig A. Berry <craig.a.berry@​gmail.com>wrote​:

I believe everything that goes wrong does so somewhere
in IO​::Socket​::IP​::_configure, but haven't really had time to dig very deep
yet.

Craig,

Any chance I or LeoNerd could get access to one of the failing systems so
we can do some playing around?

I'm not against the idea but it would take quite a bit of my time and yours
to get you set up and teach you enough about VMS to do any debugging.

I did more or less get to the bottom of the 11sockopts.t failure, which is
that the failing tests requires elevated privileges. Here's a snippet of a
debug session showing where things go south​:

  DB<4> s
IO​::Socket​::setsockopt(/perl_root/lib/IO/Socket.pm​:314)​:
314​: setsockopt($_[0],$_[1],$_[2],$_[3]);
  DB<4> T
@​ = DB​::DB called from file '/perl_root/lib/IO/Socket.pm' line 314
$ = IO​::Socket​::setsockopt(ref(IO​::Socket​::IP), 65535, 32, '^A^@​^@​^@​')
called from file '/perl_root/lib/IO/Socket/IP.pm' line 561
$ = IO​::Socket​::IP​::setup(ref(IO​::Socket​::IP)) called from file
'/perl_root/lib/IO/Socket/IP.pm' line 540
$ = IO​::Socket​::IP​::_configure(ref(IO​::Socket​::IP), ref(HASH)) called from
file '/perl_root/lib/IO/Socket/IP.pm' line 364
$ = IO​::Socket​::IP​::configure(ref(IO​::Socket​::IP), ref(HASH)) called from
file '/perl_root/lib/IO/Socket.pm' line 49
$ = IO​::Socket​::new('IO​::Socket​::IP', 'LocalHost', 127.0.0.1, 'Broadcast',
1, 'Type', 2) called from file '/perl_root/lib/IO/Socket/IP.pm' line 331
$ = IO​::Socket​::IP​::new('IO​::Socket​::IP', 'LocalHost', 127.0.0.1, 'Type',
2, 'Broadcast', 1) called from file 't/11sockopts.t' line 43
  DB<4> s
Cannot socket() - permission denied at t/11sockopts.t line 43, <DATA> line
17.
Test​::Builder​::CODE(0x83a848)(/perl_root/lib/Test/Builder.pm​:2502)​:
2502​: $Test->_ending if defined $Test;

If you put "setsockopt broadcast privilege" into your favorite search
engine, you'll see that broadcast has been a privileged operation for
various systems at various times. We could put in a skip for this test,
but I don't know how necessary this feature is to the functioning of
IO​::Socket​::IP.

Side note​: it seems wrong to me that IO​::Socket​::setsockopt does not check
the return value of the core setsockopt, but I don't think it makes any
difference in this case.

I will try to get to the nonblocking failures soonish.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 1, 2013

From @wolfsage

On Tue, Apr 30, 2013 at 8​:24 PM, Craig Berry via RT <
perlbug-followup@​perl.org> wrote​:

On Tue, Apr 30, 2013 at 9​:30 AM, Matthew Horsfall (alh)
<wolfsage@​gmail.com>wrote​:

Craig,

Any chance I or LeoNerd could get access to one of the failing systems so
we can do some playing around?

I'm not against the idea but it would take quite a bit of my time and yours
to get you set up and teach you enough about VMS to do any debugging.

Fair enough though now you've got me curious about VMS :)

I did more or less get to the bottom of the 11sockopts.t failure, which is
that the failing tests requires elevated privileges. Here's a snippet of a
debug session showing where things go south​:

DB<4> s
IO​::Socket​::setsockopt(/perl_root/lib/IO/Socket.pm​:314)​:
314​: setsockopt($_[0],$_[1],$_[2],$_[3]);
DB<4> T
@​ = DB​::DB called from file '/perl_root/lib/IO/Socket.pm' line 314
$ = IO​::Socket​::setsockopt(ref(IO​::Socket​::IP), 65535, 32, '^A^@​^@​^@​')
called from file '/perl_root/lib/IO/Socket/IP.pm' line 561
$ = IO​::Socket​::IP​::setup(ref(IO​::Socket​::IP)) called from file
'/perl_root/lib/IO/Socket/IP.pm' line 540
$ = IO​::Socket​::IP​::_configure(ref(IO​::Socket​::IP), ref(HASH)) called from
file '/perl_root/lib/IO/Socket/IP.pm' line 364
$ = IO​::Socket​::IP​::configure(ref(IO​::Socket​::IP), ref(HASH)) called from
file '/perl_root/lib/IO/Socket.pm' line 49
$ = IO​::Socket​::new('IO​::Socket​::IP', 'LocalHost', 127.0.0.1, 'Broadcast',
1, 'Type', 2) called from file '/perl_root/lib/IO/Socket/IP.pm' line 331
$ = IO​::Socket​::IP​::new('IO​::Socket​::IP', 'LocalHost', 127.0.0.1, 'Type',
2, 'Broadcast', 1) called from file 't/11sockopts.t' line 43
DB<4> s
Cannot socket() - permission denied at t/11sockopts.t line 43, <DATA> line
17.
Test​::Builder​::CODE(0x83a848)(/perl_root/lib/Test/Builder.pm​:2502)​:
2502​: $Test->_ending if defined $Test;

If you put "setsockopt broadcast privilege" into your favorite search
engine, you'll see that broadcast has been a privileged operation for
various systems at various times. We could put in a skip for this test,
but I don't know how necessary this feature is to the functioning of
IO​::Socket​::IP.

Side note​: it seems wrong to me that IO​::Socket​::setsockopt does not check
the return value of the core setsockopt, but I don't think it makes any
difference in this case.

I will try to get to the nonblocking failures soonish.

If you have the time to do this that's great. Thanks a lot.

-- Matthew Horsfall (alh)

1 similar comment
@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 1, 2013

From @wolfsage

On Tue, Apr 30, 2013 at 8​:24 PM, Craig Berry via RT <
perlbug-followup@​perl.org> wrote​:

On Tue, Apr 30, 2013 at 9​:30 AM, Matthew Horsfall (alh)
<wolfsage@​gmail.com>wrote​:

Craig,

Any chance I or LeoNerd could get access to one of the failing systems so
we can do some playing around?

I'm not against the idea but it would take quite a bit of my time and yours
to get you set up and teach you enough about VMS to do any debugging.

Fair enough though now you've got me curious about VMS :)

I did more or less get to the bottom of the 11sockopts.t failure, which is
that the failing tests requires elevated privileges. Here's a snippet of a
debug session showing where things go south​:

DB<4> s
IO​::Socket​::setsockopt(/perl_root/lib/IO/Socket.pm​:314)​:
314​: setsockopt($_[0],$_[1],$_[2],$_[3]);
DB<4> T
@​ = DB​::DB called from file '/perl_root/lib/IO/Socket.pm' line 314
$ = IO​::Socket​::setsockopt(ref(IO​::Socket​::IP), 65535, 32, '^A^@​^@​^@​')
called from file '/perl_root/lib/IO/Socket/IP.pm' line 561
$ = IO​::Socket​::IP​::setup(ref(IO​::Socket​::IP)) called from file
'/perl_root/lib/IO/Socket/IP.pm' line 540
$ = IO​::Socket​::IP​::_configure(ref(IO​::Socket​::IP), ref(HASH)) called from
file '/perl_root/lib/IO/Socket/IP.pm' line 364
$ = IO​::Socket​::IP​::configure(ref(IO​::Socket​::IP), ref(HASH)) called from
file '/perl_root/lib/IO/Socket.pm' line 49
$ = IO​::Socket​::new('IO​::Socket​::IP', 'LocalHost', 127.0.0.1, 'Broadcast',
1, 'Type', 2) called from file '/perl_root/lib/IO/Socket/IP.pm' line 331
$ = IO​::Socket​::IP​::new('IO​::Socket​::IP', 'LocalHost', 127.0.0.1, 'Type',
2, 'Broadcast', 1) called from file 't/11sockopts.t' line 43
DB<4> s
Cannot socket() - permission denied at t/11sockopts.t line 43, <DATA> line
17.
Test​::Builder​::CODE(0x83a848)(/perl_root/lib/Test/Builder.pm​:2502)​:
2502​: $Test->_ending if defined $Test;

If you put "setsockopt broadcast privilege" into your favorite search
engine, you'll see that broadcast has been a privileged operation for
various systems at various times. We could put in a skip for this test,
but I don't know how necessary this feature is to the functioning of
IO​::Socket​::IP.

Side note​: it seems wrong to me that IO​::Socket​::setsockopt does not check
the return value of the core setsockopt, but I don't think it makes any
difference in this case.

I will try to get to the nonblocking failures soonish.

If you have the time to do this that's great. Thanks a lot.

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 1, 2013

From @leonerd

On Tue, 30 Apr 2013 19​:23​:44 -0500
"Craig A. Berry" <craig.a.berry@​gmail.com> wrote​:

I did more or less get to the bottom of the 11sockopts.t failure,
which is that the failing tests requires elevated privileges. Here's
a snippet of a debug session showing where things go south​:
...
If you put "setsockopt broadcast privilege" into your favorite
search engine, you'll see that broadcast has been a privileged
operation for various systems at various times. We could put in a
skip for this test, but I don't know how necessary this feature is to
the functioning of IO​::Socket​::IP.

Oh it's totally ancilliary; if this doesn't work on VMS it's quite
simple to skip the test.

I'm curious to know though - is this a new failure since 0.21, or has
it existed for a while? I'm not really aware of anything I changed
since 0.21 that would cause this.

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 3, 2013

From @craigberry

On Wed, May 1, 2013 at 4​:45 PM, Paul LeoNerd <leonerd@​leonerd.org.uk> wrote​:

On Tue, 30 Apr 2013 19​:23​:44 -0500
"Craig A. Berry" <craig.a.berry@​gmail.com> wrote​:

I did more or less get to the bottom of the 11sockopts.t failure,
which is that the failing tests requires elevated privileges.

We could put in a

skip for this test, but I don't know how necessary this feature is to
the functioning of IO​::Socket​::IP.

Oh it's totally ancilliary; if this doesn't work on VMS it's quite
simple to skip the test.

The first hunk in the attached patch does that. It also has a second hunk,
which is actually against IO​::Socket, not IO​::Socket​:IP. It turns out
sockets on VMS (just like Windows) are blocking by default, but the same
code already in IO​::Socket​::blocking for Windows that uses ioctl to set
non-blocking works just fine on VMS. As far as I can see, the only thing
you did wrong was to provide better test coverage than IO​::Socket has :-).

That gets all the IO​::Socket​::IP tests in the smoke-me/rjbs/io-socket-ip
branch passing on VMS. With Ricardo's permission, I can push the
IO​::Socket change to blead; it's quite safe since it simply enables code
for VMS that wasn't previously run and can't affect other platforms.

I'm sorry it took me so long to put together this trivial patch; things
have been quite busy at $work and elsewhere lately.

And the patch inline for human readability​:

Inline Patch
--- cpan/IO-Socket-IP/t/11sockopts.t;-0 Wed Apr 24 10:51:26 2013
+++ cpan/IO-Socket-IP/t/11sockopts.t Fri May  3 15:50:14 2013
@@ -39,7 +39,9 @@ SKIP: {
    ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' );
 }

-{
+SKIP: {
+   skip "SO_BROADCAST requires elevated privileges on $^O", 1 if $^O eq
'VMS'; \+   my $sock = IO​::Socket​::IP\->new\(   LocalHost => "127\.0\.0\.1"\,   Type => SOCK\_DGRAM\,
Inline Patch
--- dist/IO/lib/IO/Socket.pm;-0 Wed Apr 24 10:51:26 2013
+++ dist/IO/lib/IO/Socket.pm Fri May  3 15:45:21 2013
@@ -167,7 +167,7 @@ sub blocking {
     my $sock = shift;

     return $sock->SUPER::blocking(@_)
-        if $^O ne 'MSWin32';
+        if $^O ne 'MSWin32' && $^O ne 'VMS';

     # Windows handles blocking differently
     #

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 3, 2013

From @craigberry

io-socket-ip-vms.patch
--- cpan/IO-Socket-IP/t/11sockopts.t;-0	Wed Apr 24 10:51:26 2013
+++ cpan/IO-Socket-IP/t/11sockopts.t	Fri May  3 15:50:14 2013
@@ -39,7 +39,9 @@ SKIP: {
    ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' );
 }
 
-{
+SKIP: {
+   skip "SO_BROADCAST requires elevated privileges on $^O", 1 if $^O eq 'VMS';
+
    my $sock = IO::Socket::IP->new(
       LocalHost => "127.0.0.1",
       Type      => SOCK_DGRAM,
--- dist/IO/lib/IO/Socket.pm;-0	Wed Apr 24 10:51:26 2013
+++ dist/IO/lib/IO/Socket.pm	Fri May  3 15:45:21 2013
@@ -167,7 +167,7 @@ sub blocking {
     my $sock = shift;
 
     return $sock->SUPER::blocking(@_)
-        if $^O ne 'MSWin32';
+        if $^O ne 'MSWin32' && $^O ne 'VMS';
 
     # Windows handles blocking differently
     #

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 4, 2013

From @leonerd

On Fri, 3 May 2013 16​:34​:41 -0500
"Craig A. Berry" <craig.a.berry@​gmail.com> wrote​:

The first hunk in the attached patch does that. It also has a second
hunk, which is actually against IO​::Socket, not IO​::Socket​:IP. It
turns out sockets on VMS (just like Windows) are blocking by default,
but the same code already in IO​::Socket​::blocking for Windows that
uses ioctl to set non-blocking works just fine on VMS. As far as I
can see, the only thing you did wrong was to provide better test
coverage than IO​::Socket has :-).

That gets all the IO​::Socket​::IP tests in the
smoke-me/rjbs/io-socket-ip branch passing on VMS. With Ricardo's
permission, I can push the IO​::Socket change to blead; it's quite
safe since it simply enables code for VMS that wasn't previously run
and can't affect other platforms.

Excellent, that sounds good.

I'm sorry it took me so long to put together this trivial patch;
things have been quite busy at $work and elsewhere lately.

Oh that's quite alright - often it can take a while to gain the sudden
insight that turns into a small oneline fix.

And the patch inline for human readability​:

--- cpan/IO-Socket-IP/t/11sockopts.t;-0 Wed Apr 24 10​:51​:26 2013
+++ cpan/IO-Socket-IP/t/11sockopts.t Fri May 3 15​:50​:14 2013
@​@​ -39,7 +39,9 @​@​ SKIP​: {
ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT
set' ); }

-{
+SKIP​: {
+ skip "SO_BROADCAST requires elevated privileges on $^O", 1 if $^O
eq 'VMS';
+
my $sock = IO​::Socket​::IP->new(
LocalHost => "127.0.0.1",
Type => SOCK_DGRAM,

That sounds OK, but I wonder if we can provide a better detection
method, so it doesn't have to rely on the OS name and instead it could
detect whether SO_BROADCAST works at all. Maybe a short sequence of
socket() and setsockopt() and detect for non-error? I'll have a hack at
something.

--- dist/IO/lib/IO/Socket.pm;-0 Wed Apr 24 10​:51​:26 2013
+++ dist/IO/lib/IO/Socket.pm Fri May 3 15​:45​:21 2013
@​@​ -167,7 +167,7 @​@​ sub blocking {
my $sock = shift;

 return $sock\->SUPER&#8203;::blocking\(@&#8203;\_\)

- if $^O ne 'MSWin32';
+ if $^O ne 'MSWin32' && $^O ne 'VMS';

 \# Windows handles blocking differently
 \#

That sounds good. I mean, non-ideal, but perhaps unavoidable, and in
any case no worse than the previous code was anyway in terms of
hardcoding OS names.

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 5, 2013

From @rjbs

* "Craig A. Berry" <craig.a.berry@​gmail.com> [2013-05-03T17​:34​:41]

That gets all the IO​::Socket​::IP tests in the smoke-me/rjbs/io-socket-ip
branch passing on VMS. With Ricardo's permission, I can push the
IO​::Socket change to blead; it's quite safe since it simply enables code
for VMS that wasn't previously run and can't affect other platforms.

Great, thanks.

--
rjbs

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 5, 2013

From @craigberry

On Sun, May 5, 2013 at 2​:45 PM, Ricardo Signes <perl.p5p@​rjbs.manxome.org>wrote​:

* "Craig A. Berry" <craig.a.berry@​gmail.com> [2013-05-03T17​:34​:41]

That gets all the IO​::Socket​::IP tests in the smoke-me/rjbs/io-socket-ip
branch passing on VMS. With Ricardo's permission, I can push the
IO​::Socket change to blead; it's quite safe since it simply enables code
for VMS that wasn't previously run and can't affect other platforms.

Great, thanks.

Thanks, it's in as d358b6c.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 6, 2013

From @wolfsage

On Sun, May 5, 2013 at 4​:49 PM, Craig A. Berry <craig.a.berry@​gmail.com>wrote​:

On Sun, May 5, 2013 at 2​:45 PM, Ricardo Signes <perl.p5p@​rjbs.manxome.org>wrote​:

* "Craig A. Berry" <craig.a.berry@​gmail.com> [2013-05-03T17​:34​:41]

That gets all the IO​::Socket​::IP tests in the smoke-me/rjbs/io-socket-ip
branch passing on VMS. With Ricardo's permission, I can push the
IO​::Socket change to blead; it's quite safe since it simply enables code
for VMS that wasn't previously run and can't affect other platforms.

Great, thanks.

Thanks, it's in as d358b6c.

Thanks a lot everyone.

I think there's one failure left to look at on Darwin (
http​://perl5.test-smoke.org/logfile/8445)​:

getaddrinfo() - service name not available for the specified socket type at
t/04local-client-v6.t line 28.
../cpan/IO-Socket-IP/t/04local-client-v6.t ........................

But I notice that same failure is affecting some other oses on CpanTesters​:
http​://www.cpantesters.org/cpan/report/a0238a58-af75-11e2-ad73-dd0a7cfad375
Where should we go from here? Fix this failure also and resmoke - or once
CPANTesters is happy with it we can move on to the next stage of smoking
the module against CPAN?

There are some other failures at
http​://perl.develop-help.com/?b=smoke-me%2Frjbs%2Fio-socket-ip but at first
glance they look unrelated, so I'm inclined to move onto the next stage
when this is fixed but I submit to the wisdom of the porters.

Thanks,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jun 19, 2013

From @wolfsage

On Mon, May 6, 2013 at 12​:59 PM, Matthew Horsfall (alh)
<wolfsage@​gmail.com>wrote​:

Thanks a lot everyone.

I think there's one failure left to look at on Darwin (
http​://perl5.test-smoke.org/logfile/8445)​:

getaddrinfo() - service name not available for the specified socket type
at t/04local-client-v6.t line 28.
../cpan/IO-Socket-IP/t/04local-client-v6.t ........................

But I notice that same failure is affecting some other oses on
CpanTesters​:
http​://www.cpantesters.org/cpan/report/a0238a58-af75-11e2-ad73-dd0a7cfad375
Where should we go from here? Fix this failure also and resmoke - or once
CPANTesters is happy with it we can move on to the next stage of smoking
the module against CPAN?

There are some other failures at
http​://perl.develop-help.com/?b=smoke-me%2Frjbs%2Fio-socket-ip but at
first glance they look unrelated, so I'm inclined to move onto the next
stage when this is fixed but I submit to the wisdom of the porters.

Thanks,

-- Matthew Horsfall (alh)

I haven't forgotten this. The plan is to figure out the failure on
DragonFlyBSD for IO​::Socket​::IP, get that clean, and then move on to the
next phase of "Smoke CPAN against this branch."

I should have some free time soon to play around and possibly figure out
the IO​::Socket​::IP issues or at least give LeoNerd what he needs to do so.
(Of course, if anyone else wants to take a stab at it, by all means :))

Cheers,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Aug 15, 2013

From @wolfsage

On Wed, Jun 19, 2013 at 3​:40 PM, Matthew Horsfall (alh)
<wolfsage@​gmail.com>wrote​:

I should have some free time soon to play around and possibly figure out
the IO​::Socket​::IP issues or at least give LeoNerd what he needs to do so.
(Of course, if anyone else wants to take a stab at it, by all means :))

Soon came and went, and then I finally made the time.

smoke-me/rjbs/io-socket-ip is running blead with IO​::Socket​::IP 0.22
(thanks for snagging that rjbs)

Provided the looks good enough, we can finally move onto smoking the branch
against CPAN.

Thanks for your patience,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 2, 2013

From michiel.beijen@gmail.com

On Thu, Aug 15, 2013 at 2​:52 PM, Matthew Horsfall (alh)
<wolfsage@​gmail.com> wrote​:

Provided the looks good enough, we can finally move onto smoking the branch
against CPAN.
Does this look good enough?
--
Mike

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 3, 2013

From @wolfsage

On Mon, Sep 2, 2013 at 10​:23 AM, Michiel Beijen <michiel.beijen@​gmail.com>wrote​:

On Thu, Aug 15, 2013 at 2​:52 PM, Matthew Horsfall (alh)
<wolfsage@​gmail.com> wrote​:

Provided the looks good enough, we can finally move onto smoking the
branch
against CPAN.
Does this look good enough?
--
Mike

I think so. None of the failures look related​:

http​://perl.develop-help.com/?b=smoke-me%2Frjbs%2Fio-socket-ip

I'd like to see it smoke across more OSes, but this is all we have so far.

I think taking this to the next step now would be good.

Ricardo?

Thanks,

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 8, 2014

From @xdg

After some discussion on IRC today about the current state of affairs,
there was agreement on a plan for moving forward with IO​::Socket​::IP​:

* The "drop in replacement for IO​::Socket​::INET" language in the docs
will be softened, as that assertion is not sufficiently tested and is
a "nice to have" rather than a "must have" feature

* IO​::Socket​::IP (with revised language) will be added to blead ASAP
(after PAUSE is back up for a release) so that it can start getting
tested as part of the normal blead release cycle

* Separately, tests of the "drop in" assertion will continue outside
blead, with volunteers testing a monkey-patched IO​::Socket​::NET that
effectively just subclasses IO​::Socket​::IP

This ensures that v5.20.0 will finally have full in-core support for IPv6.

If the drop-in testing goes well enough, the "drop in" language in the
docs may be restored at some future point, but it will not be a
blocking issue for v5.20.

--
David Golden <xdg@​xdg.me>
Take back your inbox! → http​://www.bunchmail.com/
Twitter/IRC​: @​xdg

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 9, 2014

From @rjbs

* David Golden <xdg@​xdg.me> [2014-01-08T13​:05​:19]

* IO​::Socket​::IP (with revised language) will be added to blead ASAP
(after PAUSE is back up for a release) so that it can start getting
tested as part of the normal blead release cycle

…with the (perhaps obvious) proviso that it would be removed before 5.20 if too
many problems were found during testing. I note this only to temper the idea
that we're "ensuring" an IO​::Socket interface for IPv6 in core. We're just
trying to make more progress toward it.

--
rjbs

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 9, 2014

From @nwc10

On Thu, Jan 09, 2014 at 09​:02​:49AM -0500, Ricardo Signes wrote​:

* David Golden <xdg@​xdg.me> [2014-01-08T13​:05​:19]

* IO​::Socket​::IP (with revised language) will be added to blead ASAP
(after PAUSE is back up for a release) so that it can start getting
tested as part of the normal blead release cycle

…with the (perhaps obvious) proviso that it would be removed before 5.20 if too
many problems were found during testing. I note this only to temper the idea
that we're "ensuring" an IO​::Socket interface for IPv6 in core. We're just
trying to make more progress toward it.

By using Acme​::Overide​::INET (thanks xdg, this makes things a lot easier)*
I've found a couple of things that differ in behaviour from IO​::Socket​::INET,
and aren't documented as incompatibilities. Reported as

https://rt.cpan.org/Public/Bug/Display.html?id=91982
https://rt.cpan.org/Public/Bug/Display.html?id=91989

In one case, we seem to be getting a silent constructor failure.

Nicholas Clark

* Not yet on CPAN, because the PAUSE hardware is very unhappy. See
  http​://log.perl.org/2014/01/multiple-hard-drive-faliure.html

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 9, 2014

From @leonerd

On Thu, 9 Jan 2014 16​:49​:21 +0000
Nicholas Clark <nick@​ccl4.org> wrote​:

By using Acme​::Overide​::INET (thanks xdg, this makes things a lot
easier)* I've found a couple of things that differ in behaviour from
IO​::Socket​::INET, and aren't documented as incompatibilities.
Reported as

https://rt.cpan.org/Public/Bug/Display.html?id=91982
https://rt.cpan.org/Public/Bug/Display.html?id=91989

In one case, we seem to be getting a silent constructor failure.

Having looked at them, they both fall into the category of "existing
code doing morally-dubious things with IO​::Socket​::INET that
nevertheless managed to work there", which isn't going to work in a
more general case.

Hard to see what a sensible course of action is here. I'm not overly
inclined towards making IO​::Socket​::IP do odd things just
because :​:INET did them, so they may have to be filed under the general
banner of "don't do that".

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 10, 2014

From @xdg

On Thu, Jan 9, 2014 at 11​:49 AM, Nicholas Clark <nick@​ccl4.org> wrote​:

By using Acme​::Overide​::INET (thanks xdg, this makes things a lot easier)*

* Not yet on CPAN, because the PAUSE hardware is very unhappy. See
http​://log.perl.org/2014/01/multiple-hard-drive-faliure.html

Available here for now​:
https://www.dropbox.com/s/70ur48jjg6q9n6k/Acme-Override-INET-0.001.tar.gz

Once PAUSE is up, I'll ship it and blog about it.

David

--
David Golden <xdg@​xdg.me>
Take back your inbox! → http​://www.bunchmail.com/
Twitter/IRC​: @​xdg

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 10, 2014

From @xdg

On Thu, Jan 9, 2014 at 1​:39 PM, Paul "LeoNerd" Evans
<leonerd@​leonerd.org.uk> wrote​:

Hard to see what a sensible course of action is here. I'm not overly
inclined towards making IO​::Socket​::IP do odd things just
because :​:INET did them, so they may have to be filed under the general
banner of "don't do that".

How about making such cases fatal? Then at least if someone tries to
do a drop-in replacement, they'll pretty immediately discover any such
issues. Trusting that someone is checking the return value seems like
a bad idea.

David

--
David Golden <xdg@​xdg.me>
Take back your inbox! → http​://www.bunchmail.com/
Twitter/IRC​: @​xdg

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 10, 2014

From @leonerd

On Fri, 10 Jan 2014 11​:00​:48 -0500
David Golden <xdg@​xdg.me> wrote​:

How about making such cases fatal? Then at least if someone tries to
do a drop-in replacement, they'll pretty immediately discover any such
issues. Trusting that someone is checking the return value seems like
a bad idea.

Well, one of these can indeed do this (which is hinted at here
  https://rt.cpan.org/Ticket/Display.html?id=91982)

However, the other bug relates more to what the caller does with the
socket handle after constructing it. That one can't really be fixed
from within IO​::Socket​::IP itself.

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 11, 2014

From @leonerd

On Thu, 9 Jan 2014 16​:49​:21 +0000
Nicholas Clark <nick@​ccl4.org> wrote​:

By using Acme​::Overide​::INET (thanks xdg, this makes things a lot
easier)* I've found a couple of things that differ in behaviour from
IO​::Socket​::INET, and aren't documented as incompatibilities.
Reported as

https://rt.cpan.org/Public/Bug/Display.html?id=91982
https://rt.cpan.org/Public/Bug/Display.html?id=91989

In one case, we seem to be getting a silent constructor failure.

I believe both of these are now fixed. Patches in the bugs.

Lacking a PAUSE still, you can find the current devel snapshot that
should be ready for the next version at​:

  http​://home.leonerd.org.uk/local/IO-Socket-IP-0.24+bzr219.tar.gz

Ifwhen PAUSE comes back (or some other suitable replacement appears)
I'll call it 0.25, if no other bugs by then.

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 11, 2014

From @leonerd

On Sat, 11 Jan 2014 00​:08​:43 +0000
"Paul \"LeoNerd\" Evans" <leonerd@​leonerd.org.uk> wrote​:

Lacking a PAUSE still, you can find the current devel snapshot that
should be ready for the next version at​:

http​://home.leonerd.org.uk/local/IO-Socket-IP-0.24+bzr219.tar.gz

Ifwhen PAUSE comes back (or some other suitable replacement appears)
I'll call it 0.25, if no other bugs by then.

PAUSE appears to be up and running again​:

  http​://metacpan.org/release/PEVANS/IO-Socket-IP-0.25

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Feb 19, 2014

From @wolfsage

I'm finally going through the smoke run I did of blead with IO​::Socket​::IP drop-in replacement of IO​::Socket​::INET vs blead.

IO​::Socket​::IP is at .26, both branches smoked are at​:

  commit b373396
  Merge​: c2d9228 25be0a8
  Author​: Brian Fraser <fraserbn@​gmail.com>
  Date​: Sun Jan 26 14​:44​:36 2014 -0300

I'll keep adding issues as I find them so they have more time to be worked on.

So far​:

  Catalyst​::Authentication​::Credential​::RemoteHTTP
  - A t/* file used IO​::Socket​::INET Listen with Peer* instead of Local
  - IO​::Socket​::INET allows Listen with PeerAddr*, this is perhaps a bug...
  - IO​::Socket​::IP throws an error when this combination is tried
  - Patch​: nigelm/Catalyst-Authentication-Credential-RemoteHTTP#1

  IO​::Event
  - Multiple test failures. Unresearched as of yet

  IO​::Socket​::SSL
  - Known breakage? There's code in it to ignore Acme​::Override​::INET.

-- Matthew Horsfall (alh)

Lots of noise to go through (There are ton of modules that fail randomly due to Hash key order and timing issues....)

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Feb 19, 2014

From [Unknown Contact. See original ticket]

I'm finally going through the smoke run I did of blead with IO​::Socket​::IP drop-in replacement of IO​::Socket​::INET vs blead.

IO​::Socket​::IP is at .26, both branches smoked are at​:

  commit b373396
  Merge​: c2d9228 25be0a8
  Author​: Brian Fraser <fraserbn@​gmail.com>
  Date​: Sun Jan 26 14​:44​:36 2014 -0300

I'll keep adding issues as I find them so they have more time to be worked on.

So far​:

  Catalyst​::Authentication​::Credential​::RemoteHTTP
  - A t/* file used IO​::Socket​::INET Listen with Peer* instead of Local
  - IO​::Socket​::INET allows Listen with PeerAddr*, this is perhaps a bug...
  - IO​::Socket​::IP throws an error when this combination is tried
  - Patch​: nigelm/Catalyst-Authentication-Credential-RemoteHTTP#1

  IO​::Event
  - Multiple test failures. Unresearched as of yet

  IO​::Socket​::SSL
  - Known breakage? There's code in it to ignore Acme​::Override​::INET.

-- Matthew Horsfall (alh)

Lots of noise to go through (There are ton of modules that fail randomly due to Hash key order and timing issues....)

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Feb 19, 2014

From @leonerd

On Wed, 19 Feb 2014 05​:21​:59 -0800
"Matthew Horsfall via RT" <perlbug-comment@​perl.org> wrote​:

I'm finally going through the smoke run I did of blead with
IO​::Socket​::IP drop-in replacement of IO​::Socket​::INET vs blead.

IO​::Socket​::IP is at .26, both branches smoked are at​:

0.26? Latest on CPAN is 0.28 and that is mostly test fixes, though also
contains one critical fix that might affect some of these later issues​:

  [CHANGES]
  * Renamed internal _configure method to _io_socket_ip__configure to
  avoid clashes with modules that try to subclass IO​::Socket​::INET

IO​::Event
- Multiple test failures. Unresearched as of yet

IO​::Socket​::SSL
- Known breakage? There's code in it to ignore
Acme​::Override​::INET.

Hmmm. I thought IO​::Socket​::SSL could optionally use IO​::Socket​::IP if
it was present anyway, so maybe this is somehow related?

--
Paul "LeoNerd" Evans

leonerd@​leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http​://www.leonerd.org.uk/

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 28, 2014

From @wolfsage

Perl 5.20.0 was released and contains IO​::Socket​::IP.

I'm marking this ticket resolved, and will try to continue the work of getting it more tested (including the issues previously mentioned) for 5.22.

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 28, 2014

@wolfsage - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this May 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant