[issue1873] Panic upon usb mouse detach and reattaching

Rumko (via DragonFly issue tracker) sinknull at leaf.dragonflybsd.org
Sat Jan 29 08:22:59 PST 2011


Rumko <rumcic at gmail.com> added the comment:

A workaround has been provided by sjg ... by commenting out knote_remove, the
panic will not occur but small amounts of memory will be leaked.

----------
status: unread -> chatting

_____________________________________________________
DragonFly issue tracker <bugs at lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue1873>
_____________________________________________________From bcd1b4233bd313cfdc18c95ae99cb976052b76e1 Mon Sep 17 00:00:00 2001
From: Rumko <rumcic at gmail.com>
Date: Tue, 28 Dec 2010 14:09:38 +0100
Subject: [PATCH 1/2] devfs_core.c: workaround for issue1873

---
 sys/vfs/devfs/devfs_core.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sys/vfs/devfs/devfs_core.c b/sys/vfs/devfs/devfs_core.c
index 052b86b..e950ac0 100644
--- a/sys/vfs/devfs/devfs_core.c
+++ b/sys/vfs/devfs/devfs_core.c
@@ -2303,9 +2303,15 @@ devfs_detached_filter_eof(struct knote *kn, long hint)
 static void
 devfs_detached_filter_detach(struct knote *kn)
 {
+#if 0
 	cdev_t dev = (cdev_t)kn->kn_hook;
 
 	knote_remove(&dev->si_kqinfo.ki_note, kn);
+#endif
+	devfs_debug(DEVFS_DEBUG_SHOW,
+		"Leaked %d due to missing knote_remove!\n",
+		sizeof(*kn));
+	print_backtrace(-1); /* XXX HACK - knote_remove -> panic */
 }
 
 static struct filterops devfs_detached_filterops =
-- 
1.7.3.5





More information about the Bugs mailing list