From nobody@FreeBSD.org  Wed Jan 16 14:15:23 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 1DCC7B5E
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 16 Jan 2013 14:15:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id E5CA1B27
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 16 Jan 2013 14:15:22 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r0GEFLVa009970
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 16 Jan 2013 14:15:21 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r0GEFLQ6009969;
	Wed, 16 Jan 2013 14:15:21 GMT
	(envelope-from nobody)
Message-Id: <201301161415.r0GEFLQ6009969@red.freebsd.org>
Date: Wed, 16 Jan 2013 14:15:21 GMT
From: Olivier Cochard-Labbe <olivier@cochard.me>
To: freebsd-gnats-submit@FreeBSD.org
Subject: tmpfs panic during building a nanobsd image + ports
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175353
>Category:       kern
>Synopsis:       [tmpfs] [panic] panic during building a nanobsd image + ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mjg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 16 14:20:00 UTC 2013
>Closed-Date:    Thu Jan 17 23:06:40 UTC 2013
>Last-Modified:  Thu Jan 17 23:06:40 UTC 2013
>Originator:     Olivier Cochard-Labbe
>Release:        9.1-RELEASE
>Organization:
BSD Router Project
>Environment:
FreeBSD orange.bsdrp.net 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Each time I'm trying to build my customized nanobsd image using tmpfs as a workdir, my system crash.
This problem is reproductible.

# First crash log
Here, I'm trying to cross-compile an i386 image from my amd64:

Jan 16 13:32:06 <kern.crit> orange kernel: Sleeping thread (tid 101584, pid 91068) owns a non-sleepable lock
Jan 16 13:32:06 <kern.crit> orange kernel: KDB: stack backtrace of thread 101584:
Jan 16 13:32:06 <kern.crit> orange kernel: #0 0xffffffff808f2d46 at mi_switch+0x186
Jan 16 13:32:06 <kern.crit> orange kernel: #1 0xffffffff8092b13c at sleepq_catch_signals+0x2cc
Jan 16 13:32:06 <kern.crit> orange kernel: #2 0xffffffff8092bac6 at sleepq_wait_sig+0x16
Jan 16 13:32:06 <kern.crit> orange kernel: #3 0xffffffff808f33fd at _sleep+0x29d
Jan 16 13:32:06 <kern.crit> orange kernel: #4 0xffffffff808b97c5 at kern_wait+0x6e5
Jan 16 13:32:06 <kern.crit> orange kernel: #5 0xffffffff80c45c95 at freebsd32_wait4+0x35

# second crash log
Here I only want to build an image:

Jan 16 14:56:26 <kern.crit> orange kernel: Sleeping thread (tid 100617, pid 54652) owns a non-sleepable lock
Jan 16 14:56:26 <kern.crit> orange kernel: KDB: stack backtrace of thread 100617:
Jan 16 14:56:26 <kern.crit> orange kernel: #0 0xffffffff808f2d46 at mi_switch+0x186
Jan 16 14:56:26 <kern.crit> orange kernel: #1 0xffffffff8092b13c at sleepq_catch_signals+0x2cc
Jan 16 14:56:26 <kern.crit> orange kernel: #2 0xffffffff8092bac6 at sleepq_wait_sig+0x16
Jan 16 14:56:26 <kern.crit> orange kernel: #3 0xffffffff808f33fd at _sleep+0x29d
Jan 16 14:56:26 <kern.crit> orange kernel: #4 0xffffffff808b97c5 at kern_wait+0x6e5
Jan 16 14:56:26 <kern.crit> orange kernel: #5 0xffffffff808b9995 at sys_wait4+0x35

# system info

My system have 56G of RAM, 8 cores and ZFS enabled.
Free RAM is quiet high:

[root@orange]~#vmstat
 procs      memory      page                    disks     faults         cpu
 r b w     avm    fre   flt  re  pi  po    fr  sr da0 da1   in   sy   cs us sy id
 0 0 0    576M    45G   545   0   3   0   546   0   0   0  880  779  415  0  1 99
>How-To-Repeat:
I can reproduce the problem each time I build a new BSDRP image using the TMPFS mode:

svn checkout https://svn.code.sf.net/p/bsdrp/code/trunk BSDRP
cd BSDRP
./make.sh  -r

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jan 17 00:13:20 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175353 

From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= <olivier@cochard.me>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/175353: [tmpfs] [panic] panic during building a nanobsd
 image + ports
Date: Thu, 17 Jan 2013 11:36:22 +0100

 Applying the mjg's patch of revision 245351 (kern_lock.c) solve this
 problem on my 2 machines.
 
 Regards,
 
 Olivier
Responsible-Changed-From-To: freebsd-fs->mjg 
Responsible-Changed-By: mjg 
Responsible-Changed-When: Thu Jan 17 23:05:48 UTC 2013 
Responsible-Changed-Why:  
Take 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175353 
State-Changed-From-To: open->closed 
State-Changed-By: mjg 
State-Changed-When: Thu Jan 17 23:06:39 UTC 2013 
State-Changed-Why:  
Duplicate of kern/174969 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175353 
>Unformatted:
