[mod_python] Help about apache mod_python Segmentation fault

auther_bin auther_bin at 21cn.com
Sun Mar 2 21:04:59 EST 2008


Hi Graham Dumpleton,

¡¡¡¡I comiling all the libs and mod_python with "-g", and run gdb of httpd, but could not catch the wro
ng piont correctly, here is some messages:

=============== GDB run with -X ===============================
# gdb httpd 
argc=2 argv=0xbffff9b4 envp=0xbffff9c0
ELF header=0x40000000
First Dynamic section entry=0x40009efc
transfering control to application @ 0x8070360
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run -X
Starting program: /usr/local/apache2/bin/httpd -X
argc=3 argv=0xbfffe574 envp=0xbfffe584
ELF header=0x40000000
[New Thread 1024 (LWP 8609)]
transfering control to application @ 0x8065250
JJJJJJ apr_app_initialize(2, /usr/local/apache2/bin/httpd, -X, (null))
JJJJJJJ in apr_initialize srclib/apr/misc/unix
JJJJJJJ in before apr_pool_create srclib/apr/misc/unix
JJJJJJJ in before apr_pool_tag srclib/apr/misc/unix
httpd: apr_sockaddr_info_get() failed for localhost.localdomain
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
JJJJJJJJJJJJJJJJJJJ111111111JJJJJJ
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
												<----- give a web requirement here.
JJJJJJJJJJJJJJJ python_connection
JJJJJJJJJ PythonPostReadRequestHandler
JJJJJJJJ PythonInitHandler -> python_handler
JJJJJJJJ 81e604c[27]
Cannot find user-level thread for LWP 8609: generic error
(gdb) where
Cannot find thread 1024: generic error
(gdb) 
======================= GDB could not working any more here ====================
BTW, the lines begains with "JJJJ" is the printf gives, where I inputed into the sourcecode
of apache and mod_python.

if I run httpd -X without gdb, the httpd gives:
======================
JJJJJJJJ 81e605c[27]
Segmentation fault
# 
======================

after times of work, I think is it the problem lies on the module Load process?
for if i rem the config line in httpd.conf "LoadModule python_module modules/mod_python.so", the httpd could works well.

======= 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 



More information about the Mod_python mailing list