From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 22 06:40:18 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CF7B16A400 for ; Mon, 22 Jan 2007 06:40:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 7AAD813C45D for ; Mon, 22 Jan 2007 06:40:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0M6eIJS015489 for ; Mon, 22 Jan 2007 06:40:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0M6eIq8015488; Mon, 22 Jan 2007 06:40:18 GMT (envelope-from gnats) Resent-Date: Mon, 22 Jan 2007 06:40:18 GMT Resent-Message-Id: <200701220640.l0M6eIq8015488@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Craig Rodrigues Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0CE9616A400 for ; Mon, 22 Jan 2007 06:35:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id F1D7513C45A for ; Mon, 22 Jan 2007 06:35:30 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l0M6ZUoM001699 for ; Mon, 22 Jan 2007 06:35:30 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l0M6ZUZC001698; Mon, 22 Jan 2007 06:35:30 GMT (envelope-from nobody) Message-Id: <200701220635.l0M6ZUZC001698@www.freebsd.org> Date: Mon, 22 Jan 2007 06:35:30 GMT From: Craig Rodrigues To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: kern/108201: MOKB testcase for kqueue can cause kernel panic X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 06:40:18 -0000 >Number: 108201 >Category: kern >Synopsis: MOKB testcase for kqueue can cause kernel panic >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 22 06:40:17 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Craig Rodrigues >Release: CURRENT >Organization: >Environment: FreeBSD 7.0-CURRENT FreeBSD 7.0-CURRENT #35: Sun Jan 21 23:32:23 EST 2007 >Description: The attached testcase from "Month of Kernel Bugs" http://projects.info-pull.com/mokb/MOKB-24-11-2006.html causes the following panic on my system: panic: mutex kqueue own at /usr/src/sys/kern/kern_event.c: 1069 I cannot get a proper gdb backtrace. The ddb stack trace looks like: kqueue_expand() kqueue_register() filt_proc() knote() fork() fork() syscall() >How-To-Repeat: >Fix: Patch attached with submission follows: /* * Obtained from: * http://projects.info-pull.com/mokb/MOKB-24-11-2006.html */ #include #include #include #include #include int main(void) { struct kevent ke; int kq; kq = kqueue(); EV_SET(&ke, getpid(), EVFILT_PROC, EV_ADD, NOTE_EXIT|NOTE_EXEC|NOTE_TRACK, 0, NULL); kevent(kq, &ke, 1, NULL, 0, NULL); if (fork() != 0) kevent(kq, NULL, 0, &ke, 1, NULL); return (0); } >Release-Note: >Audit-Trail: >Unformatted: