develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #118843] crash when peerhost called

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
July 12, 2013 01:09
Subject:
[perl #118843] crash when peerhost called
Message ID:
rt-3.6.HEAD-2552-1373591336-1138.118843-15-0@perl.org
On Wed Jul 10 00:13:27 2013, xyf.xiao@gmail.com wrote:
> This is a bug report for perl from xyf.xiao@gmail.com,
> generated with the help of perlbug 1.39 running under perl 5.14.2.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> calling peerhost function after recv, can result crash and throw:
> 
> 
> Bad arg length for Socket::unpack_sockaddr_in, length is 4096, should
> be 16 at /usr/lib/perl5/5.14/i686-cygwin-threads-64int/Socket.pm line
> 559.
> 
> Below is test code which works fine in windows:
> 
> use IO::Select;
> use IO::Socket::INET;
> 
> my $data;
> 
> my $servSock = IO::Socket::INET->new(LocalPort => 6666,
>                                      Listen    => 100,);
> 
> my $select =IO::Select->new($servSock);
> while(1){
> 
>         my $clientSock = $servSock->accept();
>         $select->add($clientSock);
>         $clientSock->recv( $data, 100, 0);
>         warn $clientSock->peerhost();
>         close($clientSock);
> }
> 

How would I run this program on a Unix-like system and get meaningful
output?


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=118843

Thread Previous | 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