From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 1 13:40:46 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25C18848 for ; Wed, 1 Oct 2014 13:40:46 +0000 (UTC) Received: from mailgate.gta.com (mailgate.gta.com [199.120.225.23]) by mx1.freebsd.org (Postfix) with ESMTP id CE9C9816 for ; Wed, 1 Oct 2014 13:40:45 +0000 (UTC) Received: (qmail 57398 invoked by uid 1000); 1 Oct 2014 13:40:44 -0000 Date: Wed, 1 Oct 2014 09:40:44 -0400 From: Larry Baird To: Ryan Stone Subject: Re: Kernel/Compiler bug Message-ID: <20141001134044.GA57022@gta.com> References: <20141001031553.GA14360@gta.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 13:40:46 -0000 Ryan, On Wed, Oct 01, 2014 at 12:46:35AM -0400, Ryan Stone wrote: > This may not be a compiler bug. A quick look at the esp values > provided in that backtrace shows that at least 7KB has been used on > the stack. The stack for kernel threads is only 8KB, and a stack > overflow can cause a double fault like that. > > My suspicion would be that without optimizations on clang uses a lot > more stack space and you push over the limit. There's a kernel build > option for the stack size that you could change to confirm. I believe > that it's called KSTACK_PAGES. Try increasing it to 4. Good catch. Increasing KSTACK_PAGES does fix the issue. I wonder with optimization, how close to stack overflow does the kernel get during boot? Thank you, Larry -- ------------------------------------------------------------------------ Larry Baird Global Technology Associates, Inc. 1992-2012 | http://www.gta.com Celebrating Twenty Years of Software Innovation | Orlando, FL Email: lab@gta.com | TEL 407-380-0220