From owner-freebsd-current@FreeBSD.ORG Thu Dec 26 20:01:54 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45515600; Thu, 26 Dec 2013 20:01:54 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF7F61E56; Thu, 26 Dec 2013 20:01:53 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBQK1iUL074098; Thu, 26 Dec 2013 22:01:44 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBQK1iUL074098 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBQK1iaG074097; Thu, 26 Dec 2013 22:01:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 26 Dec 2013 22:01:44 +0200 From: Konstantin Belousov To: Antoine Brodin Subject: Re: latest openjdk7 triggers kernel panic Message-ID: <20131226200144.GP59496@kib.kiev.ua> References: <52BC1B41.2060900@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p2BUbKl1Fxnzi6Vs" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: Marcel Moolenaar , Peter Wemm , Alan Cox , Andriy Gapon , FreeBSD Current , freebsd-java@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Dec 2013 20:01:54 -0000 --p2BUbKl1Fxnzi6Vs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 26, 2013 at 07:51:45PM +0100, Antoine Brodin wrote: > On Thu, Dec 26, 2013 at 7:33 PM, Peter Wemm wrote: > > On Thu, Dec 26, 2013 at 7:39 AM, Antoine Brodin w= rote: > >> On Thu, Dec 26, 2013 at 1:04 PM, Andriy Gapon wrote: > > ... > >> Hello, > >> > >> FWIW, I had a similar panic today on 9.2-RELEASE with a GENERIC kerne= l: > >> panic: Bad entry start/end for new stack entry > >> cpuid =3D 1 > >> KDB: stack backtrace: > >> #0 0xffffffff80947986 at kdb_backtrace+0x66 > >> #1 0xffffffff8090d9ae at panic+0x1ce > >> #2 0xffffffff80b81314 at vm_map_stack+0x274 > >> #3 0xffffffff80b83584 at vm_mmap+0x674 > >> #4 0xffffffff80b83d2f at sys_mmap+0x1cf > >> #5 0xffffffff80cf187a at amd64_syscall+0x5ea > >> #6 0xffffffff80cdbff7 at Xfast_syscall+0xf7 > >> > >> It looks like the box was compiling java related ports (java/jaxen and > >> devel/antlr) when it panic'ed. > > > > This is troubling. I'm wondering what's changed and why we haven't > > seen this before. Well, if MAP_STACK was started used only with update, or the condition for coalescing only holds due to changes in the update, this is not much strange. > > > > Just so I'm clear, you're building 9.2 ports on a 9.2-REL kernel, > > right? and not something like building 9.2-REL ports inside a jail on > > a 10.x or 11.x host? 10.x / 11.x are not involved and you're seeing > > this? >=20 >=20 > This is 9.2-REL host and kernel. > The only thing "new" is the ports tree, ports tree from 20 december > didn't make the box panic while ports tree from 26 december does. > (and there was an openjdk update between) I can only repost the following patch. It should be applicable to 9 as well. diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index e3842a3..e15e0ca 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1207,6 +1207,7 @@ charged: } else if ((prev_entry !=3D &map->header) && (prev_entry->eflags =3D=3D protoeflags) && + (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) =3D=3D 0 && (prev_entry->end =3D=3D start) && (prev_entry->wired_count =3D=3D 0) && (prev_entry->cred =3D=3D cred || @@ -3339,7 +3340,6 @@ vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_si= ze_t max_ssize, * NOTE: We explicitly allow bi-directional stacks. */ orient =3D cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP); - cow &=3D ~orient; KASSERT(orient !=3D 0, ("No stack grow direction")); =20 if (addrbos < vm_map_min(map) || --p2BUbKl1Fxnzi6Vs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSvIsnAAoJEJDCuSvBvK1BwfkP/i2CGur+KfR139SWuamvrEoa fhTunJH6e9yzoLi81jeq8QTfCHGb9Hnd8XHYO8acu843bJBrv5Czc3at3phXFc/G WrmsDCOzw3sMxAlmi+iiBg9H4QEMAFeClVlH5pPTdRRcOytKBw7n/Q7+tLuuBmDu +L+hHZ8VlOhYuIZE/zZQGDjNlb5ZRbKCNZTed1Pl7Td0zy2l1VNIsu2DzL3rBpFU HkRM4XzYPtCotPK3x3YsvQFWZTSyYx2/IfwBISa/7svIJwQQj/zsdurQPqPvYxpy cmA4NORMWCFhaEtMXSNnhjRz3vYhLKW7KjqyGfhPVX9gwYeXe5XR1TZ7BEY01qHx yp9sLRllrv8rjxwitZjeBks6DirxqfQbqnMNEJky4hWdbBrf2FkurgEvbebf6l+e /X3nWFqTZpDyqmfVXkE5r0Wfna57WGO9Lh+bUjdxl4NWZ7BGuq1YeYatOOvqFu26 ox0+xFS2UUYcQCEz9lds/SPQZKI84fG0f7mZRE5UPW5HsMrLfyKcnoEwq4Rj9rDf ps9RI9156IiJpM7zCtqmVc1tBZuH0AH8+nOIST8ebTs44PdLjSPYPKh+ZMHjx9s6 15Cfa6fUpwa8uZeVBRmCcTPN/EZuUzdI6gDAp9CmSzUY9RGtabMvi1L9ewnoY43M X8+6j0KKdq108HP1PpL3 =YkbL -----END PGP SIGNATURE----- --p2BUbKl1Fxnzi6Vs--