httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James G Smith <jgsm...@jamesmith.com>
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 www.apache.org or dev.apache.org.
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

gdb:

Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/libexec/ld.so...done.
Reading symbols from /usr/lib/libc.so.23.1...done.
#0  ap_lock (lock=0x0) at locks.c:130
yy/home/jgsmith/apache-2.0/src/lib/apr/locks/unix/locks.c:130:5267:beg:0x357b1
(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;
#ifdef POOL_DEBUG
    char s;

    known_stack_point = &s;
    stack_var_init(&s);
#endif
    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);
#ifdef ALLOC_STATS
    atexit(dump_stats);
#endif

    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 - jgsmith@jamesmith.com | http://www.jamesmith.com/
            jsmith@sourcegarden.org | http://sourcegarden.org/
              jgsmith@tamu.edu      | http://cis.tamu.edu/systems/opensystems/
------------------------------------+------------------------------------------

Mime
View raw message