[mod_python] Help about apache mod_python Segmentation fault

Graham Dumpleton graham.dumpleton at gmail.com
Sun Mar 9 07:05:57 EDT 2008


Sorry, I have no idea how to help you any further. I have given you
suggestions of how to debug it yourself, and that is now probably as
far as I can go. Whatever this environment is you are using, it seems
to even screw up your ability to debug it. I'd suggest going to a
mailing list that deals with the environment. Better still, perhaps
use a completely different environment if you can. Alternatively
forget about using mod_python and use a web server which is
implemented in pure Python. For example, use Paste WSGI web server and
run any WSGI capable application/framework on top of it. That way you
will not have to deal with Apache in the first place.

What is so special about this uClibc environment that you have to use
it and what is the requirement you have that you must run Apache and
mod_python?

Graham

On 03/03/2008, auther_bin <auther_bin at 21cn.com> wrote:
>
>
> Hi Graham Dumpleton,
>
> And, when I debug in RedHat9 and my embeded
> envirenment, the main process goes
> different!?
>
> in Redhat9, run like:
>
>
> (gdb) b main
> Breakpoint 1 at 0x8067a40: file main.c, line 438.
> (gdb) run -X
> Starting program: /usr/local/apache2/bin/httpd -X
> [New Thread 1076592288 (LWP 1049)]
> [Switching to Thread 1076592288 (LWP 1049)]
>
> Breakpoint 1, main (argc=134642240, argv=0x2) at main.c:438
> 438     {
> (gdb) n
> 272         stat = apr_app_initialize(argc, argv, NULL);
>
> and in my embeded system runs like:
>
>
>
> Breakpoint 1, main (argc=2, argv=0xbffff294)
>     at
> /usr/src/build/snapgear/user/apache/server/main.c:441
> 441         int configtestonly = 0;
> (gdb) n
> 442         const char *confname = SERVER_CONFIG_FILE;
>
>
>
> it seems that, the hosting system doing something for init before the main
> function run, but embeded system do not?
>
> I thinks is here somthing wrong? or there should be some compiling
> parameters I missed?
>
> ======= 2008-02-27 wrote: =======
>
> >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
> >
> >
> >__________ NOD32 2906 (20080227) Information
> __________
> >
> >This message was checked by NOD32 antivirus system.
> >http://www.nod32cn.com
> >
> >
>
> = = = = = = = = = = = = = = = = = = = =
>
>
>                     ÖÂ
> Àñ£¡
> 2008-03-03
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>
> __________ NOD32 2915 (20080303) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32cn.com
>
>
> _______________________________________________
>  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