Skip Menu |

This queue is for tickets about the Sys-Sendfile CPAN distribution.

Report information
The Basics
Id: 84956
Status: resolved
Priority: 0/
Queue: Sys-Sendfile

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.11
  • 0.12
  • 0.13
  • 0.14
Fixed in: 0.16



Subject: hangs on perl 5.17.10, Windows
C:\strawberry\cpan\build\Sys-Sendfile-0.11-nU7wfg>perl -Mblib -T t\10-basics.t 1..2 # Couldn't sendfile(): Terminating on signal SIGINT(2) -- Alexandr Ciornii, http://chorny.net
Same result with perl 5.18.0, version 0.12. -- Alexandr Ciornii, http://chorny.net
Subject: Re: [rt.cpan.org #84956] hangs on perl 5.17.10, Windows
Date: Tue, 3 Dec 2013 22:32:30 +0100
To: bug-Sys-Sendfile [...] rt.cpan.org
From: Leon Timmermans <leont [...] cpan.org>
On Tue, Dec 3, 2013 at 10:25 PM, Alexandr Ciornii via RT < bug-Sys-Sendfile@rt.cpan.org> wrote: Show quoted text
> Queue: Sys-Sendfile > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84956 > > > Same result with perl 5.18.0, version 0.12. >
What version of Windows are you using, and what other networking programs are you running. MSDN tells me that on Windows Vista and older desktop Windows «only two outstanding *TransmitFile* requests are handled simultaneously; the third request will wait until one of the previous requests is completed.» I suspect this is the issue you're hitting. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms740565%28v=vs.85%29.aspxfor more information. Leon
On Tue Dec 03 16:33:01 2013, LEONT wrote: Show quoted text
> What version of Windows are you using, and what other networking > programs > are you running.
Windows XP Professional SP3 Russian. Network programs - only Virtualbox Guest Additions. -- Alexandr Ciornii, http://chorny.net
Version 0.11 hanged only on 5.17.x+, version 0.12 hangs on any perl, but differently: 1..4 not ok 1 - Wrote 1089 bytes when asked to send the whole file # Failed test 'Wrote 1089 bytes when asked to send the whole file' # at t/10-basics.t line 21. # got: undef # expected: '1089' Terminating on signal SIGINT(2) -- Alexandr Ciornii, http://chorny.net
Subject: Re: [rt.cpan.org #84956] hangs on perl 5.17.10, Windows
Date: Tue, 17 Dec 2013 15:15:28 +0100
To: bug-Sys-Sendfile [...] rt.cpan.org
From: Leon Timmermans <fawaka [...] gmail.com>
On Tue, Dec 17, 2013 at 9:09 AM, Alexandr Ciornii via RT < bug-Sys-Sendfile@rt.cpan.org> wrote: Show quoted text
> Queue: Sys-Sendfile > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84956 > > > Version 0.11 hanged only on 5.17.x+, version 0.12 hangs on any perl, but > differently: > 1..4 > not ok 1 - Wrote 1089 bytes when asked to send the whole file > # Failed test 'Wrote 1089 bytes when asked to send the whole file' > # at t/10-basics.t line 21. > # got: undef > # expected: '1089' > Terminating on signal SIGINT(2) >
Yeah, it seems I introduced a regression when reorganizing the code, probably in or aac2626c or f5013461. It's not obvious to me yet what I did wrong though :-(. Leon
CPAN 0.12 does not even compile on VC perl C:\sources\Sys-Sendfile-0.12>perl build test | more cl -nologo -c -nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -G7 -GL -DWIN32 -D_CONSOLE -D NO_STRICT -DPERL_TEXTMODE_SCRIPTS -DPERL_HASH_FUNC_ONE_AT_A_TIME -DNO_MATHOMS - DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -O1 -MD -Zi -DNDEBUG -G7 -GL "-DXS_VERSION=\"0.12\"" "-DVERSION=\"0.12\"" -I"C:\perl 521\lib\CORE" -I"C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\include" -Fo"lib\Sys\Sendfile.obj" "lib\Sys\Sendfile.c" Sendfile.c C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MSWSo ck.h(77) : error C2061: syntax error : identifier 'FAR' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MSWSo ck.h(77) : error C2059: syntax error : ';' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MSWSo ck.h(79) : error C2146: syntax error : missing ')' before identifier 's' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MSWSo ck.h(79) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unkno Show quoted text
wn>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MSWSo ck.h(79) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unkno Show quoted text
wn>'
between 0.11 and 0.12, the headers were rearranged so that mswsock.h in #included before all other headers, in 0.11 it looks like mswsock.h was included after perl.h (which pulled in windows.h) MS (IDK about mingw's version) mswsock.h has an include guard, but has no #include'es inside of it. "FAR" token is #defined to something else in the SDK headers, but none were included before mswsock.h so yeah. I replaced #include <mswsock.h> with #include <windows.h> as a quick hack and it compiled. 5.21, -O1, callstack args may be wrong ----------------------------------------------- Finished generating code if exist "blib\arch\auto\Sys\Sendfile\Sendfile.dll.manifest" mt -nologo -manifes t "blib\arch\auto\Sys\Sendfile\Sendfile.dll.manifest" -outputresource:"blib\arch \auto\Sys\Sendfile\Sendfile.dll";2 t\00-compile.t ............ ok t\10-basics.t ............. # Failed test 'Wrote 1089 bytes when asked to send the whole file' # at t\10-basics.t line 21. # got: undef # expected: '1089' t\10-basics.t ............. 1/4 ****HANG****** ----------------------------------------------- ntdll.dll!_KiFastSystemCallRet@0() ntdll.dll!_ZwDeviceIoControlFile@40() + 0xc mswsock.dll!_WSPRecv@36() + 0xd1 mswsock.dll!_WSPRecvFrom@44() + 0xe099 ws2_32.dll!_recvfrom@24() + 0x87 perl521.dll!win32_recvfrom(unsigned int s=0x00000004, char * buf=0x00dd5024, int len=0x00000441, int flags=0x00000000, sockaddr * from=0x0012f878, int * fromlen=0x0012fcbc) Line 481 + 0x34 C perl521.dll!PerlSockRecvfrom(IPerlSock * piPerl=0x00366350, unsigned int s=0x00000004, char * buffer=0x00dd5024, int len=0x00000441, int flags=0x00000000, sockaddr * from=0x0012f878, int * fromlen=0x0012fcbc) Line 1389 + 0x17 C perl521.dll!Perl_pp_sysread(interpreter * my_perl=0x00000400) Line 1724 + 0x1d C perl521.dll!Perl_runops_standard(interpreter * my_perl=0x00364084) Line 41 + 0x4 C perl521.dll!S_run_body(interpreter * my_perl=0x00000790, long oldscope=0x00000001) Line 2423 + 0xa C perl521.dll!perl_run(interpreter * my_perl=0x00364084) Line 2346 + 0x8 C perl521.dll!RunPerl(int argc=0x00000006, char * * argv=0x01362cf0, char * * env=0x00363180) Line 258 + 0x6 C perl.exe!mainCRTStartup() Line 398 + 0xe C kernel32.dll!_BaseProcessStart@4() + 0x23 --------------------------------------------- curcop is line 22 in t\10-basics.t --------------------------------------------- #!perl -T use strict; use warnings; use Test::More tests => 4; use Sys::Sendfile; use Fcntl 'SEEK_SET'; use IO::Socket::INET; alarm 2; my $bound = IO::Socket::INET->new(Listen => 1, ReuseAddr => 1, LocalAddr => 'localhost') or die "Couldn't make listening socket: $!"; my $in = IO::Socket::INET->new(PeerHost => $bound->sockhost, PeerPort => $bound->sockport) or die "Couldn't make input socket: $!"; my $out = $bound->accept; open my $self, '<', $0 or die "Couldn't open self: $!"; my $slurped = do { local $/; <$self> }; seek $self, 0, SEEK_SET or die "Could not seek: $!"; my $size = -s $self; is(sendfile($out, $self, $size), $size, "Wrote $size bytes when asked to send the whole file"); defined recv $in, my $read, -s $self, 0 or die "Couldn't receive: $!";<<<<<<<<<<<<LINE 22 is($read, $slurped, "Read the same as was written");
On Tue Apr 30 18:31:51 2013, CHORNY wrote: Show quoted text
> C:\strawberry\cpan\build\Sys-Sendfile-0.11-nU7wfg>perl -Mblib -T t\10- > basics.t > 1..2 > # Couldn't sendfile(): > Terminating on signal SIGINT(2)
This seems to be a consequence of 72e6b643d0 (see also http://www.nntp.perl.org/group/perl.perl5.porters/2012/09/msg193231.html). I think version 0.015 fixes this. Leon