Stas Bekman wrote:

As I've already said - if the server times out (in the example above) at least once -
it still continue serving requests. But when I press ctrl-c to stop the server - it stops
with segmentation fault, that means segmentation fault occurs only when the server
get a ctrl-c (sigint). I also tested kill -1 <httpd pid> (with sighup) - httpd exit with segfault too.

Yep, I tried to eval $apr->request, as well as eval the whole block including the code which sets and restores the timeout


Stopping server with Ctrl-C is probably not the best idea ;)

killing with sighup causes the segmentation fault too :)


that perl garbage collector is not executed after the timeout), since there is no way to correctly
handle this situation ?

I just wonder how that will influence of the overall stability and memory usage (since it seems


I need to see that backtrace in hope to get an idea of what's going on.

How to do that ? I started httpd within gdb, then send it a sigint:

(gdb) run -X -f /home/ag/development/tauction/conf/httpd.conf
Starting program: /usr/local/apache-perl/bin/httpd -X -f /home/ag/development/test/conf/httpd.conf
(no debugging symbols found)...(no debugging symbols found)...[New Thread 1024 (LWP 18788)]


Program received signal SIGINT, Interrupt.
[Switching to Thread 1024 (LWP 18788)]
0x402749a4 in read () from /lib/libc.so.6
(gdb) where
#0  0x402749a4 in read () from /lib/libc.so.6
#1  0x401b6ac0 in __JCR_LIST__ () from /lib/libpthread.so.0
#2  0x080a73a0 in ap_bhalfduplex ()
#3  0x080a7519 in ap_bread ()
#4  0x080b5f4b in ap_get_client_block ()
.......

If i kill it with `kill -HUP <httpd pid>` :

Program received signal SIGTERM, Terminated.
[Switching to Thread 1024 (LWP 18928)]
0x402749a4 in read () from /lib/libc.so.6
(gdb) where
#0  0x402749a4 in read () from /lib/libc.so.6
#1  0x401b6ac0 in __JCR_LIST__ () from /lib/libpthread.so.0
#2  0x080a73a0 in ap_bhalfduplex ()
#3  0x080a7519 in ap_bread ()
#4  0x080b5f4b in ap_get_client_block ()
.......

How else can I debug/backtrace it to catch this segmentation fault ?

Also I came to the following solution:
sub handler {
   ...
   open(F, ">/tmp/test-$$") && close(F);
   $apr->param;
   unlink "/tmp/test-$$";
   ...
}

then another server scans each second /tmp dir for the /^test-(\d+)$/ files modified
more than 2 second ago, kill the appropriate process $1 and removes the appropriate file in /tmp.
It is ugly, I know... But at the moment I don't see any better solution


Alex



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to