From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 17 12:21:50 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C392516A4CE for ; Sat, 17 Jul 2004 12:21:50 +0000 (GMT) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDCE743D1F for ; Sat, 17 Jul 2004 12:21:49 +0000 (GMT) (envelope-from glebius@freebsd.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.11/8.12.8) with ESMTP id i6HCLl0E034970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 17 Jul 2004 16:21:48 +0400 (MSD) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.sick.ru (8.12.11/8.12.11/Submit) id i6HCLliq034969 for hackers@freebsd.org; Sat, 17 Jul 2004 16:21:47 +0400 (MSD) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@freebsd.org using -f Date: Sat, 17 Jul 2004 16:21:47 +0400 From: Gleb Smirnoff To: hackers@freebsd.org Message-ID: <20040717122147.GC34801@cell.sick.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: linker_load_module(NULL, "modname", ...) from thread with no user process X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jul 2004 12:21:50 -0000 Dear hackers, there is problem when linker_load_module() is called from a kernel thread with no associated user process, and it asks to load module by name, not by filename. With such parameters it requires looking through device.hints file. And vn_open() assumes that ndp->ni_cnd->cn_thread->td_proc is valid. Any ideas how to solve this? Here is a sample backtrace: #8 0xc06ba0b3 in trap (frame= {tf_fs = -1946419176, tf_es = 2106261520, tf_ds = 607387664, tf_edi = -877233464, tf_esi = -1066365186, tf_ebp = -877234268, tf_isp = -877234312, tf_ebx = 2065, tf_edx = -877233504, tf_ecx = 0, tf_eax = -1051754144, tf_trapno = 12, tf_err = 0, tf_eip = -1068097648, tf_cs = 8, tf_eflags = 66182, tf_esp = -1056682528, tf_ss = 0}) at /usr/src/sys/i386/i386/trap.c:417 #9 0xc0561f90 in _mtx_lock_flags (m=0x0, opts=0, file=0xc0708efe "/usr/src/sys/kern/vfs_subr.c", line=2065) at /usr/src/sys/kern/kern_mutex.c:247 #10 0xc05c989c in vref (vp=0x811) at /usr/src/sys/kern/vfs_subr.c:2065 #11 0xc05c2438 in namei (ndp=0xcbb67aa0) at /usr/src/sys/kern/vfs_lookup.c:161 #12 0xc05d4f63 in vn_open_cred (ndp=0xcbb67aa0, flagp=0xcbb6797c, cmode=0, cred=0xc14eae80, fdidx=0) at /usr/src/sys/kern/vfs_vnops.c:191 #13 0xc05d4cf3 in vn_open (ndp=0x0, flagp=0x0, cmode=0, fdidx=0) at /usr/src/sys/kern/vfs_vnops.c:91 #14 0xc055ddc3 in linker_hints_lookup ( path=0xc074d160 "/boot/kernel;/boot/kernel;/boot/modules", pathlen=12, modname=0xcbb67b68 "ng_tee", modnamelen=6, verinfo=0x0) at /usr/src/sys/kern/kern_linker.c:1474 #15 0xc055e2da in linker_search_module (modname=0xcbb67b68 "ng_tee", modnamelen=6, verinfo=0x0) at /usr/src/sys/kern/kern_linker.c:1594 #16 0xc055e49b in linker_load_module (kldname=0x0, modname=0xcbb67b68 "ng_tee", parent=0x0, verinfo=0x0, lfpp=0xcbb67b64) at /usr/src/sys/kern/kern_linker.c:1683 #17 0xc1b49aa6 in ng_make_node () from /boot/kernel/netgraph.ko #18 0xc1b4bb61 in ng_mkpeer () from /boot/kernel/netgraph.ko #19 0xc1b4d9b1 in ng_generic_msg () from /boot/kernel/netgraph.ko #20 0xc1b4d615 in ng_apply_item () from /boot/kernel/netgraph.ko #21 0xc1b4fa2b in ngintr () from /boot/kernel/netgraph.ko #22 0xc05e236a in swi_net (dummy=0x0) at /usr/src/sys/net/netisr.c:255 #23 0xc0554d22 in ithread_loop (arg=0xc14f5400) at /usr/src/sys/kern/kern_intr.c:544 #24 0xc0553dd2 in fork_exit (callout=0xc0554ba0 , arg=0x0, frame=0x0) at /usr/src/sys/kern/kern_fork.c:816 -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE