Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern KASSERT->KASSERTMSG to allow debugging a double-fre...



details:   https://anonhg.NetBSD.org/src/rev/6083065a3a22
branches:  trunk
changeset: 812757:6083065a3a22
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jan 01 18:58:58 2016 +0000

description:
KASSERT->KASSERTMSG to allow debugging a double-free'd buffer in ddb.

diffstat:

 sys/kern/vfs_bio.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r ab72557ade50 -r 6083065a3a22 sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c        Fri Jan 01 17:06:21 2016 +0000
+++ b/sys/kern/vfs_bio.c        Fri Jan 01 18:58:58 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_bio.c,v 1.256 2015/08/24 22:50:32 pooka Exp $      */
+/*     $NetBSD: vfs_bio.c,v 1.257 2016/01/01 18:58:58 martin Exp $     */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.256 2015/08/24 22:50:32 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.257 2016/01/01 18:58:58 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bufcache.h"
@@ -328,7 +328,8 @@
 {
 
        KASSERT(mutex_owned(&bufcache_lock));
-       KASSERT(bp->b_freelistindex == -1);
+       KASSERTMSG(bp->b_freelistindex == -1, "double free of buffer? "
+           "bp=%p, b_freelistindex=%d\n", bp, bp->b_freelistindex);
        TAILQ_INSERT_TAIL(&dp->bq_queue, bp, b_freelist);
        dp->bq_bytes += bp->b_bufsize;
        bp->b_freelistindex = dp - bufqueues;



Home | Main Index | Thread Index | Old Index