Bug 47743

Summary: mod_so segfaults at server startup in ap_find_loaded_module_symbol
Product: Apache httpd-2 Reporter: Graham Leggett <minfrin>
Component: mod_soAssignee: Apache HTTPD Bugs Mailing List <bugs>
Severity: normal Keywords: MassUpdate
Priority: P2    
Version: 2.2.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Graham Leggett 2009-08-26 09:04:13 UTC
On server startup, mod_so segfaults as follows:

Program received signal SIGSEGV, Segmentation fault.
0x007a7c93 in ap_find_loaded_module_symbol (s=0x9338a40, modname=0x93400b1 "mod_imagechef.c") at /usr/src/debug/httpd-2.2.3/modules/mappers/mod_so.c:340
340 modie = (ap_module_symbol_t *)sconf->loaded_modules->elts;
(gdb) bt full
#0 0x007a7c93 in ap_find_loaded_module_symbol (s=0x9338a40, modname=0x93400b1 "mod_imagechef.c") at /usr/src/debug/httpd-2.2.3/modules/mappers/mod_so.c:340
i = <value optimized out> 

The code that explodes looks like this:

static module *ap_find_loaded_module_symbol(server_rec *s, const char *modname)
    so_server_conf *sconf;
    ap_module_symbol_t *modi;
    ap_module_symbol_t *modie;
    int i;

    sconf = (so_server_conf *)ap_get_module_config(s->module_config,
    modie = (ap_module_symbol_t *)sconf->loaded_modules->elts;

    for (i = 0; i < sconf->loaded_modules->nelts; i++) {
        modi = &modie[i];
        if (modi->name != NULL && strcmp(modi->name, modname) == 0) {
            return modi->modp;
    return NULL;

Currently, the suspicion is that a module compiled for v2.2.12 is being installed in v2.2.3, but this should either work, or give an error, it shouldn't segfault.
Comment 1 Ruediger Pluem 2009-08-26 12:33:43 UTC
What are the values of sconf and sconf->loaded_modules?
Comment 2 Graham Leggett 2009-08-27 09:41:15 UTC
sconf seems valid, but sconf->loaded_modules is NULL.

I am struggling to convince gdb to tell me the address of sconf->loaded_modules when the sconf is created so I can set a watchpoint, gdb keeps telling me the variable soc in so_sconf_create() doesn't exist.
Comment 3 William A. Rowe Jr. 2018-11-07 21:08:23 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.