httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <>
Subject Re: [PATCH] using freed memory, and a memory debugger
Date Wed, 08 Oct 1997 20:55:11 GMT
On Wed, Oct 08, 1997 at 03:09:29AM -0700, Dean Gaudet wrote:
> Both those fixes are included. 
> Can the segfault folks give this a whirl and see what you get? 

Yup, bingo! Here's the first (of probably more) core dumps detected by
your  ALLOC_DEBUG code:

kill() at 0x80015594
debug_verify_filled(ptr = 0x8119a9c, endp = 0x811ba9c, error_msg = "Ouch!  Someone trounced
a block on the free list!\n"), line 128 in "alloc.c"
new_block(min_size = 80), line 235 in "alloc.c"
$b20, line 464 in "alloc.c"
palloc(a = 0x8117a8c, reqsize = 80), line 464 in "alloc.c"
$b23, line 483 in "alloc.c"
pcalloc(a = 0x8117a8c, size = 80), line 483 in "alloc.c"
$b33, line 576 in "alloc.c"
make_array(p = 0x8117a8c, nelts = 10, elt_size = 8), line 576 in "alloc.c"
make_table(p = 0x8117a8c, nelts = 10), line 695 in "alloc.c"
init_mime() at 0x8054897
init_modules() at 0x80783d7
standalone_main() at 0x8073173
.main(0x6, 0x80477ac, 0x80477c8) at 0x80737fd
_start() at 0x804aacb

BTW: I got this dump in a SINIX (i486 SVR4) machine. This morming, I've
been testing apache on mainframe POSIX, a totally different architecture,
processor, character set (EBCDIC in place of ASCII). I was hunting down
another core dump (but without dbx, they've got a totally different
mainframe debugger). And guess what: the traceback showed exactly the
same function stack (i.e. a routine in alloc.c, called from init_mime();
it was table_set(), not palloc(), however, because at that time I hadn't
added your patch yet).

In the meantime, I added another layer of alloc debugging (pool debugging
code: it writes a "magic number" (the pool address) into the pool header
and verifies that it's still there on each invocation of a pool related
function. (After that, still another layer could add debugging for each
allocated element).

I'll append my additions, maybe you want to add them - even though, until
now, I didn't find another error with it. I tried to keep the patch-
impact to a minimum, therefore I just inserted braces where local
variables prevented me from just inserting VERIFY macros at function
beginning. Not clean... Could be improved...

| S I E M E N S |  <>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

View raw message