Hello dchidelf, and welcome to the Monastery!
I can’t pretend to understand what your code is doing, but I’ve done some debugging on it and I’ll share my findings in the hope that they help. My system is as follows:
22:56 >perl -v This is perl 5, version 22, subversion 1 (v5.22.1) built for MSWin32-x +64-multi-thread ...
First, a couple of minor problems: (1) There’s a semicolon missing in the test script at the end of the line: print $in "HI AGAIN\n". (2) The second return statement in ProcInHandle::PRINT can never be reached.
Now, to the main issue. When I run the test script it either crashes (“Perl interpreter has stopped working”) or reports panic: COND_DESTROY (6). But whereas for you the interpreter ”eventually crashes,” I’ve found that if I change the for loop in the test script to make just two iterations, the script reliably crashes on the second.
The crash occurs during the call $p->close(); on the second iteration of the for loop. Further, within ProcOpen::close the crash occurs in the line $othr->join(). If I comment out that line, the crash occurs in the line $ethr->join(). And if I comment out both of those lines, the script runs successfully to completion after 25 iterations, but of course leaves active threads:
... LOOP DONE ProcOpen[DEBUG] Requested close on ProcOpen Object About to close Join Threads threads=SCALAR(0x28d9080) threads=SCALAR(0x28da680) part done Join Threads threads=SCALAR(0x28d9080) threads=SCALAR(0x28da680) Threads joined WORKED!! Perl exited with active threads: 0 running and unjoined 50 finished and unjoined 0 running and detached 23:27 >
Maybe this will give you (or one of the other monks) a clue as to what is going wrong.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Having Win32 Perl crashes using ithreads
by Athanasius
in thread Having Win32 Perl crashs using ithreads
by dchidelf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |