Open garfieldnate opened 11 years ago
Thanks for the report. I might have to document that as unsupported. It falls under the warning about "Don't modify handles during a capture" and a fork definitely messes with the handles! :-)
Maybe it would be possible to replace the default fork
function with a custom one for the duration of the capture?
Although @dagolden is aware of that, just to keep this thread with all the data: this "bug" is a problem for Smoke testing under Windows.
Note to self: the hang is at the "wait" in the tee-killing function, which blocks indefinitely. Something about the fork means the tee processes never see EOF.
Wild speculating:
I suspect by EOF you mean closing of the relevant process.
I'd suspect in the case the issue is simply that on windows forks are not processes, but threads in the same process, meaning the tee processes would need to watch thread ids?
I followed the breadcrumbs from Smart::Options to Module::Build::Pluggable::CPANfile to here. If the code input to one of the capture routines contains a fork, Perl crashes. Fork also makes the tee methods hang indefinitely. A simple script to illustrate:
I wish I could contribute, but having gone down the rabbit hole I've found myself in the much more advanced bat cave :) All I know, from checking with print statements, is that the crash/hang occurs inside of the
@result = $code->()
statement, on line 363, in the_capture_tee
method.perl -V
: