--

Here's some more details on that crash...
=====================
I tried putting the line 

        jserv_pool = NULL;

at the beginning of the jserv_init function.  This stops the
crashes but I don't know if it has bugs of its own.  It's certainly
an ugly fix.  Any advice from the mod_jserv list would be appreciated.

To recap, the problem is that jserv_init does something like
        jserv_protocol_initall (...);
        ...
        jserv_pool = ap_make_sub_pool (p);
        ...
        return; }

where jserv_protocol_initall does something with jserv_pool if
jserv_pool
is not NULL.  Since jserv_pool is initially NULL, this works ok.  But
after
jserv_init returns, ap_clear_pool destroys jserv_pool (at least under -X
from standalone_main, and apparently also with multiple processes,
though
I haven't traced it).  Then later, jserv_init gets called again, so it
can
reinitialize jserv_pool.  Except before jserv_pool gets set,
jserv_protocol_install
tries to use the *old* value of jserv_pool, which now points to freed
memory.

This hadn't been causing any problems here til recently.  I think what
has happened
is this.  ap_clear_pool leaves the old jserv_pool on the alloc.c free
list.  It also frees
some other stuff which also goes on the free list.  Until recently,
between the
ap_clear_pool call and resetting jserv_pool, the memory pointed to by
jserv_pool
hadn't actually been allocated by anyone else, so its contents were
undisturbed
and jserv_protocol_initall didn't crash.  Recenty I changed my
Stronghold configuration
to have some more certificate info or something like that.  That meant
that more stuff
got allocated; in particular, the block still pointed to by jserv_pool
got allocated and
trashed.  I think turning on ALLOC_DEBUG would confirm this pretty
quickly, though
I didn't try running with ALLOC_DEBUG turned on.

The idea of the jserv_pool = NULL patch is to make sure that
jserv_protocol_initall
doesn't try to use the now-freed jserv_pool.  But I'm not sure this is
the right fix.
I don't understand why it is that jserv_pool isn't allocated BEFORE
calling the
other stuff.  But I figured the implementers did it that way for a
reason, so I 
didn't change it.  Maybe someone who understands the logic of the
program better
than I do can answer this.

Any help would be much appreciated.  Thanks.

Paul Rubin
Brodia



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to