develooper Front page | perl.perl5.porters | Postings from December 2012

[perl #115934] Crash in Strawberry Perl 64 5.16

Thread Next
Rob Schaber via RT
December 16, 2012 07:13
[perl #115934] Crash in Strawberry Perl 64 5.16
Message ID:
First time using this bug tracker, forgive me if I've sent this to the
wrong place. I think I am also having this issue. Here is my test script:

use threads;
use HTTP::Tiny;
my @thr = map { threads->create( sub {
	my $http = HTTP::Tiny->new( timeout => 1 );
	while (1) {
		my $res = $http->get('');
		print $res->{status}, "\n";
} ) } 1 .. 100;
$_->join() for @thr;

On my machine (Windows 7 x64, version 6.1.7601), this crashes within a
few seconds on:

ActivePerl (x64 and x86)
Strawberry (x86)
ActivePerl (x64)
ActivePerl (x64)
ActivePerl (x86) on WinXP SP3 virtual machine

...and runs indefinitely on:

Strawberry (x64)
Strawberry (x86)
Perl 5.14.2 on a Ubuntu 12.10 virtual machine

Decreasing the number of threads or increasing the length of the timeout
only seems to delay the crash. I've also replaced HTTP::Tiny with
LWP::UserAgent with similar (worse) results.

I tried to follow bulk88's suggestions in this thread regarding
debugging info, and used Visual Studio 2010's just-in-time debugger with
the .pdb files from ActiveState to get the following:



First-chance exception at 0x774512f7 in perl.exe: 0xC0000008: An invalid
handle was specified.



>	ntdll.dll!00000000774512f7() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for
 	perl516.dll!PerlLIOClose(IPerlLIO * piPerl=0x000000001378fa50, int
handle=0)  Line 948 + 0x27 bytes	C
 	perl516.dll!PerlIOUnix_close(interpreter * my_perl=0x000000001323ffd8,
_PerlIO * * f=0x0000000012f945c8)  Line 2871 + 0xf bytes	C
 	perl516.dll!PerlIOBuf_close(interpreter * my_perl=0x0000000000000001,
_PerlIO * * f=0x00000000133b5eb8)  Line 4235 + 0x85 bytes	C
 	perl516.dll!Perl_PerlIO_close(interpreter *
my_perl=0x0000000000000000, _PerlIO * * f=0x00000000133b5eb8)  Line 1487
+ 0x3c bytes	C
 	perl516.dll!Perl_io_close(interpreter * my_perl=0x0000000011718998, io
* io=0x00000000122481b8, char not_implicit='ΒΈ')  Line 980	C
 	perl516.dll!Perl_pp_close(interpreter * my_perl=0x0000000011718998) 
Line 654 + 0xe bytes	C
 	perl516.dll!Perl_runops_standard(interpreter *
my_perl=0x0000000011718998)  Line 41 + 0x6 bytes	C
 	perl516.dll!Perl_call_sv(interpreter * my_perl=0x0000000011718998, sv
* sv=0x00000000133b5e88, volatile long flags=11)  Line 2707	C
 	threads.dll!S_ithread_run(void * arg=0x0000000000000000)  Line 517 +
0x15 bytes	C



0000000077451001  add         dword ptr [rax+66000000h],896F0F44h  
000000007745100B  nop  
000000007745100C  add         byte ptr [rax],al  
000000007745100E  add         byte ptr [rsi+44h],ah  
0000000077451011  movq        mm2,mmword ptr [rcx+0A0h]  
0000000077451018  movdqa      xmm11,xmmword ptr [rcx+0B0h]  
0000000077451021  movdqa      xmm12,xmmword ptr [rcx+0C0h]  
000000007745102A  movdqa      xmm13,xmmword ptr [rcx+0D0h]  
0000000077451033  movdqa      xmm14,xmmword ptr [rcx+0E0h]  
000000007745103C  movdqa      xmm15,xmmword ptr [rcx+0F0h]  
0000000077451045  mov         rdx,qword ptr [rcx+50h]  
0000000077451049  mov         rbp,qword ptr [rcx+18h]  
000000007745104D  mov         rsp,qword ptr [rcx+10h]  
0000000077451051  jmp         rdx  
0000000077451053  mov         dword ptr [rsp+30h],80000026h  
000000007745105B  mov         dword ptr [rsp+34h],r10d  
0000000077451060  mov         qword ptr [rsp+38h],r10  
0000000077451065  mov         qword ptr [rsp+40h],r10  
000000007745106A  mov         qword ptr [rsp+28h],r10  
000000007745106F  inc         r10d  
0000000077451072  mov         dword ptr [rsp+48h],r10d  
0000000077451077  mov         qword ptr [rsp+50h],rcx  
000000007745107C  lea         rax,[rsp+60h]  
0000000077451081  mov         qword ptr [rsp+20h],rax  
0000000077451086  mov         r9,rdx  
0000000077451089  lea         r8,[rsp+30h]  
000000007745108E  mov         rdx,qword ptr [rcx+50h]  
0000000077451092  mov         rcx,qword ptr [rcx]  
0000000077451095  call        00000000774185F0  
000000007745109A  jmp         0000000077451053  
000000007745109C  nop  
000000007745109D  nop  
000000007745109E  nop  
000000007745109F  nop  
00000000774510A0  nop  
00000000774510A1  nop  
00000000774510A2  nop  
00000000774510A3  nop  
00000000774510A4  nop  
00000000774510A5  nop  
00000000774510A6  nop  
00000000774510A7  nop  
00000000774510A8  nop  
00000000774510A9  nop  
00000000774510AA  nop  
00000000774510AB  nop  
00000000774510AC  nop  
00000000774510AD  nop  
00000000774510AE  nop  
00000000774510AF  nop  
00000000774510B0  nop  
00000000774510B1  nop  
00000000774510B2  nop  
00000000774510B3  nop  
00000000774510B4  nop  
00000000774510B5  nop  
00000000774510B6  nop  
00000000774510B7  nop  
00000000774510B8  nop  
00000000774510B9  nop  
00000000774510BA  nop  
00000000774510BB  nop  
00000000774510BC  nop  
00000000774510BD  nop  
00000000774510BE  nop  
00000000774510BF  nop  
00000000774510C0  int         3  
00000000774510C1  int         3  
00000000774510C2  int         3  
00000000774510C3  int         3  
00000000774510C4  int         3  
00000000774510C5  int         3  
00000000774510C6  nop         word ptr [rax+rax]  
00000000774510D0  sub         rsp,28h  
00000000774510D4  test        dword ptr [rcx+4],66h  
00000000774510DB  je          00000000774510E2  
00000000774510DD  call        0000000077452B20  
00000000774510E2  mov         eax,1  
00000000774510E7  add         rsp,28h  
00000000774510EB  ret  
00000000774510EC  int         3  
00000000774510ED  int         3  
00000000774510EE  int         3  
00000000774510EF  int         3  
00000000774510F0  int         3  
00000000774510F1  int         3  
00000000774510F2  nop         word ptr [rax+rax]  
0000000077451100  mov         rcx,qword ptr [rsp+18h]  
0000000077451105  mov         rax,rcx  
0000000077451108  mov         r9,rsp  
000000007745110B  sar         rcx,2  
000000007745110F  mov         rdx,qword ptr [rsp+8]  
0000000077451114  neg         rcx  
0000000077451117  mov         r8,qword ptr [rsp+10h]  
000000007745111C  shld        rcx,rcx,20h  
0000000077451121  test        ecx,ecx  
0000000077451123  je          0000000077451147  
0000000077451125  mov         rcx,qword ptr [rsp]  
0000000077451129  call        rax  
000000007745112B  mov         rcx,rsp  
000000007745112E  mov         dl,1  
0000000077451130  call        0000000077451740  
0000000077451135  test        eax,eax  
0000000077451137  je          0000000077451100  
0000000077451139  mov         esi,eax  
000000007745113B  mov         ecx,esi  
000000007745113D  call        00000000774CD7C0  
0000000077451142  nop  
0000000077451143  jmp         0000000077451145  
0000000077451145  jmp         000000007745113E  
0000000077451147  mov         eax,dword ptr [rsp]  
000000007745114A  or          rcx,rax  
000000007745114D  mov         rax,qword ptr [7753A8D8h]  
0000000077451154  test        rax,rax  
0000000077451157  je          000000007745112B  
0000000077451159  call        rax  
000000007745115B  mov         esi,0C000000Dh  
0000000077451160  jmp         000000007745113B  
0000000077451162  int         3  
0000000077451163  int         3  
0000000077451164  int         3  
0000000077451165  int         3  
0000000077451166  int         3  
0000000077451167  int         3  
0000000077451168  nop         word ptr [rax+rax]  
0000000077451173  sub         rsp,38h  
0000000077451177  mov         rax,qword ptr gs:[60h]  
0000000077451180  mov         r9,qword ptr [rax+20h]  
0000000077451184  test        byte ptr [r9+0Ah],8  
0000000077451189  jne         000000007745119A  
000000007745118B  mov         rdx,r8  
000000007745118E  call        00000000774E6890  
0000000077451193  mov         eax,0  
0000000077451198  jmp         00000000774511E3  
000000007745119A  test        byte ptr [rcx+4],66h  
000000007745119E  jne         00000000774511D8  
00000000774511A0  mov         qword ptr [rsp+28h],0  
00000000774511A9  mov         qword ptr [rsp+20h],r8  
00000000774511AE  mov         r9d,dword ptr [rcx]  
00000000774511B1  mov         dword ptr [rsp+30h],r9d  
00000000774511B6  mov         r8,rcx  
00000000774511B9  mov         rcx,rdx  
00000000774511BC  lea         rdx,[77451225h]  
00000000774511C3  call        00000000774185F0  
00000000774511C8  mov         esi,dword ptr [rsp+30h]  
00000000774511CC  mov         ecx,esi  
00000000774511CE  call        00000000774CD7C0  
00000000774511D3  nop  
00000000774511D4  jmp         00000000774511D6  
00000000774511D6  jmp         00000000774511CF  
00000000774511D8  test        byte ptr [rcx+4],20h  
00000000774511DC  je          00000000774511E8  
00000000774511DE  mov         eax,1  
00000000774511E3  add         rsp,38h  
00000000774511E7  ret  
00000000774511E8  mov         r8d,dword ptr [rcx]  
00000000774511EB  xor         ecx,ecx  
00000000774511ED  xor         edx,edx  
00000000774511EF  call        0000000077451360  
00000000774511F4  mov         esi,eax  
00000000774511F6  jmp         00000000774511CC  
00000000774511F8  int         3  
00000000774511F9  int         3  
00000000774511FA  int         3  
00000000774511FB  int         3  
00000000774511FC  int         3  
00000000774511FD  int         3  
00000000774511FE  nop         dword ptr [rax+rax]  
0000000077451206  mov         rcx,qword ptr [rsp+20h]  
000000007745120B  mov         edx,dword ptr [rsp+28h]  
000000007745120F  mov         r8d,dword ptr [rsp+2Ch]  
0000000077451214  mov         rax,qword ptr gs:[60h]  
000000007745121D  mov         r9,qword ptr [rax+58h]  
0000000077451221  call        qword ptr [r9+r8*8]  
0000000077451225  xor         ecx,ecx  
0000000077451227  xor         edx,edx  
0000000077451229  mov         r8d,eax  
000000007745122C  call        0000000077451360  
0000000077451231  mov         esi,eax  
0000000077451233  mov         ecx,esi  
0000000077451235  call        00000000774CD7C0  
000000007745123A  nop  
000000007745123B  jmp         000000007745123D  
000000007745123D  jmp         0000000077451236  
000000007745123F  nop  
0000000077451240  int         3  
0000000077451241  int         3  
0000000077451242  int         3  
0000000077451243  int         3  
0000000077451244  int         3  
0000000077451245  int         3  
0000000077451246  nop         dword ptr [rax]  
000000007745124A  cld  
000000007745124B  mov         rax,qword ptr [7753A8E0h]  
0000000077451252  test        rax,rax  
0000000077451255  je          0000000077451266  
0000000077451257  mov         rcx,rsp  
000000007745125A  add         rcx,4F0h  
0000000077451261  mov         rdx,rsp  
0000000077451264  call        rax  
0000000077451266  mov         rcx,rsp  
0000000077451269  add         rcx,4F0h  
0000000077451270  mov         rdx,rsp  
0000000077451273  call        0000000077418E20  
0000000077451278  test        al,al  
000000007745127A  je          0000000077451288  
000000007745127C  mov         rcx,rsp  
000000007745127F  xor         edx,edx  
0000000077451281  call        000000007745093F  
0000000077451286  jmp         000000007745129D  
0000000077451288  mov         rcx,rsp  
000000007745128B  add         rcx,4F0h  
0000000077451292  mov         rdx,rsp  
0000000077451295  xor         r8b,r8b  
0000000077451298  call        0000000077452630  
000000007745129D  mov         ecx,eax  
000000007745129F  call        00000000774CD7C0  
00000000774512A4  nop  
00000000774512A5  jmp         00000000774512A7  
00000000774512A7  nop  
00000000774512A8  int         3  
00000000774512A9  int         3  
00000000774512AA  int         3  
00000000774512AB  int         3  
00000000774512AC  int         3  
00000000774512AD  int         3  
00000000774512AE  nop         word ptr [rax+rax]  
00000000774512BD  sub         rsp,0C8h  
00000000774512C4  mov         dword ptr [rsp+0C0h],eax  
00000000774512CB  mov         eax,dword ptr gs:[2C0h]  
00000000774512D3  lea         rcx,[rsp+20h]  
00000000774512D8  mov         dword ptr [rcx],eax  
00000000774512DA  xor         eax,eax  
00000000774512DC  mov         dword ptr [rcx+4],eax  
00000000774512DF  mov         qword ptr [rcx+8],rax  
00000000774512E3  mov         rdx,qword ptr [rsp+0C8h]  
00000000774512EB  mov         qword ptr [rcx+10h],rdx  
00000000774512EF  mov         dword ptr [rcx+18h],eax  
00000000774512F2  call        0000000077419560  
00000000774512F7  mov         eax,dword ptr [rsp+0C0h]  


C:\Perl>perl -V
Summary of my perl5 (revision 5 version 16 subversion 1) configuration:

    osname=MSWin32, osvers=5.2, archname=MSWin32-x64-multi-thread
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL
-fp:precise -DWIN32 -D_CONSOLE -DNO_
    optimize='-MD -Zi -DNDEBUG -Ox -GL -fp:precise',
    ccversion='16.0.40219', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='__int64', ivsize=8, nvtype='double', nvsize=8,
Off_t='__int64', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg
"  -machine:AMD64'
    libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shel
l32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib
winmm.lib  version.lib odbc
32.lib odbccp32.lib comctl32.lib  msvcrt.lib
    perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
 comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib
mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib comctl32.lib  msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl516.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf -ltcg  -libpath:"C:\Pe
rl\lib\CORE"  -machine:AMD64'

Characteristics of this binary (from libperl):
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
  Locally applied patches:
        ActivePerl Build 1601 [296175]
  Built under MSWin32
  Compiled at Aug 30 2012 18:41:50


Hopefully some of that is relevant. I don't really know my way around a
C debugger. If additional info is needed, I'm willing to try to get it,
with some coaching.


via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About