You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Dongqiang Bai <ba...@dreamarts.co.jp> on 2000/05/01 17:46:16 UTC

config/6041: coredump at ap_handle_command() when httpd reading httpd.conf file.

>Number:         6041
>Category:       config
>Synopsis:       coredump at ap_handle_command() when httpd reading httpd.conf file.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon May 01 08:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     bai@dreamarts.co.jp
>Release:        1.3.9 (UNIX)
>Organization:
apache
>Environment:
Linux 2.2.13-10 i686
no patch
gcc
(This problem seems don't depend on OS or compiler, rather a bug)
>Description:
% gdb $APABIN/httpd core
-------------------------------------------------------------------------
#0  0x8065d19 in ap_set_flag_slot (cmd=0xbffff96c, struct_ptr=0x0, arg=1)
    at http_config.c:1062
1062        *(int *) (struct_ptr + offset) = arg ? 1 : 0;
(gdb) where
#0  0x8065d19 in ap_set_flag_slot (cmd=0xbffff96c, struct_ptr=0x0, arg=1)
    at http_config.c:1062
#1  0x8065905 in invoke_cmd (cmd=0x80ab284, parms=0xbffff96c, mconfig=0x0,
    args=0xbfffd8f9 "") at http_config.c:928
#2  0x8065bd1 in ap_handle_command (parms=0xbffff96c, config=0x80c59ec,
    l=0xbfffd8ec "EnableTest on") at http_config.c:1008
#3  0x8065c6d in ap_srm_command_loop (parms=0xbffff96c, config=0x80c59ec)
    at http_config.c:1022
#4  0x80660c4 in ap_process_resource_config (s=0x80c5074,
    fname=0x80c62ac "/usr/local/apache/conf/httpd.conf", p=0x80c504c,
    ptemp=0x80c906c) at http_config.c:1202
#5  0x8066a2c in ap_read_config (p=0x80c504c, ptemp=0x80c906c,
    confname=0x80bd900 "conf/httpd.conf") at http_config.c:1481
#6  0x807102c in main (argc=1, argv=0xbffffa94) at http_main.c:4812
>How-To-Repeat:
(1) CC="gcc -g" configure --activate-module=src/modules/extra/mod_test.o
(2) The output of the command "diff httpd.conf.default httpd.conf" is:
    295a296,297
    > EnableTest on
    > 
(3) The mod_test.c is as follows:
---------------------------------------
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"

module test_module;

/* server config */
typedef struct {
    int  enabled;
} test_config_rec;

static void *create_test_config(pool *p, server_rec *dummy) {
    test_config_rec *conf =
            (test_config_rec *)ap_pcalloc(p, sizeof(test_config_rec));
    conf->enabled = 0;
}

static const command_rec test_cmds[] = {
    {"EnableTest", ap_set_flag_slot,
            (void*)XtOffsetOf(test_config_rec, enabled), OR_FILEINFO, FLAG,
            "whether or not to enable test"},
    {NULL}
};

static int test_fixup(request_rec *req) {
    return OK;
}

module test_module = {
    STANDARD_MODULE_STUFF,
    NULL,                       /* initializer */
    NULL,                       /* dir config creater */
    NULL,                       /* dir merger --- default is to override */
    create_test_config,         /* server config */
    NULL,                       /* merge server configs */
    test_cmds,                  /* command table */
    NULL,                       /* handlers */
    NULL,                       /* filename translation */
    NULL,                       /* check_user_id */
    NULL,                       /* check auth */
    NULL,                       /* check access */
    NULL,                       /* type_checker */
    test_fixup,                 /* fixups */
    NULL,                       /* logger */
    NULL,                       /* header parser */
    NULL,                       /* child_init */
    NULL,                       /* child_exit */
    NULL                        /* post read-request */
};
>Fix:
ap_set_config_vectors() should(?) return sconfig when mconfig==NULL.
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]