develooper Front page | perl.perl5.porters | Postings from March 2014

[perl #38723] Backticks don't work in Win32 multithreaded perl

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
March 24, 2014 07:29
Subject:
[perl #38723] Backticks don't work in Win32 multithreaded perl
Message ID:
rt-4.0.18-8700-1395646134-1471.38723-15-0@perl.org
The deadlock is like this, from outer most lock waiter, to lock owner.

---------------------------------------------------
 	ntdll.dll!_KiFastSystemCallRet@0() 	
 	ntdll.dll!_ZwWaitForSingleObject@12()  + 0xc	
 	ntdll.dll!_RtlpWaitForCriticalSection@4()  + 0x8c	
 	ntdll.dll!_RtlEnterCriticalSection@4()  + 0x46	
 	msvcrt.dll!__lock_fhandle()  + 0x70	
 	msvcrt.dll!__write()  + 0x3d	
	perl510.dll!win32_write(int fd=1, const void * buf=0x07af4324, unsigned int cnt=25)  Line 3701 + 0x12	C
 	perl510.dll!PerlLIOWrite(IPerlLIO * piPerl=0x07a57cc4, int handle=1, const void * buffer=0x07af4324, unsigned int count=25)  Line 1094 + 0x11	C++
 	perl510.dll!PerlIOUnix_write(interpreter * my_perl=0x07a50964, _PerlIO * * f=0x07a5e31c, const void * vbuf=0x07af4324, unsigned int count=25)  Line 2711 + 0x1a	C
 	perl510.dll!Perl_PerlIO_write(interpreter * my_perl=0x07a50964, _PerlIO * * f=0x07a5e31c, const void * vbuf=0x07af4324, unsigned int count=25)  Line 1643 + 0x2b	C
 	perl510.dll!PerlIOBuf_flush(interpreter * my_perl=0x07a50964, _PerlIO * * f=0x07af4324)  Line 3748 + 0x10	C
 	perl510.dll!PerlIOCrlf_flush(interpreter * my_perl=0x07a50964, _PerlIO * * f=0x07a5e174)  Line 4585 + 0xa	C
 	perl510.dll!Perl_PerlIO_flush(interpreter * my_perl=0x07a50964, _PerlIO * * f=0x07a5e174)  Line 1668 + 0x6	C
 	perl510.dll!PerlIOCrlf_write(interpreter * my_perl=0x07a50964, _PerlIO * * f=0x07a5e174, const void * vbuf=0x07aff8fc, unsigned int count=128973076)  Line 4566 + 0x9	C
 	perl510.dll!Perl_PerlIO_write(interpreter * my_perl=0x07a50964, _PerlIO * * f=0x07a5e174, const void * vbuf=0x07aff8fc, unsigned int count=24)  Line 1643 + 0x2b	C
 	perl510.dll!Perl_do_print(interpreter * my_perl=0x07a50964, sv * sv=0x01a5ba8c, _PerlIO * * fp=0x07a5e174)  Line 1247 + 0x13	C
 	perl510.dll!Perl_pp_print(interpreter * my_perl=0x07a77220)  Line 778 + 0xb	C
 	perl510.dll!Perl_runops_standard(interpreter * my_perl=0x07a50964)  Line 36 + 0xc	C
 	perl510.dll!win32_start_child(void * arg=0x07a50964)  Line 1769 + 0x7	C++
 	kernel32.dll!_BaseThreadStart@8()  + 0x37	

------------------------------------------------------

at "		print "Process $num iteration $_\n";" waits on CS held by thread

------------------------------------------------------
 	ntdll.dll!_KiFastSystemCallRet@0() 	
 	ntdll.dll!_ZwWriteFile@36()  + 0xc	
 	kernel32.dll!_WriteFile@20()  + 0x6f	
 	msvcrt.dll!__write_lk()  + 0x10f	
 	msvcrt.dll!__write()  + 0x57	
	perl510.dll!win32_write(int fd=1, const void * buf=0x07aea76c, unsigned int cnt=25)  Line 3701 + 0x12	C
 	perl510.dll!PerlLIOWrite(IPerlLIO * piPerl=0x07968ccc, int handle=1, const void * buffer=0x07aea76c, unsigned int count=25)  Line 1094 + 0x11	C++
 	perl510.dll!PerlIOUnix_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f374, const void * vbuf=0x07aea76c, unsigned int count=25)  Line 2711 + 0x1a	C
 	perl510.dll!Perl_PerlIO_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f374, const void * vbuf=0x07aea76c, unsigned int count=25)  Line 1643 + 0x2b	C
 	perl510.dll!PerlIOBuf_flush(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x07aea76c)  Line 3748 + 0x10	C
 	perl510.dll!PerlIOCrlf_flush(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc)  Line 4585 + 0xa	C
 	perl510.dll!Perl_PerlIO_flush(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc)  Line 1668 + 0x6	C
 	perl510.dll!PerlIOCrlf_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc, const void * vbuf=0x07ae8114, unsigned int count=128876844)  Line 4566 + 0x9	C
 	perl510.dll!Perl_PerlIO_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc, const void * vbuf=0x07ae8114, unsigned int count=24)  Line 1643 + 0x2b	C
 	perl510.dll!Perl_do_print(interpreter * my_perl=0x07961c4c, sv * sv=0x0196ca8c, _PerlIO * * fp=0x0796f1cc)  Line 1247 + 0x13	C
 	perl510.dll!Perl_pp_print(interpreter * my_perl=0x079880f8)  Line 778 + 0xb	C
 	perl510.dll!Perl_runops_standard(interpreter * my_perl=0x07961c4c)  Line 36 + 0xc	C
 	perl510.dll!win32_start_child(void * arg=0x07961c4c)  Line 1769 + 0x7	C++
 	kernel32.dll!_BaseThreadStart@8()  + 0x37	
--------------------------------------------------------------

which is at "		print "Process $num iteration $_\n";"

I can't easily trace this any further since this is blocked IO now.

Another kind of thread in the process

--------------------------------------------------------------
 	ntdll.dll!_KiFastSystemCallRet@0() 	
 	ntdll.dll!_ZwWaitForSingleObject@12()  + 0xc	
 	ntdll.dll!_RtlpWaitForCriticalSection@4()  + 0x8c	
 	ntdll.dll!_RtlEnterCriticalSection@4()  + 0x46	
	perl510.dll!win32_popen(const char * command=0x0799a924, const char * mode=0x280b3b1c)  Line 3031	C
 	perl510.dll!PerlProcPopen(IPerlProc * piPerl=0x07983608, const char * command=0x0799a924, const char * mode=0x280b3b1c)  Line 1635 + 0xd	C++
 	perl510.dll!Perl_pp_backtick(interpreter * my_perl=0x0799a924)  Line 316 + 0xe	C
 	perl510.dll!Perl_runops_standard(interpreter * my_perl=0x07983f5c)  Line 36 + 0xc	C
 	perl510.dll!win32_start_child(void * arg=0x07983f5c)  Line 1769 + 0x7	C++
 	kernel32.dll!_BaseThreadStart@8()  + 0x37	
---------------------------------------------------------------

at line "		`dir`;" is waiting on CS held by thread

---------------------------------------------------------------
 	ntdll.dll!_KiFastSystemCallRet@0() 	
 	ntdll.dll!_ZwWaitForSingleObject@12()  + 0xc	
 	ntdll.dll!_RtlpWaitForCriticalSection@4()  + 0x8c	
 	ntdll.dll!_RtlEnterCriticalSection@4()  + 0x46	
 	msvcrt.dll!__lock_fhandle()  + 0x70	
 	msvcrt.dll!__dup2()  + 0x74	
	perl510.dll!win32_dup2(int fd1=15, int fd2=1)  Line 3489 + 0xe	C
 	perl510.dll!win32_popen(const char * command=0x00002b3c, const char * mode=0x280b3b1c)  Line 3055 + 0xb	C
 	perl510.dll!PerlProcPopen(IPerlProc * piPerl=0x01902a28, const char * command=0x01912394, const char * mode=0x280b3b1c)  Line 1635 + 0xd	C++
 	perl510.dll!Perl_pp_backtick(interpreter * my_perl=0x01912394)  Line 316 + 0xe	C
 	perl510.dll!Perl_runops_standard(interpreter * my_perl=0x018fb5b4)  Line 36 + 0xc	C
 	perl510.dll!win32_start_child(void * arg=0x018fb5b4)  Line 1769 + 0x7	C++
 	kernel32.dll!_BaseThreadStart@8()  + 0x37	
---------------------------------------------------------------

which is at line "		`dir`;" which is waiting on CS lock held by thread (we saw this thread above already)

---------------------------------------------------------------
 	ntdll.dll!_KiFastSystemCallRet@0() 	
 	ntdll.dll!_ZwWriteFile@36()  + 0xc	
 	kernel32.dll!_WriteFile@20()  + 0x6f	
 	msvcrt.dll!__write_lk()  + 0x10f	
 	msvcrt.dll!__write()  + 0x57	
	perl510.dll!win32_write(int fd=1, const void * buf=0x07aea76c, unsigned int cnt=25)  Line 3701 + 0x12	C
 	perl510.dll!PerlLIOWrite(IPerlLIO * piPerl=0x07968ccc, int handle=1, const void * buffer=0x07aea76c, unsigned int count=25)  Line 1094 + 0x11	C++
 	perl510.dll!PerlIOUnix_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f374, const void * vbuf=0x07aea76c, unsigned int count=25)  Line 2711 + 0x1a	C
 	perl510.dll!Perl_PerlIO_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f374, const void * vbuf=0x07aea76c, unsigned int count=25)  Line 1643 + 0x2b	C
 	perl510.dll!PerlIOBuf_flush(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x07aea76c)  Line 3748 + 0x10	C
 	perl510.dll!PerlIOCrlf_flush(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc)  Line 4585 + 0xa	C
 	perl510.dll!Perl_PerlIO_flush(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc)  Line 1668 + 0x6	C
 	perl510.dll!PerlIOCrlf_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc, const void * vbuf=0x07ae8114, unsigned int count=128876844)  Line 4566 + 0x9	C
 	perl510.dll!Perl_PerlIO_write(interpreter * my_perl=0x07961c4c, _PerlIO * * f=0x0796f1cc, const void * vbuf=0x07ae8114, unsigned int count=24)  Line 1643 + 0x2b	C
 	perl510.dll!Perl_do_print(interpreter * my_perl=0x07961c4c, sv * sv=0x0196ca8c, _PerlIO * * fp=0x0796f1cc)  Line 1247 + 0x13	C
 	perl510.dll!Perl_pp_print(interpreter * my_perl=0x079880f8)  Line 778 + 0xb	C
 	perl510.dll!Perl_runops_standard(interpreter * my_perl=0x07961c4c)  Line 36 + 0xc	C
 	perl510.dll!win32_start_child(void * arg=0x07961c4c)  Line 1769 + 0x7	C++
 	kernel32.dll!_BaseThreadStart@8()  + 0x37	
--------------------------------------------------




-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=38723

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