[mod_python] core dumping in worker MPM - can anyone help with these stack traces?

perry.tew at cibavision.novartis.com perry.tew at cibavision.novartis.com
Tue Feb 10 00:34:47 EST 2004


Grisha,
   No.  It's not a dumb question at all.  It's a question I've been 
pondering alot.   It's the DCOracle2 library used by zope.  It reports a 
threadsafety of 3.   Additionally, I'm using the jonpy class dbpool which 
implements a Queue to provide additionally threadsafety.   Now, whether 
both of those libraries are actually threadsafe I can't tell.  I've got 4 
possible points of failure: apache, mod_python, jonpy, oracle.

<time lapse>

I got to thinking about it and started to try and remove the complexity.  
So, I've stripped down my setup to a bare minimum.   I've found that 
there's another module that's conflicting with mod_python (never seen that 
before, eh?) and causing the segfaults.  When I have all extra mods 
removed, it doesn't core  Note, they're all standard mods that ship with 
apache with the exception of mod_macro.  However, it hangs at times and 
flies at other times.  Here's the results of running ab (1000 hits 
simulating 10 concurrent users).  If I remove mod_python, there is no 
performance issue.

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.7      0      50
Processing:     1  320 2986.9      9   30015
Waiting:       -1  257 2674.6      7   30011
Total:          1  320 2986.9      9   30015

Percentage of the requests served within a certain time (ms)
  50%      9
  66%     10
  75%     11
  80%     12
  90%     15
  95%     25
  98%    961
  99%  30000
 100%  30015 (longest request)


So, I will continue to troubleshoot this issue.  I'm going to recompile 
everything and profile it and see where the hanging is going on.  I'll 
also find out which module is causing mod_python to crash.  At any rate, 
thanks for your response.

Thanks,
Perry Tew




Here's my new setup:

Only 1 python class:
#================================================
from mod_python import apache

i = 0

def accesshandler(req):

        global i
        apache.log_error( "Request #%d" % i )
        i = i + 1

        return apache.OK
#================================================


I've stripped down my httpd.conf as small as possible:









This may be a dumb question - but do you know for certain that the oracle
driver you're using is thread-safe?

Grisha

On Mon, 9 Feb 2004 perry.tew at cibavision.novartis.com wrote:

> Hey Everyone,
>    Well, as promised, I'm attempting to troubleshoot my problems with 
the
> worker MPM crashes I'm experiencing.  I rebuilt everything with the -g
> CFLAG and when I examine the core file using gdb I receive the following
> stack traces (I did it three times to see if it reproduced).  btw. I'm
> using mod_python-3.1.1b (not using the latest 'cause my flex is out of
> date) and apache 2.0.48.
>
> I can provide additional information, but the actual code will be
> difficult to set up since it's an Authen handler going against an Oracle
> database using DCOracle2.
>
> If anyone can provide a path I should go down, I would appreciate it.  I
> don't know the Apache API, and the only line of code that looks to be
> mod_python-ish is
> #4  0xfdc2e9b0 in python_merge_config (p=0x67eb68, current_conf=0xdb520,
> new_conf=0xef2f8) at mod_python.c:653
>
> which is this line of code from the source (mod_python.c
> python_merge_config):
>     apr_table_overlap(merged_conf->options, nc->options,
> APR_OVERLAP_TABLES_SET);
>
> Again, this runs without issue using the prefork model.
>
> Thanks!
> Perry Tew
>
>
> (gdb) where
> #0  0xfee4efec in strcasecmp () from /usr/lib/libc.so.1
> #1  0xff0ccdd4 in table_mergesort (pool=0xa1670, values=0x5a4420, n=12) 
at
> apr_tables.c:1013
> #2  0xff0ccfb4 in apr_table_compress (t=0x6804b0, flags=0) at
> apr_tables.c:1125
> #3  0xff0cd2dc in apr_table_overlap (a=0x6804b0, b=0xef448, flags=0) at
> apr_tables.c:1244
> #4  0xfdc2e9b0 in python_merge_config (p=0x67eb68, current_conf=0xdb520,
> new_conf=0xef2f8) at mod_python.c:653
> #5  0x3bc10 in ap_merge_per_dir_configs (p=0x67eb68, base=0xd1ab8,
> new_conf=0x6800f8) at config.c:278
> #6  0x668b0 in ap_directory_walk (r=0x67eba0) at request.c:1177
> #7  0x60118 in core_map_to_storage (r=0x67eba0) at core.c:3367
> #8  0x6384c in ap_run_map_to_storage (r=0x67eba0) at request.c:110
> #9  0x64960 in ap_process_request_internal (r=0x67eba0) at request.c:191
> #10 0x337d0 in ap_process_request (r=0x67eba0) at http_request.c:286
> #11 0x2ae2c in ap_process_http_connection (c=0x3c5aa8) at 
http_core.c:293
> #12 0x4e29c in ap_run_process_connection (c=0x3c5aa8) at connection.c:85
> #13 0x4e83c in ap_process_connection (c=0x3c5aa8, csd=0x3c59b8) at
> connection.c:211
> #14 0x35904 in process_socket (p=0x3c5980, sock=0x3c59b8, 
my_child_num=0,
> my_thread_num=8, bucket_alloc=0x3cf9a8)
>     at worker.c:632
> #15 0x36448 in worker_thread (thd=0xbbcf8, dummy=0x14bcb8) at 
worker.c:946
> #16 0xff0d4de0 in dummy_worker (opaque=0xbbcf8) at thread.c:127
>
>
>
>
> (gdb) where
> #0  0xfee4efd4 in strcasecmp () from /usr/lib/libc.so.1
> #1  0xfee4efcc in strcasecmp () from /usr/lib/libc.so.1
> #2  0xff0ccfb4 in apr_table_compress (t=0x4b64c0, flags=0) at
> apr_tables.c:1125
> #3  0xff0cd2dc in apr_table_overlap (a=0x4b64c0, b=0xef448, flags=0) at
> apr_tables.c:1244
> #4  0xfdc2e9b0 in python_merge_config (p=0x4b4b80, current_conf=0xdb520,
> new_conf=0xef2f8) at mod_python.c:653
> #5  0x3bc10 in ap_merge_per_dir_configs (p=0x4b4b80, base=0xd1ab8,
> new_conf=0x4b6108) at config.c:278
> #6  0x668b0 in ap_directory_walk (r=0x4b4bb8) at request.c:1177
> #7  0x60118 in core_map_to_storage (r=0x4b4bb8) at core.c:3367
> #8  0x6384c in ap_run_map_to_storage (r=0x4b4bb8) at request.c:110
> #9  0x64960 in ap_process_request_internal (r=0x4b4bb8) at request.c:191
> #10 0x337d0 in ap_process_request (r=0x4b4bb8) at http_request.c:286
> #11 0x2ae2c in ap_process_http_connection (c=0x4b0af8) at 
http_core.c:293
> #12 0x4e29c in ap_run_process_connection (c=0x4b0af8) at connection.c:85
> #13 0x4e83c in ap_process_connection (c=0x4b0af8, csd=0x4b0a08) at
> connection.c:211
> #14 0x35904 in process_socket (p=0x4b09d0, sock=0x4b0a08, 
my_child_num=0,
> my_thread_num=14, bucket_alloc=0x4b2ae0)
>     at worker.c:632
> #15 0x36448 in worker_thread (thd=0xbbdb8, dummy=0x146c58) at 
worker.c:946
> #16 0xff0d4de0 in dummy_worker (opaque=0xbbdb8) at thread.c:127
>
>
>
>
> (gdb) where
> #0  0xfee4efd4 in strcasecmp () from /usr/lib/libc.so.1
> #1  0xfee4efcc in strcasecmp () from /usr/lib/libc.so.1
> #2  0xff0ccfb4 in apr_table_compress (t=0x497290, flags=0) at
> apr_tables.c:1125
> #3  0xff0cd2dc in apr_table_overlap (a=0x497290, b=0xef448, flags=0) at
> apr_tables.c:1244
> #4  0xfdc2e9b0 in python_merge_config (p=0x495948, current_conf=0xdb520,
> new_conf=0xef2f8) at mod_python.c:653
> #5  0x3bc10 in ap_merge_per_dir_configs (p=0x495948, base=0xd1ab8,
> new_conf=0x496ed8) at config.c:278
> #6  0x668b0 in ap_directory_walk (r=0x495980) at request.c:1177
> #7  0x60118 in core_map_to_storage (r=0x495980) at core.c:3367
> #8  0x6384c in ap_run_map_to_storage (r=0x495980) at request.c:110
> #9  0x64960 in ap_process_request_internal (r=0x495980) at request.c:191
> #10 0x337d0 in ap_process_request (r=0x495980) at http_request.c:286
> #11 0x2ae2c in ap_process_http_connection (c=0x490d58) at 
http_core.c:293
> #12 0x4e29c in ap_run_process_connection (c=0x490d58) at connection.c:85
> #13 0x4e83c in ap_process_connection (c=0x490d58, csd=0x490c68) at
> connection.c:211
> #14 0x35904 in process_socket (p=0x490c30, sock=0x490c68, 
my_child_num=0,
> my_thread_num=18, bucket_alloc=0x493940)
>     at worker.c:632
> #15 0x36448 in worker_thread (thd=0xbbe38, dummy=0x14bcb8) at 
worker.c:946
> #16 0xff0d4de0 in dummy_worker (opaque=0xbbe38) at thread.c:127
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>





More information about the Mod_python mailing list