Skip Menu |

This queue is for tickets about the POE CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: nomad [...] null.net
Cc:
AdminCc:

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



Date: Tue, 27 Jul 2004 12:45:45 +0200 (CEST)
From: Mark Lawrence <nomad [...] null.net>
To: bug-POE [...] rt.cpan.org
Subject: POE::Wheel::Run Conduit Problem
Hi, I have been attempting to use POE::Wheel::Run in the following manner: Version: # $Id: Run.pm,v 1.57 2004/01/21 06:48:25 rcaputo Exp $ my $wheel = POE::Wheel::Run->new( Program => $script, StdinFilter => POE::Filter::Line->new(), StdoutFilter => POE::Filter::Line->new(), StderrFilter => POE::Filter::Line->new(), StdoutEvent => 'test_stdout', StderrEvent => 'test_stderr', ); This worked fine until I tried to use the shutdown_stdin() method: Use of uninitialized value in string eq at /usr/share/perl5/POE/Wheel/Run.pm line 865. From line 865 in the code it appears that $self->[STDIO_TYPE] is not defined. Tracing back it also appears that the scalar $stdio_type is also not being defined when Conduit is not giving during the new() method. When forcing the Conduit to be of type "pipe" (supposedly the default) I get the following errors: Use of uninitialized value in exists at /usr/share/perl5/POE/Resource/FileHandles.pm line 472. Use of uninitialized value in exists at /usr/share/perl5/POE/Resource/FileHandles.pm line 175. syswrite() on closed filehandle GEN63 at /usr/share/perl5/POE/Driver/SysRW.pm line 125. Use of uninitialized value in exists at /usr/share/perl5/POE/Resource/FileHandles.pm line 472. 1090924405 D:3: homebase:ping: Testing... Please mail the following information to bug-POE@rt.cpan.org: can't watch GLOB(0x88b2d68): GLOB(0x886c054) (closed) is still registered for that file descriptor in mode 1 at /usr/share/perl5/POE/Resource/FileHandles.pm line 396 POE::Kernel::_data_handle_add('POE::Kernel=ARRAY(0x8381144)','GLOB(0x88b2d68)',1,'POE::Session=ARRAY(0x886a934)','POE::Wheel::Run(11) -> select stdin') called at /usr/share/perl5/POE/Kernel.pm line 1795 POE::Kernel::_internal_select('POE::Kernel=ARRAY(0x8381144)','POE::Session=ARRAY(0x886a934)','GLOB(0x88b2d68)','POE::Wheel::Run(11) -> select stdin',1) called at /usr/share/perl5/POE/Kernel.pm line 1862 POE::Kernel::select_write('POE::Kernel=ARRAY(0x8381144)','GLOB(0x88b2d68)','POE::Wheel::Run(11) -> select stdin') called at /usr/share/perl5/POE/Wheel/Run.pm line 534 POE::Wheel::Run::_define_stdin_flusher('POE::Wheel::Run=ARRAY(0x88ac468)') called at /usr/share/perl5/POE/Wheel/Run.pm line 474 POE::Wheel::Run::new('POE::Wheel::Run','Program','/usr/bin/fping homebase','StdinFilter','POE::Filter::Line=ARRAY(0x88684c0)','StdoutFilter','POE::Filter::Line=ARRAY(0x88afe7c)','StderrFilter','POE::Filter::Line=ARRAY(0x88b07fc)',...) called at ./emon line 411 main::emon_test('undef','POE::Session=ARRAY(0x886a934)','POE::Kernel=ARRAY(0x8381144)','HASH(0x8871504)','test','POE::Session=ARRAY(0x886a934)','undef','./emon',264,...) called at /usr/share/perl5/POE/Session.pm line 628 POE::Session::_invoke_state('POE::Session=ARRAY(0x886a934)','POE::Session=ARRAY(0x886a934)','test','ARRAY(0x8871d38)','./emon',264) called at /usr/share/perl5/POE/Kernel.pm line 858 POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x8381144)','POE::Session=ARRAY(0x886a934)','POE::Session=ARRAY(0x886a934)','test',512,'ARRAY(0x8871d38)','./emon',264,1090924405.25601,...) called at /usr/share/perl5/POE/Resource/Events.pm line 246 POE::Kernel::_data_ev_dispatch_due('POE::Kernel=ARRAY(0x8381144)') called at /usr/share/perl5/POE/Loop/Select.pm line 325 POE::Kernel::loop_do_timeslice('POE::Kernel=ARRAY(0x8381144)') called at /usr/share/perl5/POE/Loop/Select.pm line 333 POE::Kernel::loop_run('POE::Kernel=ARRAY(0x8381144)') called at /usr/share/perl5/POE/Kernel.pm line 1001 POE::Kernel::run('POE::Kernel=ARRAY(0x8381144)') called at ./emon line 222 Forcing Conduit to be "socketpair" seems to work. All of the above is done on a Debian/GNU Linux (sarge/testing) system. Regards, Mark. -- Mark Lawrence
I have revised POE::Wheel to read # Shutdown the pipe that leads to the child's STDIN. sub shutdown_stdin { my $self = shift; return unless defined $self->[HANDLE_STDIN]; $poe_kernel->select_write($self->[HANDLE_STDIN], undef); eval { local $^W = 0; shutdown($self->[HANDLE_STDIN], 1) }; close $self->[HANDLE_STDIN] if $@; } I would appreciate it if you could verify this change. I've also added new tests to t/22_wheel_run.t. They will check shutdown_stdin() with each possible conduit type. Thanks for the report. -- Rocco Caput