Subject: | Use of FILENO on FCGI file handles causes error |
when running FastCGI apps under Perl in the background with fcgi/FCGI.pm
and you're using IPC::Open3, IPC::Run, IPC::Run3 or other code that
calls fileno() on a FCGI filehandle the application will die with:
Can't locate object method "FILENO" via package "FCGI::Stream" at
/usr/local/libdata/perl5/site_perl/IPC/Run.pm line 1118.
or
Can't locate object method "FILENO" via package "FCGI::Stream" at
/usr/local/lib/perl5/5.10.0/x86_64-linux/IO/Handle.pm line 387
IO::Handle::fileno('GLOB(0x73b6a0)') called at
/usr/local/lib/perl5/site_perl/5.10.0/HTTP/Request/AsCGI.pm line 111
HTTP::Request::AsCGI::setup('HTTP::Request::AsCGI=HASH(0x1eeedf0)')
called at example/vites_server_standlone_fcgi.pl line 55
main::handle_request('HTTP::Engine::Request=HASH(0x1ee7698)')
called at
/usr/local/lib/perl5/site_perl/5.10.0/HTTP/Engine/Role/Interface.pm line 25
eval {...} called at
/usr/local/lib/perl5/site_perl/5.10.0/HTTP/Engine/Role/Interface.pm line 24
HTTP::Engine::Role::Interface::handle_request('HTTP::Engine::Interface::FCGI=HASH(0x1bb5930)',
'_connection', 'HASH(0x1ee7578)') called at
/usr/local/lib/perl5/site_perl/5.10.0/HTTP/Engine/Interface/FCGI.pm line 133
HTTP::Engine::Interface::FCGI::run('HTTP::Engine::Interface::FCGI=HASH(0x1bb5930)')
called at
/usr/local/lib/perl5/site_perl/5.10.0/Moose/Meta/Method/Delegation.pm
line 99
HTTP::Engine::run('HTTP::Engine=HASH(0x1bb5a98)') called at
example/vites_server_standlone_fcgi.pl line 50
Surprisingly, the FCGI.pm contains the function FILENO which is
commented out - the attached patch changes that and makes the named
IPC::* modules work under FastCGI.