From owner-freebsd-current@FreeBSD.ORG Thu Oct 9 02:59:47 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8243316A4B3 for ; Thu, 9 Oct 2003 02:59:47 -0700 (PDT) Received: from zibbi.icomtek.csir.co.za (zibbi.icomtek.csir.co.za [146.64.24.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id E709D43FBF for ; Thu, 9 Oct 2003 02:59:41 -0700 (PDT) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: from zibbi.icomtek.csir.co.za (localhost [IPv6:::1]) h999xZqs012159 for ; Thu, 9 Oct 2003 11:59:35 +0200 (SAST) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: (from jhay@localhost) by zibbi.icomtek.csir.co.za (8.12.9/8.12.9/Submit) id h999xZQP012158 for current@freebsd.org; Thu, 9 Oct 2003 11:59:35 +0200 (SAST) (envelope-from jhay) Date: Thu, 9 Oct 2003 11:59:35 +0200 From: John Hay To: current@freebsd.org Message-ID: <20031009095934.GA11841@zibbi.icomtek.csir.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: panic: vm_map_wire: lookup failed X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2003 09:59:47 -0000 Hi, The latest development source of ntpd started to use setrlimit() before using mlockall(). This combination proves fatal on -current. The code in ntpd/ntpd.c looks like this: ########### #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined(MCL_FUTURE) # ifdef HAVE_SETRLIMIT /* * Set the stack limit to something smaller, so that we don't lock a lot * of unused stack memory. */ { struct rlimit rl; if (getrlimit(RLIMIT_STACK, &rl) != -1 && (rl.rlim_cur = 20 * 4096) < rl.rlim_max) { if (setrlimit(RLIMIT_STACK, &rl) == -1) { msyslog(LOG_ERR, "Cannot adjust stack limit for mlockall: %m"); } } } # endif /* HAVE_SETRLIMIT */ /* * lock the process into memory */ if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0) msyslog(LOG_ERR, "mlockall(): %m"); #else /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */ ########### The panic message is: panic: vm_map_wire: lookup failed and a backtrace looks like this: ############## (kgdb) bt #0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240 #1 0xc047ff07 in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:372 #2 0xc04801c8 in panic () at /usr/src/sys/kern/kern_shutdown.c:550 #3 0xc055a714 in vm_map_wire (map=0xc0e0c6e4, start=0, end=3216949248, flags=3) at /usr/src/sys/vm/vm_map.c:1919 #4 0xc055d113 in mlockall (td=0x0, uap=0xc6361d14) at /usr/src/sys/vm/vm_map.h:201 #5 0xc0591efb in syscall (frame= {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = -1077936788, tf_esi = 2, tf_ebp = -1077936904, tf_isp = -969532044, tf_ebx = -1077936944, tf_edx = 0, tf_ecx = 9, tf_eax = 324, tf_trapno = 12, tf_err = 2, tf_eip = 673338079, tf_cs = 31, tf_eflags = 658, tf_esp = -1077937108, tf_ss = 47}) at /usr/src/sys/i386/i386/trap.c:1006 #6 0xc0584c5d in Xint0x80_syscall () at {standard input}:144 ---Can't read userspace from dump, or kernel process--- (kgdb) ############## John -- John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org