From 8e585686fbf347edebe2ecf9e40d9626c852088e Mon Sep 17 00:00:00 2001 From: cegger Date: Fri, 5 Feb 2010 11:06:36 +0000 Subject: [PATCH] fix LOCKDEBUG panic 'uninitialized lock'. seminit() calls exithook_establish(). exithook_establish() uses the exec_lock. exec_lock is initialzed by exec_init(1). Call exec_init(1) before seminit(). --- sys/kern/init_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 953aae619b8a..da26c11e1eea 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.417 2010/01/31 03:57:01 pooka Exp $ */ +/* $NetBSD: init_main.c,v 1.418 2010/02/05 11:06:36 cegger Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.417 2010/01/31 03:57:01 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.418 2010/02/05 11:06:36 cegger Exp $"); #include "opt_ddb.h" #include "opt_ipsec.h" @@ -514,6 +514,11 @@ main(void) shminit(); #endif + vmem_rehash_start(); /* must be before exec_init */ + + /* Initialize exec structures */ + exec_init(1); /* seminit calls exithook_establish() */ + #ifdef SYSVSEM /* Initialize System V style semaphores. */ seminit(); @@ -685,11 +690,6 @@ main(void) uvm_aiodone_worker, NULL, PRI_VM, IPL_NONE, WQ_MPSAFE)) panic("fork aiodoned"); - vmem_rehash_start(); - - /* Initialize exec structures */ - exec_init(1); - /* * Okay, now we can let init(8) exec! It's off to userland! */