soliplaya has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks (and maybe rcaputo in particular),
Platform: osname=MSWin32, osvers=6.3, archname=MSWin32-x86-multi-thread uname='Win32 strawberry-perl-no64 5.18.4.1 #1 Thu Oct 2 16:30:08 +2014 i386'
This code :
log_msg(0,"$pfx: starting child with command [$trigger]") +if $DEBUG; eval { $kid = POE::Wheel::Run->new( 'CloseEvent' => 'kidclose', 'Program' => $trigger, 'StderrEvent' => 'kidstderr', 'StdoutEvent' => 'kidstdout', 'ErrorEvent' => 'errorstate', ); };
results in a program crash (after 5 seconds), and in the following error in the Windows Application Event log :

Application Failure perl.exe 5.18.4.1 in encoding.dll 0.0.0.0 at offset 0000374

(in several versions of Perl, ActiveState and Strawberry). In the logfile of the program calling the above, there is this :
[2016/09/30-21:53:09] [I] process(): starting child with command [E:\M +IRA\strawberry\perl\bin\perl C:/EFS/bin/(myWheel).pl --debug 2 (...) + "E:\MIRA\Migration\medfolio_test\NxExport\output\Alles/FOLDER_414860 +93_177671_4/OVERVIEW.xml"] [2016/09/30-21:53:14] [E] select: at E:/MIRA/strawberry/perl/site/lib +/IO/Pipely.pm line 127.
Which would correspond to this section in IO::Pipely.pm :
120: my $hits = select( my $out_read = $in_read, 121: my $out_write = $in_write, 122: undef, 123: 5 124: ); 125: unless ($hits) { 126: next if ($! and ($! == EINPROGRESS) or ($! == EWOULDBLOCK)); 127: die "select: $!" unless $hits; 128: }
(which (timeout value) "5" above seems to be the time between the 2 log messages above)(and indeed if I change this value in Pipely.pm, the crash happens correspondingly later). The above happens on a Windows 2003 R2 Server. It is quite troubling, because the same calling program and the same "Wheel" program, running on the same data, under the same version of perl (and of POE), on another machine (Windows XP SP3), works perfectly fine. To add to the puzzle : another older version of the same calling program, using the same Wheel starting code as shown above, on the same Win2003 server, works perfectly fine too, since years. The only link that I can think of, with the Event error mentioning "encoding.dll", is that the Wheel program at some point opens a file with UTF-16 encoding, like this :
my $fh; unless (open($fh,'<:encoding(UTF-16)',$ov_file)) { ...
but again, under Windows XP, this works fine, with the same file opened and then parsed. (and before it does that, the Wheel prints some log messages, which normally appear in the same application log above, but in this case do not). Humbly awaiting any idea or suggestion, cause I don't know where to look anymore.

Replies are listed 'Best First'.
Re: POE / Win32 / select ?
by Anonymous Monk on Sep 30, 2016 at 21:22 UTC
      Thanks for the tip. I looked at the various pages you pointed out, and it seemed to me that none of them really corresponded to what I am doing. But I figured, what the heck, by now I am ready to try anything, so I did update to Strawberry Perl v 5.20.3 and tried again. The result changes slightly, in the sense that now that last message the program puts in the log is :

      2016/10/01-12:13:37 I process(): starting child with command [E:\MIRA\strawberry\perl\bin\perl C:/EFS/bin/MiraAdd_medfolio.pl .. renoved .. "E:\MIRA\Migration\medfolio_test\NxExport\output\Alles/FOLDER_41486093_177671_12/OVERVIEW.xml"]

      and I do not see the "select:" error message anymore. But the program stops just as dead in its tracks. In the Windows Application Event log, the message also changed slightly, and now says :

      Application Failure perl.exe 5.20.3.3 in encoding.xs.dll 0.0.0.0 at offset 000014ea

      So it is no longer "encoding.dll", but instead "encoding.xs.dll". Any other ideas/suggestions/questions ?