Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 20260
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: mcmanus.jason [...] gmail.com
Cc:
AdminCc:

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



Subject: BEGIN{} around Session->create using POE::Wheel::ReadLine spirals out of control
Greetings, There may be a bug in POE::Wheel::ReadLine that causes the memory usage to spiral out of control when placing the POE::Session->create() method call into a BEGIN { } block. I tried testing a custom application doing this, and then copying and pasting the *exact* test program at: http://poe.perl.org/?POE_Cookbook/Console_Input *only* making the change to wrap lines 25-31 in a BEGIN { }; block (diff below to verify, but simple to test), and still observed this behaviour, both during a normal run and during a 'perl -c'. I initially ran into the exact bug described at the top of the Console Input page (http://rt.cpan.org/Ticket/Display.html?id=3665), but after upgrading from Perl 5.8.0 to Perl 5.8.3, the BEGIN { } block issue still exists. I have also tested on a 5.8.5 system, with the same results, but this is the extent of the versions I have access to at this time. Show quoted text
---- diff between my test script and the stock script ---- $ diff -c test.pl test2.pl *** test.pl 2006-07-03 22:37:00.000000000 +0900 --- test2.pl 2006-07-03 22:36:52.000000000 +0900 *************** *** 22,27 **** --- 22,28 ---- # destroyed. They give you the opportunity to initialize things and # shut them down. + BEGIN { POE::Session->create ( inline_states => { _start => \&readline_run, *************** *** 29,34 **** --- 30,36 ---- _stop => \&readline_stop, } ); + }; # Let the schizophrenia begin! Once initial sessions have been # created, we run them until everything is done. The rest of this ---- snip ---- box1$ perl -v This is perl, v5.8.3 built for i386-linux-thread-multi [...] box1$ perl -MPOE -e'print $POE::VERSION' 0.3502 box1$ perl -MPOE::Wheel::ReadLine -e'print $POE::Wheel::ReadLine::VERSION' 1.1947 box1$ perl -MTerm::ReadKey -e'print $Term::ReadKey::VERSION' 2.30 box1$ uname -a Linux akuma.nowhere.net 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux box2$ perl -v This is perl, v5.8.5 built for i386-linux-thread-multi [...] box2$ perl -MPOE -e'print $POE::VERSION' 0.3502 box2$ perl -MPOE::Wheel::ReadLine -e'print $POE::Wheel::ReadLine::VERSION' 1.1947 box2$ perl -MTerm::ReadKey -e'print $Term::ReadKey::VERSION' 2.30 box2$ uname -a Linux ricin 2.6.9-22.0.2.EL #1 Tue Jan 17 06:51:40 CST 2006 i686 i686 i386 GNU/Linux This is not a blocking issue, as it turns out I didn't need the BEGIN {} block after all, but it theoretically *should* work, so I thought I would submit this. Thank you, Jason McManus
The hang was an issue with exception handling within POE, which has since been resolved. Your test case now properly reports: Undefined subroutine &main::readline_run called at /Users/troc/projects/poe/poe/lib/POE/Session.pm line 485. Because you're using references to subroutines that have not yet been defined. Thanks for the bug report, and I'm happy to know your issue's resolved.