Bug 242952 - mod_python causes segmentation fault in Apache httpd
Summary: mod_python causes segmentation fault in Apache httpd
Status: CLOSED DUPLICATE of bug 254241
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd   
(Show other bugs)
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-06-06 16:43 UTC by Piotrek Marciniak
Modified: 2007-11-30 22:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-09-02 19:32:56 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Log from gdb (6.80 KB, text/plain)
2007-06-06 16:43 UTC, Piotrek Marciniak
no flags Details

Description Piotrek Marciniak 2007-06-06 16:43:15 UTC
Description of problem:
I tried to run httpd after a long time of not using it, and it terminated while
starting showing message about segmantation fault. When i run http under gdb it
shown an exception from mod_python. And, when i disabled mod_python loading,
httpd started just fine.

Version-Release number of selected component (if applicable):

(just in case)

How reproducible:

Steps to Reproduce:
1. Run httpd (/usr/sbin/httpd)
Actual results:
It terminates just after it was run and shows a message abotu segmentation fault.

Expected results:
errorless start of httpd

Additional info:

I attached log from gdb

Comment 1 Piotrek Marciniak 2007-06-06 16:43:15 UTC
Created attachment 156369 [details]
Log from gdb

Comment 2 Piotrek Marciniak 2007-06-06 16:49:10 UTC
Comment on attachment 156369 [details]
Log from gdb

These lines:

---Type <return> to continue, or q <return> to quit---Error while reading
shared library symbols:

are because i accidentally preseed Ctrl C

Comment 4 Joe Orton 2007-07-26 15:02:45 UTC
There's nothing useful in there.  It's better to do:

# echo CoreDumpDirectory /tmp > /etc/httpd/conf.d/core.conf

and generate a core dump, then analyse that after-the-fact with gdb.

Make sure you have up-to-date httpd, python, httpd-debuginfo, python-debuginfo
etc packages before running gdb.

Comment 5 Jonathan Kamens 2007-09-02 18:49:27 UTC
I am having this problem with httpd-2.2.4-9 and mod_python-3.3.1-4 from devel. 
When run under the debugger, I find that the coredump is occurring at line 1549
of mod_python.c, in python_handler

1549        conf = (py_config *) ap_get_module_config(req->per_dir_config, 

req->per_dir_config is null at this point.  I put breakpoints in python_handler
and python_create_dir_config, and I found that for some requests python_handler
is being called when python_create_dir_config hasn't been called.  I don't
understand the Apache ABI / module mechanism well enough to know whether
python_create_dir_config is always supposed to be called (in which case Apache
is doing something wrong?) or sometimes isn't called (in which case mod_python
is doing something wrong?).

Comment 6 Jonathan Kamens 2007-09-02 18:51:57 UTC
I should mention that the request that causes the segfault is one that doesn't
actually need python for processing.

Comment 7 Jonathan Kamens 2007-09-02 18:56:41 UTC
Changing component from mod_python to httpd.  When I disable mod_python from
loading, I get a crash in the same call (ap_get_module_config) inside mod_suphp.
 This suggests that httpd, rather than mod_python or mod_suphp, is at fault.  Or
perhaps mod_python and mod_suphp need to be rebuilt against current httpd-devel?

Comment 8 Jonathan Kamens 2007-09-02 19:07:31 UTC
Yes, rebuilding mod_python and mod_suphp solved the problem.  Does that mean
there should be separte mod_python and mod_suphp tickets for this, rather than a
single httpd ticket?  Not sure how the bookkeeping should be handled...

Comment 9 Joe Orton 2007-09-02 19:32:56 UTC

*** This bug has been marked as a duplicate of 254241 ***

Note You need to log in before you can comment on or make changes to this bug.