in reply to ActivePerl socket crashes on Checked Build Windows

G'day raandom,

I see you've used indirect object syntax:

my $sock = new IO::Socket::INET ( ... );

Here's what perlobj - Invoking Class Methods has to say about that:

Indirect Object Syntax

Outside of the file handle case, use of this syntax is discouraged, as it can confuse the Perl interpreter. See below for more details.

...

Do you encounter the same problems with:

my $sock = IO::Socket::INET::->new( ... );

[I don't have any of the versions you mention, so I'm unable to test this.]

-- Ken

Replies are listed 'Best First'.
Re^2: ActivePerl socket crashes on Checked Build Windows
by raandom (Acolyte) on Jun 09, 2013 at 18:42 UTC
    Thanks for advise: I will repair confusing syntax in my code. But it won't help. Even this code crashes:
    use strict; use Socket; socket(my $socket, PF_INET, SOCK_STREAM, 0) or die "socket: $!"; # crashes here: close($socket);
    I wrote to ActiveState support. Will see what they say.
      I couldn't reproduce any problem with that code and any of my ActivePerl installations.
      I tried both 32-bit and 64-bit versions of build 1600 (perl-5.16.0), build 1200 (perl-5.12.0) and build 1005 (perl-5.10.0).
      And that (second lot of) code you provided ran silently and successfully.

      What do you get when you run:
      perl -MSocket -e "print $Socket::VERSION;"
      Cheers,
      Rob
        Socket version is 1.94. The thing is to run Perl under AppVerifier or on Checked Build Windows.

        ActiveState pointed on confusing syntax and said: "...Behavior on a socket crash then depends on how the perlio library was compiled. ActivePerl binaries are built with MSoft compilers (On Win64, we use the 2003 SDK toolchain). Strawberry binaries are built with different options and with MinGW compilers, so Strawberry does behave a bit differently, even though the code in both versions is the same.
        ...ActivePerl 5.18 for Win64 will be a departure from our current compiler practice, as it is the first ActivePerl to be switched to MinGW 64 (and that is one of the main reasons why there have been delays in getting 5.18 released)..."