[mod_python] OS X / Apache 2 / mod_python bug

Graham Dumpleton grahamd at dscpl.com.au
Wed Mar 16 05:05:13 EST 2005


On 16/03/2005, at 8:42 PM, Jamie Kirkpatrick wrote:

> Next after a restart:  just after restarting, before calling anything 
> I check the logs -
>
> [Wed Mar 16 09:33:26 2005] [error] interpreter name that was passed is:
> [Wed Mar 16 09:33:26 2005] [error] interpreter name that was passed is:
> [Wed Mar 16 09:33:26 2005] [error] interpreter name that was passed is:
> [Wed Mar 16 09:33:26 2005] [error] interpreter name that was passed is:
> [Wed Mar 16 09:33:26 2005] [error] interpreter name that was passed is:
>
> A minute or so later I check back and i see
>
> [Wed Mar 16 09:33:32 2005] [warn] child process 25283 still did not 
> exit, sending a SIGTERM
> [Wed Mar 16 09:33:32 2005] [warn] child process 25284 still did not 
> exit, sending a SIGTERM
> [Wed Mar 16 09:33:32 2005] [warn] child process 25285 still did not 
> exit, sending a SIGTERM
> [Wed Mar 16 09:33:32 2005] [warn] child process 25286 still did not 
> exit, sending a SIGTERM
> [Wed Mar 16 09:33:32 2005] [warn] child process 25287 still did not 
> exit, sending a SIGTERM

In one place in the code, it passed NULL for the interpreter name so
the code you added to log the name is probably causing the crash. You
thus may need to do something like:

   if (name != NULL)
     ... log that name is NULL
   else
     ... log the name

BTW, can you confirm that you have the Mac OS X fix for Python 2.3 
(standard)
that I have previously mentioned. If you have applied the patch, in 
python_init()
there will be:

     /* initialize global Python interpreter if necessary */
     if (initialized == 0 || ! Py_IsInitialized())
     {
         initialized = 1;

where as unpatched mod_python has:

     /* initialize global Python interpreter if necessary */
     if (! Py_IsInitialized())
     {

I ask as the logged message "interpreters dictionary not initialised" 
indicates
that it may not and that you are hitting the same problem I saw but 
that it
simply doesn't happen all the time.

If you haven't patched it, add log message in if check for 
Py_IsInitialized
call in python_init() to see that the code is actually being called and
thus that "interpreters" is even being initialised.

     /* initialize global Python interpreter if necessary */
     if (! Py_IsInitialized())
     {

        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, srv,
              "Performing Initialisation.");

BTW, the Mac OS X patch is a part of general patches included in:

   http://www.dscpl.com.au/projects/vampire/PATCHES

Graham



More information about the Mod_python mailing list