Subject: Re: DIAGNOSTIC in -current
To: Pavel Cahyna <pavel@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: current-users
Date: 09/20/2006 19:36:36
On Wed, Sep 20, 2006 at 04:57:47PM +0200, Pavel Cahyna wrote:
> > also, I believe that currently DIAGNOSTIC is still treated by the LKM
> > infrastructure as causing LKMs to be incompatible, even though this option
> > no longer changes the kernel ABI after some changes I made at the end of
> > last year.
>
> How does this work? if DIAGNOSTIC is defined, free() apparently fills freed
> memory with a known pattern and malloc() checks for it. If a LKM (not
> compiled with DIAGNOSTIC) frees some memory with FREE() (which is a macro),
> and then the DIAGNOSTIC code will try to allocate this piece of memory, it
> won't find the magic pattern and will panic. Or am I missing something?
that is another valid issue. I'd say we should define FREE() as free()
always (or just replace FREE() with free() and eliminate FREE()).
-Chuck