From owner-freebsd-virtualization@FreeBSD.ORG Fri Dec 12 03:23:00 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A0471065670 for ; Fri, 12 Dec 2008 03:23:00 +0000 (UTC) (envelope-from antipsychic@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234]) by mx1.freebsd.org (Postfix) with ESMTP id EF59D8FC1F for ; Fri, 12 Dec 2008 03:22:59 +0000 (UTC) (envelope-from antipsychic@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1173417rvf.43 for ; Thu, 11 Dec 2008 19:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:x-priority :content-type:message-id:content-transfer-encoding:from:subject:date :to:x-mailer; bh=upGjaBvPx5F9eLQWj/5c85yRPW3oOLKxbYNahvhC38c=; b=JoCTjjuUyDStErlDuIZiIXLV5rcSL0yoXBlfKe+DT6Rf0wUTxdHQmz6xYm29dv5Aed As/skcaQjNAqmDccF0DYvaaufCsgFWHgEsj3Qr8+t5SHyjVcvZfMHaRKdSombctZwpNj da8grKni+UdNByTxkEDr9XFYs+6P6xMW6HXDs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:x-priority:content-type:message-id :content-transfer-encoding:from:subject:date:to:x-mailer; b=HGCIhza2uQAWYAowSZs3QAwl3Zp6YnV/uUu/pLp7iQnHia4t9zuTzCjWOIVOC+/ZFO yxAvL1nRlHqrOKlc63l93LtAR4G2zkZQdCPDlLEDceiUiUGlttj4sg/j6O1ww8f7JBNZ JFotv16t3fQsWyrWcdJ2WU0mZO12DwCVb3HJc= Received: by 10.142.157.9 with SMTP id f9mr1118121wfe.87.1229050323702; Thu, 11 Dec 2008 18:52:03 -0800 (PST) Received: from ?10.10.16.37? (pool.cloudshield.com [63.150.56.65]) by mx.google.com with ESMTPS id 30sm4697887wfd.44.2008.12.11.18.52.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Dec 2008 18:52:03 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753.1) X-Priority: 3 Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Jake Thalacker Date: Thu, 11 Dec 2008 18:52:00 -0800 To: freebsd-virtualization@freebsd.org X-Mailer: Apple Mail (2.753.1) Subject: SMP refcount_release panic X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 03:23:00 -0000 Sorry, this is overdue on being reported. I've encountered a panic with VIMAGE from a patched build of current from around mid September. I tracked the problem to the second call to refcount_release in kern_vimage.c:vi_td_ioctl(). Just for clarity I determined this by making 3 refcount_release functions to replace the calls including the one in kern_prot.c:crfree(). I noted that throughout the kernel code prior to all kern_prot.c:crcopy() calls there is a PROC_LOCK and proceeded by a PROC_UNLOCK afterward. I found that there was one occurrence where this was missing in netncp/ ncp_comm.c:ncp_conn_alloc(). I added it and that did not resolve the panic but figured it's still probably needed. It's probably poor form but I ended up commenting out the second call and have had no panics since, had to move on at that point. The panic is very reproducible with the following script on an SMP system. I have not observed any panics on non-SMP systems. _vimage="rc-panic-$$" vimage -c ${_vimage} _cnt=0 _fw=1 _loopcount=64 while [ ${_cnt} -lt ${_loopcount} ]; do vimage ${_vimage} sysctl net.inet.ip.forwarding=${_fw} if [ ${_fw} -eq 1 ]; then _fw=0 else _fw=1 fi _cnt=$(expr ${_cnt} '+' 1) done If there's any further information I can provide just let me know, or any testing of new code I'd gladly help out. Thanks for all your efforts! Jake