lkml.org 
[lkml]   [2008]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 01/15] kmemleak: Add the base support
    From
    Date
    On Fri, 2008-12-12 at 11:36 +0000, Catalin Marinas wrote:
    > On Fri, 2008-12-12 at 00:01 +0200, Pekka Enberg wrote:
    > > On Wed, Dec 10, 2008 at 8:26 PM, Catalin Marinas
    > > <catalin.marinas@arm.com> wrote:
    > > > +static void put_object(struct memleak_object *object)
    > > > +{
    > > > + if (!atomic_dec_and_test(&object->use_count))
    > > > + return;
    > > > +
    > > > + /* should only get here after delete_object was called */
    > > > + BUG_ON(object->flags & OBJECT_ALLOCATED);
    > >
    > > This could be
    > >
    > > if (WARN_ON(object->flags & OBJECT_ALLOCATED))
    > > return;
    >
    > I'm not sure just warning would be enough. If this happens, its a severe
    > bug in kmemleak and the tool is no longer useful (it could even leak
    > memory or free already freed blocks). I could change it to a
    > memleak_panic call but if the object use_count isn't reliable, the
    > memleak_disable call wouldn't work properly either.

    Oh, we use WARN_ON() for things like this as well to maximize the
    likelihood of the oops actually reaching the user. But whatever works
    for you the best.



    \
     
     \ /
      Last update: 2008-12-12 14:17    [W:4.454 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site