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

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

Thread Previous | Thread Next
bulk88 via RT
May 29, 2013 06:48
[perl #38723] Backticks don't work in Win32 multithreaded perl
Message ID:
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.
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

bulk88 ~ bulk88 at

via perlbug:  queue: perl5 status: open

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