[mod_python] Help about apache mod_python Segmentation fault

Graham Dumpleton graham.dumpleton at gmail.com
Wed Feb 27 00:29:48 EST 2008


On 27/02/2008, auther_bin <auther_bin at 21cn.com> wrote:
> Dear friends,
>
>         When I compiling the apache python mod_python and install it into my uClibc envirentment, but when I
>  runing httpd -X, send a very little request with index.html it crashed. after some debuging work, I find there should be something wrong in mod_python.c line(about 1561) which looks like:
>  --------------------------------- with my debug printing :) ------------------------
>  printf("JJJJJJJJ %s -> python_handler\n", phase);
>  printf("JJJJJJJJ %x[%d]\n", &req->per_dir_config, (&python_module)->module_index);
>     /* get configuration */
>     conf = (py_config *) ap_get_module_config(req->per_dir_config,
>                                                   &python_module);
>  printf("JJJJJJJJ a %s conf=%x -> python_handler\n", phase,conf);
>  .............
>  ------------------------------ end source --------------------------------------
>
>  I guess that, there should be a regester error in it. with some debug message I print:
>  ------------- printing -------------------------------
>  JJJJJJJJJ PythonPostReadRequestHandler
>  JJJJJJJJ PythonInitHandler -> python_handler
>  JJJJJJJJ 820a544[29]
>  Segmentation fault
>  ------------- end printing ---------------------------
>
>  any advices pls?

Unfortunately that doesn't help much.

You need a stack trace to show the true location in code.

Use procedure documented in section 'Debugging Crashes With GDB' of:

  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

to run up httpd inside of gdb and get a stack trace of where crash is occurring.

This documentation is for mod_wgsi, but same procedure used for mod_python.

There is a similar procedure documented on Apache site, but can't
remember where.

Graham


More information about the Mod_python mailing list