Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MCE CPAN distribution.

Report information
The Basics
Id: 85862
Status: resolved
Priority: 0/
Queue: MCE

People
Owner: Nobody in particular
Requestors: frank.wang [...] validusresearch.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: run forseq sample code in perl debugger show An unhandled win32 exception occurred in perl.exe [10576].
Date: Tue, 4 Jun 2013 17:08:54 -0400
To: "'bug-MCE [...] rt.cpan.org'" <bug-MCE [...] rt.cpan.org>
From: Frank Wang <frank.wang [...] validusresearch.com>
Run the following sample code from https://metacpan.org/module/MCE: C:\Perl64\bin>perl -de 0 Loading DB routines from perl5db.pl version 1.32 Editor support available. Enter h or h h' for help, orperldoc perldebug' for more help. main::(-e:1): 0 DB use MCE DB $mce = MCE->new(max_workers => 4) DB $mce->forseq({ begin => 15, end => 10, step => -1 }, sub { \ cont: ($self, $n, $chunk_id) = @_; \ cont: print $n, " from ",$chunk_id , ", " , $self->wid(), "\n"; }); 15 from 1, 3 14 from 2, 4 13 from 3, 1 12 from 4, 2 11 from 5, 4 10 from 6, 3 Then a just-in-time debugger pop up and says: Unhandled exception at 0x281272f0 in perl.exe: 0xC0000005: Access violation reading location 0x000000ff00000012. Show quoted text
______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com
______________________________________________________________________
Hi Frank, Thank you for the report. I tried to reproduce the error. However, I'm not able to reproduce the "Unhandled exception" that you are seeing (testing with ActiveState Perl 5.16.1). Have you tried including threads to see if that helps. btw, using threads is working -- shown below after the first test case below. Best Regards, Mario ################################################ ## This is what I got (forking). ################################################ Z:\mce\MCE-1.410\examples>perl -de 0 Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(-e:1): 0 DB<1> use Cwd qw(abs_path); DB<2> use lib abs_path . "/../lib"; DB<3> use MCE; DB<4> $mce = MCE->new(max_workers => 4); DB<5> $mce->forseq({ begin => 15, end => 10, step => -1 }, sub { \ cont: ($self, $n, $chunk_id) = @_; \ cont: print $n, " from ", $chunk_id , ", " , $self->wid(), "\n"; }); 15 from 1, 2 14 from 2, 4 13 from 3, 1 12 from 4, 3 11 from 5, 2 10 from 6, 4 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. ######### Forked, but do not know how to create a new TTY. ######### ######### Forked, but do not know how to create a new TTY. ######### ######### Forked, but do not know how to create a new TTY. ######### ######### Forked, but do not know how to create a new TTY. ######### Since two debuggers fight for the same TTY, input is severely entangled. Since two debuggers fight for the same TTY, input is severely entangled. Since two debuggers fight for the same TTY, input is severely entangled. Since two debuggers fight for the same TTY, input is severely entangled. I know how to switch the output to a different window in xterms, OS/2 consoles, and Mac OS X Terminal.app only. For a manual switch, put the name of the created TTY in $DB::fork_TTY, or define a function DB::get_fork_TTY() returning this. On UNIX-like systems one can get the name of a TTY for the given window by typing tty, and disconnect the shell from TTY by sleep 1000000. ################################################ ## Trying the same by including threads -- this is working. ################################################ Z:\mce\MCE-1.410\examples>perl -de 0 Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(-e:1): 0 DB<1> use Cwd qw(abs_path); DB<2> use lib abs_path . "/../lib"; DB<3> use threads; DB<4> use threads::shared; DB<5> use MCE; DB<6> $mce = MCE->new(max_workers => 4); DB<7> $mce->forseq({ begin => 15, end => 10, step => -1 }, sub { \ cont: ($self, $n, $chunk_id) = @_; \ cont: print $n, " from ", $chunk_id , ", ", $self->wid(), "\n"; }); 15 from 1, 4 13 from 3, 1 12 from 4, 3 14 from 2, 2 11 from 5, 4 10 from 6, 1 DB<8>
Subject: RE: [rt.cpan.org #85862] run forseq sample code in perl debugger show An unhandled win32 exception occurred in perl.exe [10576].
Date: Wed, 5 Jun 2013 08:50:21 -0400
To: "bug-MCE [...] rt.cpan.org" <bug-MCE [...] rt.cpan.org>
From: Frank Wang <frank.wang [...] validusresearch.com>
Hi Mario, Thank you so much: add the "use threads" then no longer crash. (I am using Active Perl 5.10.1.) Just wandering why such a seems irrelevant directive could do the trick? Best Regards, Frank Show quoted text
-----Original Message----- From: Mario Roy via RT [mailto:bug-MCE@rt.cpan.org] Sent: Tuesday, June 04, 2013 8:17 PM To: Frank Wang Subject: [rt.cpan.org #85862] run forseq sample code in perl debugger show An unhandled win32 exception occurred in perl.exe [10576]. <URL: https://rt.cpan.org/Ticket/Display.html?id=85862 > Hi Frank, Thank you for the report. I tried to reproduce the error. However, I'm not able to reproduce the "Unhandled exception" that you are seeing (testing with ActiveState Perl 5.16.1). Have you tried including threads to see if that helps. btw, using threads is working -- shown below after the first test case below. Best Regards, Mario ################################################ ## This is what I got (forking). ################################################ Z:\mce\MCE-1.410\examples>perl -de 0 Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(-e:1): 0 DB<1> use Cwd qw(abs_path); DB<2> use lib abs_path . "/../lib"; DB<3> use MCE; DB<4> $mce = MCE->new(max_workers => 4); DB<5> $mce->forseq({ begin => 15, end => 10, step => -1 }, sub { \ cont: ($self, $n, $chunk_id) = @_; \ cont: print $n, " from ", $chunk_id , ", " , $self->wid(), "\n"; }); 15 from 1, 2 14 from 2, 4 13 from 3, 1 12 from 4, 3 11 from 5, 2 10 from 6, 4 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. ######### Forked, but do not know how to create a new TTY. ######### ######### Forked, but do not know how to create a new TTY. ######### ######### Forked, but do not know how to create a new TTY. ######### ######### Forked, but do not know how to create a new TTY. ######### Since two debuggers fight for the same TTY, input is severely entangled. Since two debuggers fight for the same TTY, input is severely entangled. Since two debuggers fight for the same TTY, input is severely entangled. Since two debuggers fight for the same TTY, input is severely entangled. I know how to switch the output to a different window in xterms, OS/2 consoles, and Mac OS X Terminal.app only. For a manual switch, put the name of the created TTY in $DB::fork_TTY, or define a function DB::get_fork_TTY() returning this. On UNIX-like systems one can get the name of a TTY for the given window by typing tty, and disconnect the shell from TTY by sleep 1000000. ################################################ ## Trying the same by including threads -- this is working. ################################################ Z:\mce\MCE-1.410\examples>perl -de 0 Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(-e:1): 0 DB<1> use Cwd qw(abs_path); DB<2> use lib abs_path . "/../lib"; DB<3> use threads; DB<4> use threads::shared; DB<5> use MCE; DB<6> $mce = MCE->new(max_workers => 4); DB<7> $mce->forseq({ begin => 15, end => 10, step => -1 }, sub { \ cont: ($self, $n, $chunk_id) = @_; \ cont: print $n, " from ", $chunk_id , ", ", $self->wid(), "\n"; }); 15 from 1, 4 13 from 3, 1 12 from 4, 3 14 from 2, 2 11 from 5, 4 10 from 6, 1 DB<8>
______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________
______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com
______________________________________________________________________
Hi Frank, Including threads will cause MCE to use threads instead of forking. Forking requires a separate tty per forked process when running Perl in debugger mode. I ran Perl in debug mode and got the same error message by just typing fork without including MCE. Best Regards, Mario