Closed fecundf closed 8 years ago
Turns out the only "local" statments that make Win32 crash in Capture::Tiny are the local $@
statements, which are simple to fudge with lexicals. I have a patch with a rudimentary test 25-cap-fork.t
which I will send as a pull request.
Alas, the new test shows that there are other problems capturing from forked code, at least on Windows, but at least it isn't a hard crash any more.
Fixed via #31
Due to perl bug https://rt.perl.org/Public/Bug/Display.html?id=40565 "Windows fork emulation's child pseudo process cannot restore local scalar values", Capture::Tiny crashes under MSWin32 (ActiveState, Strawberry) when the captured code forks.
I've forked this and created a test that shows the behavior, and I believe I can fix it by removing some "local" statements and emulating it. The test is at https://github.com/fecundf/Capture-Tiny/blob/master/t/25-cap-fork.t and I will write back after my patch attempt.
Related issues: rt.cpan.org #71701 "No STDERR capture from XS/C under Windows" The new test also fails to capture stderr from the child process, when run via a msys 5.8.8 perl
I think this is different from https://github.com/dagolden/Capture-Tiny/issues/12 since it is not related to "tee"