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

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

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
May 29, 2013 06:48
Subject:
[perl #38723] Backticks don't work in Win32 multithreaded perl
Message ID:
rt-3.6.HEAD-2650-1369810075-1227.38723-15-0@perl.org
On Tue May 28 17:25:06 2013, krzysztofk wrote:
> OK - compiling with� -DUSE_RTL_POPEN solved my problem, but introduces
> some other.
> 
> Perl compiled with that option did not pass the tests.
> Some time later I was able to find the problem:
> win32_popen modifies stdout handle so
> � A) It should not be called if there is some operation in progress on
> stdout in another thread
> � B) There is a race condition on modifying stdout.
> Attached patch ( popen5a,patch ) for perl 5.8.8 solved the problem.
> �For problem A I used critical section for files used by RTL.
> �For problem B I used a new critical section ( I added initialization
> to Perl_win32_init ).
> 
> The patch cannot be used with newer perls, because "critical section
> for files used by RTL" ( _pioinfo ) is no longer defined in Win32.c
> 
> 
> 
> 
> 

Turns out I was wrong. There is a bug here. In my output I posted above
I didn't notice iteration "3" and "4" only appeared once. _pioinfo is a
symbol that is a pointer to an array of ioinfo structs within the MS
CRT. You can't just acquire the CS in the pioinfo, there is another
member that needs to be checked.
http://perl5.git.perl.org/perl.git/commitdiff/9b1f18150adf6630261f4d4a81b0a75ba6abaf97
is where Perl's use of _pioinfo was removed. There already is a
serialization lock in win32_popen "    OP_REFCNT_LOCK;". Why isn't it
"working"?

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/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