From owner-p4-projects@FreeBSD.ORG Thu Sep 9 19:02:38 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0FC3D16A4D0; Thu, 9 Sep 2004 19:02:38 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C64F016A4CE for ; Thu, 9 Sep 2004 19:02:37 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA07E43D5C for ; Thu, 9 Sep 2004 19:02:37 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i89J2bOn022757 for ; Thu, 9 Sep 2004 19:02:37 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i89J2bo3022754 for perforce@freebsd.org; Thu, 9 Sep 2004 19:02:37 GMT (envelope-from jhb@freebsd.org) Date: Thu, 9 Sep 2004 19:02:37 GMT Message-Id: <200409091902.i89J2bo3022754@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 61256 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2004 19:02:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=61256 Change 61256 by jhb@jhb_slimer on 2004/09/09 19:01:42 Fix compile and add a new double fault inducing test. Affected files ... .. //depot/projects/smpng/sys/modules/crash/crash.c#12 edit Differences ... ==== //depot/projects/smpng/sys/modules/crash/crash.c#12 (text+ko) ==== @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -52,7 +53,7 @@ #include #include -#define MAX_EVENT 19 +#define MAX_EVENT 20 static struct sx foo, bar, bar2; static struct cv event_cv; @@ -80,6 +81,7 @@ "use test1 and test2 mutexes to test witness removal", "try lock tests including recursion test", "test witness_defineorder and witness_checkorder", + "blow the kernel stack on purpose", }; static int mod_event(struct module *module, int cmd, void *arg); @@ -111,6 +113,15 @@ SYSCTL_PROC(_debug_crash, OID_AUTO, test, CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_debug_crash_test, "I", ""); +static int +blow_stack(void) +{ + char dummy[512]; + + dummy[0] += blow_stack(); + return (dummy[0]); +} + static void crash_thread(void *arg) { @@ -196,9 +207,9 @@ sx_xunlock(&foo); break; case 13: - Debugger("about to init again"); + kdb_enter("about to init again"); mtx_init(&test_mtx, "test", NULL, MTX_DEF); - Debugger("if we haven't panic'd by now, ouch. :("); + kdb_enter("if we haven't panic'd by now, ouch. :("); mtx_destroy(&test_mtx); break; case 14: @@ -220,18 +231,18 @@ bzero(&test2_mtx, sizeof(test2_mtx)); mtx_init(&test1_mtx, "test1", NULL, MTX_DEF); mtx_init(&test2_mtx, "test2", NULL, MTX_DEF); - Debugger("no order yet"); + kdb_enter("no order yet"); mtx_lock(&Giant); mtx_lock(&test1_mtx); mtx_lock(&test2_mtx); mtx_unlock(&test2_mtx); mtx_unlock(&test1_mtx); mtx_unlock(&Giant); - Debugger("test1 and test2 should be ordered"); + kdb_enter("test1 and test2 should be ordered"); mtx_destroy(&test1_mtx); - Debugger("test1 should be gone, test2 should be after Giant"); + kdb_enter("test1 should be gone, test2 should be after Giant"); mtx_destroy(&test2_mtx); - Debugger("test1 and test2 should be gone"); + kdb_enter("test1 and test2 should be gone"); break; case 18: bzero(&test1_mtx, sizeof(test1_mtx)); @@ -263,11 +274,11 @@ bzero(&test2_mtx, sizeof(test2_mtx)); mtx_init(&test1_mtx, "test1", NULL, MTX_DEF); mtx_init(&test2_mtx, "test2", NULL, MTX_DEF); - Debugger("no order yet"); + kdb_enter("no order yet"); status = WITNESS_DEFINEORDER(&test1_mtx, &test2_mtx); printf("Status of test1 -> test2 set order should be 0: %d\n", status); - Debugger("order should be test1 then test2"); + kdb_enter("order should be test1 then test2"); printf("Check order of test1 -> test2 should succeed.\n"); mtx_lock(&test1_mtx); witness_check_mutex(&test2_mtx); @@ -291,6 +302,9 @@ mtx_destroy(&test1_mtx); mtx_destroy(&test2_mtx); break; + case 20: + (void)blow_stack(); + break; default: panic("event %d is bogus\n", event); } @@ -318,7 +332,7 @@ mtx_lock_spin(&sched_lock); td->td_priority = PRI_MIN_IDLE; TD_SET_CAN_RUN(td); - setrunqueue(td); + setrunqueue(td, SRQ_BORING); mtx_unlock_spin(&sched_lock); kthread = p; return (0);