From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 1 23:21:37 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 927DFD36 for ; Wed, 1 Oct 2014 23:21:37 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73378CF8 for ; Wed, 1 Oct 2014 23:21:37 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s91NLb6i037175 for ; Wed, 1 Oct 2014 23:21:37 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s91NLbRu037172 for freebsd-hackers@freebsd.org; Wed, 1 Oct 2014 23:21:37 GMT (envelope-from bdrewery) Received: (qmail 42342 invoked from network); 1 Oct 2014 18:21:32 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 1 Oct 2014 18:21:32 -0500 Message-ID: <542C8C75.30007@FreeBSD.org> Date: Wed, 01 Oct 2014 18:21:25 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Dimitry Andric , Larry Baird Subject: Re: Kernel/Compiler bug References: <20141001031553.GA14360@gta.com> <20141001134044.GA57022@gta.com> In-Reply-To: OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1UPenIEbfu6kooDcV3CLQPGkblXxSIh6L" Cc: "freebsd-hackers@freebsd.org" , Ryan Stone 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 23:21:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1UPenIEbfu6kooDcV3CLQPGkblXxSIh6L Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/1/2014 2:37 PM, Dimitry Andric wrote: > On 01 Oct 2014, at 15:40, Larry Baird wrote: >> 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 believ= e >>> that it's called KSTACK_PAGES. Try increasing it to 4. >> Good catch. Increasing KSTACK_PAGES does fix the issue. I wonder wit= h >> optimization, how close to stack overflow does the kernel get during b= oot? >=20 > It obviously depends on which optimization flags you use, which drivers= > you include, and so on. There was a thread some time ago about somebod= y > banging into the limit when mounting certain ZFS filesystems, here: >=20 > https://lists.freebsd.org/pipermail/freebsd-current/2012-December/03820= 8.html >=20 > This is why Kostik added printing of the frame addresses to the panic > backtrace output, so you can easily see if you hit the stack limit. >=20 > That said, 8k is not much these days, especially not with fairly > complicated code like ZFS, combined with high optimization, which can > inline a lot of functions, causing even more stack usage. I would just= > bump KSTACK_PAGES. >=20 > -Dimitry >=20 Is this something that can be bumped in the tree for GENERIC? --=20 Regards, Bryan Drewery --1UPenIEbfu6kooDcV3CLQPGkblXxSIh6L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJULIx1AAoJEDXXcbtuRpfPHvkH/09cR3hY2SktVv5v4QjRlgMO 07+o6Dc/FGwHLpvwuq9XZXyAlr40j2We3la6sXPFnBcx1uQnLz9TNmEinohmLqlg zVMSUJd97OJRbEEwHsl/jmnSrVAJa+KIO748C0Lu9hgcPQc4eDY86N/nzTTpK4Vm 99+tEAGeIAnsUGaxg7sQNt6GsydcfAngp/UZ7NKPiQoMTJVW/F7cFT9iCIGWurnh udyhNMVmwQDOWuwD+QmWgmCuXGAPHiVME9F/DmTKBXPtFlEpx3XQdy1LCOybL2wM oaAjKO4EMzgl6Z1X6JTOrA2ZpgZb1EPheBzmc8z/2rgrJpJEeIS+FEdXrEfh/AE= =JsN4 -----END PGP SIGNATURE----- --1UPenIEbfu6kooDcV3CLQPGkblXxSIh6L--