Re: Client crash making server crash

2011-08-19 Thread Eric Martel


signature.asc
Description: OpenPGP digital signature


Re: Client crash making server crash

2011-08-19 Thread Rocco Caputo
The _data_ses_stop() suggests that a POE::Kernel instance is stopping.  The 
_dispatch_event()'s second parameter is undefined, suggesting that the 
POE::Kernel instance that is stopping already doesn't exist.

You've used POE::Wheel::Run to fork off a new process, and I see you've called 
POE::Kernel->run() in the child process.  Did you call POE::Kernel->stop() 
first, to clear out the copies of the parent process' sessions?  Or at the very 
least, POE::Kernel->has_forked()?

See perldoc POE::Kernel for more about its stop() and has_forked() methods.

I'll try to reproduce the conditions in your stack trace after work.

-- 
Rocco Caputo 


On Aug 19, 2011, at 15:47, Eric Martel wrote:

> 
> Still no luck with a snapshot taken from
> "http://poe.git.sourceforge.net/git/gitweb.cgi?p=poe/poe;a=snapshot;h=5b9429832974363f7b0d37590cd5a5b7fd941360;sf=tgz";
> a few minutes ago:
> 
> <-- BEGIN TRACE -->
> 
> Server error: 'please report this stacktrace to bug-...@rt.cpan.org at
> /usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1013'
> 
> Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x95377d0)',
> undef, 'POE::Kernel=ARRAY(0x95377d0)', '_stop', 8, 'ARRAY(0x95c19f8)',
> '/usr/lib/perl5/site_perl/5.10.1/POE/Resource/Sessions.pm', 571, undef, ...)
> called at /usr/lib/perl5/site_perl/5.10.1/POE/Resource/Sessions.pm line
> 568'  
>
> 
> 
> Server error: ' POE::Kernel::_data_ses_stop('POE::Kernel=ARRAY(0x95377d0)',
> 'poste161-186-4e4ebc84-41d6-0002') called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Resource/Signals.pm line 507'
> 
> Server error: '
> POE::Kernel::_data_sig_free_terminated_sessions('POE::Kernel=ARRAY(0x95377d0)')
> called at /usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 974'
> 
> Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x95377d0)',
> 'POE::Kernel=ARRAY(0x95377d0)', 'POE::Kernel=ARRAY(0x95377d0)', '_signal', 16,
> 'ARRAY(0x9e35f48)', '/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 635, 
> undef,
> ...) called at /usr/lib/perl5/site_perl/5.10.1/POE/Resource/Events.pm line 
> 315'
> 
> Server error: '
> POE::Kernel::_data_ev_dispatch_due('POE::Kernel=ARRAY(0x95377d0)') called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Loop/Select.pm line 306'
> 
> Server error: ' POE::Kernel::loop_do_timeslice('POE::Kernel=ARRAY(0x95377d0)')
> called at /usr/lib/perl5/site_perl/5.10.1/POE/Loop/Select.pm line 314'
> 
> Server error: ' POE::Kernel::loop_run('POE::Kernel=ARRAY(0x95377d0)') called 
> at
> /usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1235'
> 
> Server error: ' POE::Kernel::run('POE::Kernel') called at
> /usr/lib/perl5/site_perl/5.10.1/YASC/yascs.pm line 48'
> 
> Server error: ' YASC::yascs::yascs(7895) called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Wheel/Run.pm line 472'
> 
> Server error: ' eval {...} called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Wheel/Run.pm line 472'
> 
> Server error: ' POE::Wheel::Run::new('POE::Wheel::Run', 'Program',
> 'CODE(0x9ccf030)', 'ProgramArgs', 'ARRAY(0x9e2cd38)', 'StdoutEvent',
> 'server_input', 'StderrEvent', 'server_stderr', ...) called at bin/yascm.pl 
> line
> 125'
> 
> Server error: ' main::start(undef, 'POE::Session=ARRAY(0x9df8260)',
> 'POE::Kernel=ARRAY(0x95377d0)', 'HASH(0x9df8200)', '_start',
> 'POE::Kernel=ARRAY(0x95377d0)', undef,
> '/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 1437, ...) called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Session.pm line 464'
> 
> Server error: ' POE::Session::_invoke_state('POE::Session=ARRAY(0x9df8260)',
> 'POE::Kernel=ARRAY(0x95377d0)', '_start', 'ARRAY(0x95739d0)',
> '/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 1437, undef) called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1023'
> 
> Server error: ' eval {...} called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1022'
> 
> Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x95377d0)',
> 'POE::Session=ARRAY(0x9df8260)', undef, '_start', 4, 'ARRAY(0x95739d0)',
> '/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 1437, undef, ...) called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1434'
> 
> Server error: ' POE::Kernel::session_alloc('POE::Kernel=ARRAY(0x95377d0)',
> 'POE::Session=ARRAY(0x9df8260)') called at
> /usr/lib/perl5/site_perl/5.10.1/POE/Session.pm line 192'
> 
> Server error: ' POE::Session::try_alloc('POE::Session=ARRAY(0x9df8260)') 
> called
> at /usr/lib/perl5/site_perl/5.10.1/POE/Session.pm line 373'
> 
> Server error: ' POE::Session::create('POE::Session', 'inline_states',
> 'HASH(0x9df8050)') called at bin/yascm.pl line 82'
> 
> Server error: ' main::yasc() called at bin/yascm.pl line 72'
> 
> <-- END TRACE -->
> 
> 
> 
> Le 2011-08-19 14:51, Rocco Caputo a écrit :
>> Hi, Eric.  Can you attach the confess() stack trace?  It confesses because 
>> of an internal error somewhere.  Release 1.312 adds a message to the 
>> confess() askin

Re: Client crash making server crash

2011-08-19 Thread Eric Martel

Also, I don't know if it's relevant, but I use POE::Filter::Block for the
POE::Wheel::ReadWrite Filter.


Le 2011-08-19 14:43, Eric Martel a écrit :
> Hi folks,
>
> I'm quite new to POE. I wrote a server using POE::Wheel::SocketFactory and
> handling clients with POE::Wheel::ReadWrite, and everything works fine but for
> one thing: there are moments when a client and the server will cross-exchange
> much data (that is, the client sends data to the server, which replies with
> other data, an this multiple times until they are finished), and I happened to
> notice that if the client is killed before the end, the server will die, which
> is not what I want...
>
> The server crashes in Kernel.pm, at the line "confess unless defined 
> $session;"
> (line 1012 as of v1.311) within _dispatch_event(). What I guess is happening
> (but I may be wrong) is that a '$client_wheel->put($data)' is made before the
> client is killed, and when POE tries to actually handle the put(), the client
> wheel session is already no longer accessible, before any ErrorEvent handler
> could be called. Am I right on this?
>
> I could not find any way I could prevent this, but surely there must be...? I
> wonder if replacing the "confess" line by a simple "warn + return" (or the 
> like)
> could do the trick? Any help would be greatly appreciated.
>


-- 
Eric Martel
Québec (Québec)
Canada

Ce courriel est signé numériquement avec la clef suivante:
This e-mail is digitally signed with the following key:
  ED3F191C (key://pgp.mit.edu, http://key.ericmartel.net/)
Pour plus d'information: http://gpg.ericmartel.net/
For more info: http://www.gnupg.org/


<>

signature.asc
Description: OpenPGP digital signature


Re: Client crash making server crash

2011-08-19 Thread Eric Martel

Still no luck with a snapshot taken from
"http://poe.git.sourceforge.net/git/gitweb.cgi?p=poe/poe;a=snapshot;h=5b9429832974363f7b0d37590cd5a5b7fd941360;sf=tgz";
a few minutes ago:

<-- BEGIN TRACE -->

Server error: 'please report this stacktrace to bug-...@rt.cpan.org at
/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1013'

Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x95377d0)',
undef, 'POE::Kernel=ARRAY(0x95377d0)', '_stop', 8, 'ARRAY(0x95c19f8)',
'/usr/lib/perl5/site_perl/5.10.1/POE/Resource/Sessions.pm', 571, undef, ...)
called at /usr/lib/perl5/site_perl/5.10.1/POE/Resource/Sessions.pm line
568'
 


Server error: ' POE::Kernel::_data_ses_stop('POE::Kernel=ARRAY(0x95377d0)',
'poste161-186-4e4ebc84-41d6-0002') called at
/usr/lib/perl5/site_perl/5.10.1/POE/Resource/Signals.pm line 507'

Server error: '
POE::Kernel::_data_sig_free_terminated_sessions('POE::Kernel=ARRAY(0x95377d0)')
called at /usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 974'

Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x95377d0)',
'POE::Kernel=ARRAY(0x95377d0)', 'POE::Kernel=ARRAY(0x95377d0)', '_signal', 16,
'ARRAY(0x9e35f48)', '/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 635, undef,
...) called at /usr/lib/perl5/site_perl/5.10.1/POE/Resource/Events.pm line 315'

Server error: '
POE::Kernel::_data_ev_dispatch_due('POE::Kernel=ARRAY(0x95377d0)') called at
/usr/lib/perl5/site_perl/5.10.1/POE/Loop/Select.pm line 306'

Server error: ' POE::Kernel::loop_do_timeslice('POE::Kernel=ARRAY(0x95377d0)')
called at /usr/lib/perl5/site_perl/5.10.1/POE/Loop/Select.pm line 314'

Server error: ' POE::Kernel::loop_run('POE::Kernel=ARRAY(0x95377d0)') called at
/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1235'

Server error: ' POE::Kernel::run('POE::Kernel') called at
/usr/lib/perl5/site_perl/5.10.1/YASC/yascs.pm line 48'

Server error: ' YASC::yascs::yascs(7895) called at
/usr/lib/perl5/site_perl/5.10.1/POE/Wheel/Run.pm line 472'

Server error: ' eval {...} called at
/usr/lib/perl5/site_perl/5.10.1/POE/Wheel/Run.pm line 472'

Server error: ' POE::Wheel::Run::new('POE::Wheel::Run', 'Program',
'CODE(0x9ccf030)', 'ProgramArgs', 'ARRAY(0x9e2cd38)', 'StdoutEvent',
'server_input', 'StderrEvent', 'server_stderr', ...) called at bin/yascm.pl line
125'

Server error: ' main::start(undef, 'POE::Session=ARRAY(0x9df8260)',
'POE::Kernel=ARRAY(0x95377d0)', 'HASH(0x9df8200)', '_start',
'POE::Kernel=ARRAY(0x95377d0)', undef,
'/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 1437, ...) called at
/usr/lib/perl5/site_perl/5.10.1/POE/Session.pm line 464'

Server error: ' POE::Session::_invoke_state('POE::Session=ARRAY(0x9df8260)',
'POE::Kernel=ARRAY(0x95377d0)', '_start', 'ARRAY(0x95739d0)',
'/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 1437, undef) called at
/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1023'

Server error: ' eval {...} called at
/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1022'

Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x95377d0)',
'POE::Session=ARRAY(0x9df8260)', undef, '_start', 4, 'ARRAY(0x95739d0)',
'/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm', 1437, undef, ...) called at
/usr/lib/perl5/site_perl/5.10.1/POE/Kernel.pm line 1434'

Server error: ' POE::Kernel::session_alloc('POE::Kernel=ARRAY(0x95377d0)',
'POE::Session=ARRAY(0x9df8260)') called at
/usr/lib/perl5/site_perl/5.10.1/POE/Session.pm line 192'

Server error: ' POE::Session::try_alloc('POE::Session=ARRAY(0x9df8260)') called
at /usr/lib/perl5/site_perl/5.10.1/POE/Session.pm line 373'

Server error: ' POE::Session::create('POE::Session', 'inline_states',
'HASH(0x9df8050)') called at bin/yascm.pl line 82'

Server error: ' main::yasc() called at bin/yascm.pl line 72'

<-- END TRACE -->



Le 2011-08-19 14:51, Rocco Caputo a écrit :
> Hi, Eric.  Can you attach the confess() stack trace?  It confesses because of 
> an internal error somewhere.  Release 1.312 adds a message to the confess() 
> asking for the stack trace.
>
> If possible, could you also check against the development version in git?  I 
> found and fixed one cause for that confess() this week, but it's not released 
> yet.  I'll expedite the 1.313 release if it fixes your problem.
>


-- 
Eric Martel
Québec (Québec)
Canada

Ce courriel est signé numériquement avec la clef suivante:
This e-mail is digitally signed with the following key:
  ED3F191C (key://pgp.mit.edu, http://key.ericmartel.net/)
Pour plus d'information: http://gpg.ericmartel.net/
For more info: http://www.gnupg.org/


<>

signature.asc
Description: OpenPGP digital signature


Re: Client crash making server crash

2011-08-19 Thread Eric Martel

Here is the confess trace (the "Server error" parts are produced by my program
and should be ignored); I will check for the git version.

<-- BEGIN TRACE -->
Server error: ' at /usr/local/share/perl/5.10.1/POE/Kernel.pm line 1012'

Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x871a78)',
undef, 'POE::Kernel=ARRAY(0x871a78)', '_stop', 8, 'ARRAY(0x946a60)',
'/usr/local/share/perl/5.10.1/POE/Resource/Sessions.pm', 571, undef, ...) called
at /usr/local/share/perl/5.10.1/POE/Resource/Sessions.pm line 568'

Server error: ' POE::Kernel::_data_ses_stop('POE::Kernel=ARRAY(0x871a78)',
's9infectio.infectio.domain_rech.chuq.qc.ca-4e4d4bf6-0eff-...') called at
/usr/local/share/perl/5.10.1/POE/Resource/Signals.pm line 507'

Server error: '
POE::Kernel::_data_sig_free_terminated_sessions('POE::Kernel=ARRAY(0x871a78)')
called at /usr/local/share/perl/5.10.1/POE/Kernel.pm line 974'

Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x871a78)',
'POE::Kernel=ARRAY(0x871a78)', 'POE::Kernel=ARRAY(0x871a78)', '_signal', 16,
'ARRAY(0x16aa168)', '/usr/local/share/perl/5.10.1/POE/Kernel.pm', 635, undef,
...) called at /usr/local/share/perl/5.10.1/POE/Resource/Events.pm line 315'

Server error: '
POE::Kernel::_data_ev_dispatch_due('POE::Kernel=ARRAY(0x871a78)') called at
/usr/local/share/perl/5.10.1/POE/Loop/Select.pm line 306'

Server error: ' POE::Kernel::loop_do_timeslice('POE::Kernel=ARRAY(0x871a78)')
called at /usr/local/share/perl/5.10.1/POE/Loop/Select.pm line 314'

Server error: ' POE::Kernel::loop_run('POE::Kernel=ARRAY(0x871a78)') called at
/usr/local/share/perl/5.10.1/POE/Kernel.pm line 1210'

Server error: ' POE::Kernel::run('POE::Kernel') called at
/usr/local/share/perl/5.10.1/YASC/yascs.pm line 48'

Server error: ' YASC::yascs::yascs(7895) called at
/usr/local/share/perl/5.10.1/POE/Wheel/Run.pm line 473'

Server error: ' eval {...} called at
/usr/local/share/perl/5.10.1/POE/Wheel/Run.pm line 473'

Server error: ' POE::Wheel::Run::new('POE::Wheel::Run', 'Program',
'CODE(0x147d640)', 'ProgramArgs', 'ARRAY(0x16a80e0)', 'StdoutEvent',
'server_input', 'StderrEvent', 'server_stderr', ...) called at /sbin/yascm.pl
line 125'

Server error: ' main::start(undef, 'POE::Session=ARRAY(0x628af8)',
'POE::Kernel=ARRAY(0x871a78)', 'HASH(0x628a68)', '_start',
'POE::Kernel=ARRAY(0x871a78)', undef,
'/usr/local/share/perl/5.10.1/POE/Kernel.pm', 1413, ...) called at
/usr/local/share/perl/5.10.1/POE/Session.pm line 464'

Server error: ' POE::Session::_invoke_state('POE::Session=ARRAY(0x628af8)',
'POE::Kernel=ARRAY(0x871a78)', '_start', 'ARRAY(0x8cc6b0)',
'/usr/local/share/perl/5.10.1/POE/Kernel.pm', 1413, undef) called at
/usr/local/share/perl/5.10.1/POE/Kernel.pm line 1015'

Server error: ' eval {...} called at /usr/local/share/perl/5.10.1/POE/Kernel.pm
line 1014'

Server error: ' POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x871a78)',
'POE::Session=ARRAY(0x628af8)', undef, '_start', 4, 'ARRAY(0x8cc6b0)',
'/usr/local/share/perl/5.10.1/POE/Kernel.pm', 1413, undef, ...) called at
/usr/local/share/perl/5.10.1/POE/Kernel.pm line 1410'

Server error: ' POE::Kernel::session_alloc('POE::Kernel=ARRAY(0x871a78)',
'POE::Session=ARRAY(0x628af8)') called at
/usr/local/share/perl/5.10.1/POE/Session.pm line 192'

Server error: ' POE::Session::try_alloc('POE::Session=ARRAY(0x628af8)') called
at /usr/local/share/perl/5.10.1/POE/Session.pm line 373'

Server error: ' POE::Session::create('POE::Session', 'inline_states',
'HASH(0x62)') called at /sbin/yascm.pl line 82'

Server error: ' main::yasc() called at /sbin/yascm.pl line 72'

<-- END TRACE -->


Le 2011-08-19 14:51, Rocco Caputo a écrit :
> Hi, Eric.  Can you attach the confess() stack trace?  It confesses because of 
> an internal error somewhere.  Release 1.312 adds a message to the confess() 
> asking for the stack trace.
>
> If possible, could you also check against the development version in git?  I 
> found and fixed one cause for that confess() this week, but it's not released 
> yet.  I'll expedite the 1.313 release if it fixes your problem.
>


-- 
Eric Martel
Québec (Québec)
Canada

Ce courriel est signé numériquement avec la clef suivante:
This e-mail is digitally signed with the following key:
  ED3F191C (key://pgp.mit.edu, http://key.ericmartel.net/)
Pour plus d'information: http://gpg.ericmartel.net/
For more info: http://www.gnupg.org/


<>

signature.asc
Description: OpenPGP digital signature


Re: Client crash making server crash

2011-08-19 Thread Rocco Caputo
Hi, Eric.  Can you attach the confess() stack trace?  It confesses because of 
an internal error somewhere.  Release 1.312 adds a message to the confess() 
asking for the stack trace.

If possible, could you also check against the development version in git?  I 
found and fixed one cause for that confess() this week, but it's not released 
yet.  I'll expedite the 1.313 release if it fixes your problem.

-- 
Rocco Caputo 

On Aug 19, 2011, at 14:43, Eric Martel wrote:

> Hi folks,
> 
> I'm quite new to POE. I wrote a server using POE::Wheel::SocketFactory and
> handling clients with POE::Wheel::ReadWrite, and everything works fine but for
> one thing: there are moments when a client and the server will cross-exchange
> much data (that is, the client sends data to the server, which replies with
> other data, an this multiple times until they are finished), and I happened to
> notice that if the client is killed before the end, the server will die, which
> is not what I want...
> 
> The server crashes in Kernel.pm, at the line "confess unless defined 
> $session;"
> (line 1012 as of v1.311) within _dispatch_event(). What I guess is happening
> (but I may be wrong) is that a '$client_wheel->put($data)' is made before the
> client is killed, and when POE tries to actually handle the put(), the client
> wheel session is already no longer accessible, before any ErrorEvent handler
> could be called. Am I right on this?
> 
> I could not find any way I could prevent this, but surely there must be...? I
> wonder if replacing the "confess" line by a simple "warn + return" (or the 
> like)
> could do the trick? Any help would be greatly appreciated.
> 
> -- 
> Eric Martel
> Québec (Québec)
> Canada
> 
> Ce courriel est signé numériquement avec la clef suivante:
> This e-mail is digitally signed with the following key:
>  ED3F191C (key://pgp.mit.edu, http://key.ericmartel.net/)
> Pour plus d'information: http://gpg.ericmartel.net/
> For more info: http://www.gnupg.org/
> 
> 
>