From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 30 17:11:57 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90D01106566B for ; Fri, 30 Jan 2009 17:11:57 +0000 (UTC) (envelope-from laladelausanne@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0EAA78FC17 for ; Fri, 30 Jan 2009 17:11:56 +0000 (UTC) (envelope-from laladelausanne@gmail.com) Received: by mu-out-0910.google.com with SMTP id i2so469054mue.3 for ; Fri, 30 Jan 2009 09:11:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=AnVwk5RsY7JlGLsv08OwzdYHe30rr/BxgxX3lrNQvCw=; b=xWgy7LESw8uMxT8Z6FK8Xhn5NMl0q5CXc2QbBIareZQcSentWmYjUUSaT2jONG4uNL NON0aMNp2kz5oq9m9FkQUG2CAmy0wHPLXlqV3pvdN2c9dyozAkviQRC/ECtMUC+14WoO 3jL7ICXmcMiJVDwOCk9mL17snkba+2nqltcYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=qqSmde5P1WPjz6giUYvKOTyA3JLcahBEqZq1zrcFAoxUIbfF0WV49YiJmw0wMFV+74 UCvDzLYwhfg0+aqDtd6m9W+GjInVSXSUnSIobdmZcamsTQ2HFCubtU+vsB6ycAWthFNt 8oJDRf9ZB47EnzHoxWeAbtF0X6gD9oeP1V6d0= Received: by 10.103.160.3 with SMTP id m3mr675439muo.25.1233335516057; Fri, 30 Jan 2009 09:11:56 -0800 (PST) Received: from nslpc5.epfl.ch (nslpc5.epfl.ch [128.178.149.20]) by mx.google.com with ESMTPS id g1sm1969959muf.47.2009.01.30.09.11.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Jan 2009 09:11:55 -0800 (PST) Message-Id: <02026848-7F83-405C-B4F3-EDD8B47DA294@gmail.com> From: =?UTF-8?Q?Nikola_Kne=C5=BEevi=C4=87?= To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Fri, 30 Jan 2009 18:11:53 +0100 X-Mailer: Apple Mail (2.930.3) Subject: blockable sleep lock (sleep mutex) 16 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 17:11:58 -0000 Hi, I'm trying to port Click modular router to FreeBSD 7.1, but with a twist. Instead of letting Click run in netisr (as it used to run in FreeBSD 4), I want to have it running in a kthread. I managed to get it running this way, but when I turn on INVARIANTS and WITNESS (along with WITNESS_SKIPSPIN), I get coredumps when I'm trying to install a new configuration... Here is the trace: ---8<--- (kgdb) bt #0 doadump () at pcpu.h:195 #1 0xffffffff8049ef98 in boot (howto=260) at /usr/src/sys/kern/ kern_shutdown.c:418 #2 0xffffffff8049f429 in panic (fmt=Variable "fmt" is not available. ) at /usr/src/sys/kern/kern_shutdown.c:574 #3 0xffffffff804d941c in witness_checkorder (lock=0xffffff0007fdfc50, flags=Variable "flags" is not available. ) at /usr/src/sys/kern/subr_witness.c:877 #4 0xffffffff80493769 in _mtx_lock_flags (m=0xffffff0007fdfc50, opts=0, file=0xffffffff8085536f "/usr/src/sys/vm/uma_core.c", line=1834) at /usr/src/sys/kern/kern_mutex.c:183 #5 0xffffffff806a6aab in uma_zalloc_arg (zone=0xffffff0007fde9c0, udata=0x0, flags=2) at /usr/src/sys/vm/uma_core.c:1834 #6 0xffffffff804908c6 in malloc (size=Variable "size" is not available. ) at uma.h:277 #7 0xffffffff877579bd in operator new[] (sz=Variable "sz" is not available. ) at /home/knl/work/mx/click/bsdmodule/..//lib/glue.cc:285 #8 0xffffffff877856d3 in ?? () #9 0xffffffff8785d540 in ?? () #10 0xffffffff8785d610 in ?? () #11 0x0000000000000000 in ?? () #12 0xffffff0001353300 in ?? () #13 0xffffffff8785d580 in ?? () #14 0xffffffff87777afa in Click::ClickInstance::element_hindexes (this=0x4, result=@0xffffffff8785d610) at vector.hh:96 Previous frame identical to this frame (corrupt stack?) --->8--- This is the message buffer: Unread portion of the kernel message buffer: panic: blockable sleep lock (sleep mutex) 16 @ /usr/src/sys/vm/ uma_core.c:1834 cpuid = 0 Uptime: 24m35s Physical memory: 114 MB Dumping 42 MB: 27 11 Any hints where I should search for the cause? I'm using MTX_DEF mutexes to protect data structures. Click exports its own FS, where each element (part of the router) has its own files. Each file has coresponding function which is responsible for input/ output of the data. So, when I want to create a new router, I write to file named "config". Then, function named write_config takes over, starts the Lexer, which in turns produces elements, which then export their representations in the VFS. All of this happens in the clickfs_close (creation starts when file is closed). If I read the code correctly, vn_closefile locks the Giant, so that may cause problems... Cheers, N.