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
crash when peerhost called #13101
Comments
From xyf.xiao@gmail.comCreated by xyf.xiao@gmail.comcalling peerhost function after recv, can result crash and throw: Bad arg length for Socket::unpack_sockaddr_in, length is 4096, should Below is test code which works fine in windows: use IO::Select; my $data; my $servSock = IO::Socket::INET->new(LocalPort => 6666, my $select =IO::Select->new($servSock); my $clientSock = $servSock->accept(); Perl Info
|
From @jkeenanOn Wed Jul 10 00:13:27 2013, xyf.xiao@gmail.com wrote:
How would I run this program on a Unix-like system and get meaningful |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Thu Jul 11 18:08:56 2013, jkeenan wrote:
Run it in one terminal, then connect to port 6666 with any TCP client: (first terminal) (second terminal) Tony |
From xyf.xiao@gmail.comOn Fri, Jul 12, 2013 at 9:44 AM, Tony Cook via RT
Hi, |
From @tonycozOn Fri, Jul 12, 2013 at 12:26:18PM +0800, Xiao Yafeng wrote:
It's possible: https://rt.cpan.org/Ticket/Display.html?id=86613 is related to this. Tony |
From @tonycozOn Thu Jul 11 21:54:34 2013, tonyc wrote:
The fix for 86613 doesn't appear to have fixed this problem. tony@phobos ~/dev/perl/git/perl tony@phobos ~/dev/perl/git/perl This is perl 5, version 19, subversion 4 (v5.19.4 Copyright 1987-2013, Larry Wall Perl may be copied only under the terms of either the Artistic License Complete documentation for Perl, including FAQ lists, should be found on tony@phobos ~/dev/perl/git/perl tony@phobos ~/dev/perl/git/perl |
From @tonycozOn Thu Jul 11 21:27:20 2013, xyf.xiao@gmail.com wrote:
It looks like the bug is cygwin (or maybe a limitation of Win32) doesn't update the socklen parameter supplied to recvfrom(), so if you supply a large buffer (as perl does, since it needs to allow for non-IPv4 protocols like UNIX sockets), the whole buffer is returned, not just the struct sockaddr_in part. As to whether this is a Win32 limitation - the Win32 documentation for both recvfrom() [1] and WSARecvFrom() [2] both indicate that the from/fromlen parameters are ignored for connection oriented sockets. Tony |
From @tonycozOn Wed Dec 18 15:59:59 2013, tonyc wrote:
Thinking about it some more, I wonder if the definition and implementation of recv()s return value is simply broken. From my reading, POSIX[1] makes no guarantees about the value of *I<address_len> (or the memory addressed by I<address>) when reading from a socket: If the address argument is not a null pointer and the protocol does not provide Both Linux, OS/X and OpenBSD (and probably others) happen to set *address_len to 0, but I don't see that behaviour specified anywhere. An implementation might ignore address and *address_len instead, as Win32[2] and cygwin both do. All that said, I might just workaround this in the same way as win32_recvfrom() does - call getpeername() if the output address_len is the same as the input. Tony [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html |
From @tonycozOn Wed Dec 18 16:42:30 2013, tonyc wrote:
Pushed as a smoke-me, including some socket tests, which we don't appear to have Tony |
From @tonycozOn Mon Jan 06 21:11:34 2014, tonyc wrote:
Pushed with some race condition fixes as e122534. Tony |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#118843 (status was 'resolved')
Searchable as RT118843$
The text was updated successfully, but these errors were encountered: