On Wed, Feb 02, 2000 at 04:27:13PM -0500, [EMAIL PROTECTED] wrote:
> i am writing some testing code and i want to unloop (exit) the main loop
> when a certain thing happens so i can exit the test. but when i call
> unloop_all i got this error:
>
> perl -MStem -e 'Stem::Event::Plain::Test::go()'
> Stem::Event::Plain::Test testing
> success
> end test
> Can't locate Event/cancel.pm in @INC (@INC contains:
>/usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503
>/usr/local/lib/perl5/site_perl/5.005/sun4-solaris
>/usr/local/lib/perl5/site_perl/5.005 .) at
>/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Event.pm line 50.
> , Undefined subroutine &cancel at -e line 0
> END failed--cleanup aborted.
It looks like it's trying to AUTOLOAD Event::cancel. Strange.
> i can't find any cancel.pm nor do i know why is trying to get loaded. so
> i tried a change and decided to cancel my idle event from inside its
> callback before calling unloop_all and this came up:
>
> perl -MStem -e 'Stem::Event::Plain::Test::go()'
> Stem::Event::Plain::Test testing
> success
> Event: '?? Stem.pm:70' died and then $Event::DIED died with: Can't locate
>Event/desc.pm in @INC (@INC contains: /usr/local/lib/perl5/5.00503/sun4-solaris
>/usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
>/usr/local/lib/perl5/site_perl/5.005 .) at
>/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Event.pm line 50.
> , Undefined subroutine &desc at Stem.pm line 24
>
> end test
> Segmentation Fault (core dumped)
>
> stack trace of that core:
>
> (gdb) bt
> #0 0xff0b6404 in pe_event_postCB ()
> #1 0xff0b6f70 in pe_event_invoke ()
> #2 0xff0bbdb0 in one_event ()
> #3 0xff0bce14 in XS_Event__loop ()
> #4 0x65114 in Perl_pp_entersub ()
> #5 0x9ef6c in Perl_runops_standard ()
> #6 0x26714 in perl_run ()
> #7 0x242c4 in main ()
Memory corruption?
> my test code is behaving worse than my production code. :) actually this
> is the first time i have called unloop so that may be the area that is
> weak. or i could be using it wrong. i tried passing it the result value
> 1 and also with no args and it core dumps both ways.
>
> i can send you the code for this as it is very simple (just a wrapper
> around idle events and simple watcher callback test).
Sure, send the code!
> any ideas? is unloop not as robust as it could be?
I can't recall any latent problems with unloop(). It works for me.
--
"Never ascribe to malice that which can be explained by stupidity."
via, but not speaking for Deutsche Bank