httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James G Smith <>
Subject locks used by ap_palloc not initialized
Date Mon, 13 Mar 2000 01:06:27 GMT
I know there's supposed to be a bug database for Apache 2.0, but I
couldn't find it by looking through or
Nor could I find a reference to it in the distribution.  Therefore,
I'm posting this to the list...

uname: OpenBSD jamesmith 2.6 somewhere#0 i386

source: apache-2.0_20000312231229.tar.gz


Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/libexec/
Reading symbols from /usr/lib/
#0  ap_lock (lock=0x0) at locks.c:130
(gdb) bt
#0  ap_lock (lock=0x0) at locks.c:130
#1  0x32641 in ap_palloc (c=0x484e0, reqsize=20) at apr_pools.c:858
#2  0x20306 in create_process (argc=3, argv=0xdfbfdcc8) at http_main.c:216
#3  0x20a94 in main (argc=3, argv=0xdfbfdcc8) at http_main.c:302

Seems the locks used by ap_palloc are not being initialized.  Looking
at the code seems to suggest a circular thought (pulled from a couple
of files):

static ap_lock_t *alloc_mutex;
static ap_lock_t *spawn_mutex;

ap_pool_t *ap_init_alloc(void)
    ap_status_t status1, status2;
    char s;

    known_stack_point = &s;
    status1 = ap_create_lock(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS,
                   NULL, NULL);
    status2 = ap_create_lock(&spawn_mutex, APR_MUTEX, APR_INTRAPROCESS,
                   NULL, NULL);
    if (status1 != APR_SUCCESS || status2 != APR_SUCCESS) {
        return NULL;

    permanent_pool = ap_make_sub_pool(NULL, NULL);

    return permanent_pool;

ap_status_t ap_create_lock(struct lock_t **lock, ap_locktype_e type, 
                           ap_lockscope_e scope, char *fname, 
                           ap_context_t *cont)
    struct lock_t *new;
    ap_status_t stat;

    new = (struct lock_t *)ap_palloc(cont, sizeof(struct lock_t));

    *lock = new;
    return APR_SUCCESS;

However, ap_palloc requires the existance of the two locks which
ap_create_lock is calling ap_palloc to make.

ap_initialize() doesn't ever come near to calling any of this code -- it
only sets up a few items in a structure (via setup_lock()), as far as 
I could tell.

I can't think of a good way to break this.  Anyone want more information?
(Let me know what I need to do to get it for you.)
James Smith - |

View raw message