Skip Menu |

This queue is for tickets about the Math-Random-MT-Auto CPAN distribution.

Report information
The Basics
Id: 80054
Status: resolved
Priority: 0/
Queue: Math-Random-MT-Auto

People
Owner: Nobody in particular
Requestors: SLAFFAN [...] cpan.org
Cc:
AdminCc:

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



Subject: Misleading error messages due to MRMA object destruction
Hi Jerry, As promised (some time ago) here is a report about MRMA producing potentially misleading error messages. It's more of an enhancement request than a bug. A script is attached to reproduce what happens. In essence, if a non-blessed exception is thrown in code that contains a MRMA object then the error handling in the object destruction modifies the error, labelling it as an OIO error and starting a stack trace from within the object destruction code. The rest of the details still point to the original source of the error, so it is just the embellishments that MRMA (or OIO) is adding that are the issue here. If the exception is blessed then it passes straight through. One possible solution/workaround is to check the stack and see if the source is in an OIO or MRMA module and only then add the embellishments. I'm not sure how simple (or brittle) that is, as other classes might be extending OIO or MRMA. Alternately the error message could be edited to say something along the lines of "possible OIO error", unless it definitely comes from OIO or MRMA code. Regards, Shawn.
Subject: misleading_exception.pl
use strict; use warnings; use Carp; use Math::Random::MT::Auto; use Exception::Class ('MyException'); my %die_types = ( 'Blessed exception' => sub {MyException->throw ('Blessed exception thrown')}, 'croak' => sub {croak 'Croaking'}, 'die' => sub {die 'Dying'}, ); while (my ($type, $sub) = each %die_types) { print "---- $type:\n\n"; eval { runner ($sub); }; print $@ if $@; print "\n\n\n"; } sub runner { my $sub = shift; my $prng = Math::Random::MT::Auto->new; &$sub(); }
On 2012-10-07 19:21:04, SLAFFAN wrote: Show quoted text
> A script is attached to reproduce what happens.
Issue produced with ActivePerl 5.8.9. Not reproduced with Perl 5.16.1.
Subject: Re: [rt.cpan.org #80054] Misleading error messages due to MRMA object destruction
Date: Wed, 10 Oct 2012 11:03:56 +1100
To: bug-Math-Random-MT-Auto [...] rt.cpan.org
From: Shawn Laffan <shawnlaffan [...] gmail.com>
Which flavour of perl 5.16.1 did you use? I just tried with ActivePerl 5.16.1 (win64) and get segfaults when using MRMA (details below). But, to focus on the original report first, if newer versions of perl don't show the behaviour then maybe a short note could be added to the documentation if you think it's worthwhile. If it's an activeperl difference (which seems hard to test given my above errors) then documentation is probably the way to go also. Regards, Shawn. MRMA seg fault details: I installed it using the ActiveState PPM build (MRMA 6.21), but I also get segfaults in testing when attempting to upgrade to 6.22 via cpan. The segfaults could be something going awry with my setup, but the activeperl ppm4 utility shows build failures for 6.22. http://code.activestate.com/ppm/Math-Random-MT-Auto/ The first two of these commands throw seg faults (windows error: Perl command line interpreter has stopped working): # segfaults perl -MMath::Random::MT::Auto -e"" perl -e "use Math::Random::MT::Auto" # does nothing, so works as expected perl -e "require Math::Random::MT::Auto" # This throws an OIO error, can't use undefined value as reference, line 255. perl -e "require Math::Random::MT::Auto; my $mrma = Math::Random::MT::Auto->new()" On 10 October 2012 00:10, Jerry D. Hedden via RT < bug-Math-Random-MT-Auto@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=80054 > > > On 2012-10-07 19:21:04, SLAFFAN wrote:
> > A script is attached to reproduce what happens.
> Issue produced with ActivePerl 5.8.9. Not reproduced with Perl 5.16.1. >