perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: modperl-2.0/t/protocol/TestProtocol eliza.pm
Date Fri, 18 Jan 2002 14:51:54 GMT
Doug MacEachern wrote:

> On Fri, 11 Jan 2002, Stas Bekman wrote:
>  
> 
>>does this work for you? It seems that it doesn't change anything since 
>>the last call from $socket->send() never returns, so it doesn't matter 
>>what's the value of $last is. I still get the core dump.
>>
> 
> it wasn't core dumping on me before the change.  i saw the core dump
> just once, and haven't seen it since.  after your post i realized what the
> problem was, or so i thought.  since it core dumps for you, i'll leave it
> to you to debug :-)

OK, I think I've found the problem. It happens with eliza, echo or any 
other test which happen to run last and just a little bit slow to cleanup.

The problem is that t/TEST kills the server *too early*, when the server 
didn't complete the cleanups. This has been exposed when you postponed 
the run of the END blocks to the very end. The workaround is to sleep 
for a few secs before calling kill:

Index: Apache-Test/lib/Apache/TestServer.pm
===================================================================
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
retrieving revision 1.53
diff -u -r1.53 TestServer.pm
--- Apache-Test/lib/Apache/TestServer.pm	17 Jan 2002 04:17:49 -0000	
1.53
+++ Apache-Test/lib/Apache/TestServer.pm	18 Jan 2002 14:45:56 -0000
@@ -283,6 +283,10 @@
      my $self = shift;
      my $aborted = shift;

+    # must sleep for 1 sec, to let the server complete the last
+    # request's cleanups
+    sleep 1;
+
      if (Apache::TestConfig::WIN32) {
          if ($self->{config}->{win32obj}) {
              $self->{config}->{win32obj}->Kill(0);

But this is wrong, 1 sec works for me but may not work for some slower 
machine. I'm not sure yet what the right fix but the server shouldn't 
abort cleanups on SIGINT, as it does now. FWIW, here is the relevant 
part of the core dump:

#16 0x400409aa in run_cleanups (c=0x8369e08) at apr_pools.c:1596
#17 0x4003fdd2 in apr_pool_destroy (pool=0x8369d88) at apr_pools.c:563
#18 0x080b442a in clean_child_exit (code=0) at prefork.c:231
#19 0x402732db in pthread_sighandler (signo=15, ctx=
       {gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 
43, __dsh$#20 0x402ae978 in killpg () from /lib/libc.so.6
#21 0x4003737c in apr_send (sock=0x837c368,
     buf=0x87e0170 "\230ยต&\b8\215;@more about that.\n", len=0xbffff11c)
     at sendrecv.c:101
#22 0x406002dc in mpxs_apr_send (my_perl=0x82a8ff0, socket=0x837c368,
     sv_buf=0x87abb54, sv_len=0x87af178)

as you can see the thread gets killed just after it completed the 
apr_send (in this case I was running protocol/eliza).

This core dump is random, and cannot be reproduced on demand, but it 
happens almost every second run, probably depends on how busy is CPU 
during the end of the test suite.

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message