From owner-freebsd-current Thu Mar 14 7: 2:22 2002 Delivered-To: freebsd-current@freebsd.org Received: from h132-197-179-27.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by hub.freebsd.org (Postfix) with ESMTP id 38BAF37B63A for ; Thu, 14 Mar 2002 07:01:20 -0800 (PST) Received: from kanpc.gte.com (localhost [IPv6:::1]) by h132-197-179-27.gte.com (8.12.2/8.12.2) with ESMTP id g2EF0h4U010232; Thu, 14 Mar 2002 10:00:43 -0500 (EST) (envelope-from ak03@kanpc.gte.com) Received: (from ak03@localhost) by kanpc.gte.com (8.12.2/8.12.2/Submit) id g2EF0dJ0010231; Thu, 14 Mar 2002 10:00:39 -0500 (EST) Date: Thu, 14 Mar 2002 10:00:38 -0500 From: Alexander Kabaev To: Terry Lambert Cc: imp@village.org, edhall@weirdnoise.com, mb@imp.ch, kris@obsecurity.org, jstocker@tzi.de, current@FreeBSD.ORG, hackers@FreeBSD.ORG, obrien@FreeBSD.ORG, edhall@screech.weirdnoise.com Subject: Re: gcc -O broken in CURRENT Message-Id: <20020314100038.4d45700f.ak03@gte.com> In-Reply-To: <3C9048FC.1C9C57B5@mindspring.com> References: <200203132015.g2DKFYv17886@screech.weirdnoise.com> <20020313.234345.88856963.imp@village.org> <3C9048FC.1C9C57B5@mindspring.com> Organization: Verizon Data Services X-Mailer: Sylpheed version 0.7.4claws1 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a case of exception context register getting clobbered in shared library function call. GCC does not reload it when needed and this ultimately leads to semi-random word in program memory decremented by the __cp_pop_exception function. The bug is only triggered under very specific circumstances involving inline functions and nested degenerate exception handlers, that's why it existed unnoticed for quite some time. On Wed, 13 Mar 2002 22:53:48 -0800 Terry Lambert wrote: > "M. Warner Losh" wrote: > > In message: <200203132015.g2DKFYv17886@screech.weirdnoise.com> > > Ed Hall writes: > > : Exception-handling is broken with -O in -stable, and has been for > > years.: FreeBSD is one of the few systems that use setjmp/longjmp > > stack unwinds: to implement exceptions, so when the GCC folks broke > > that path, it was: never fixed. There are supposedly patches > > floating around that fix the: problem, but they either didn't work > > as advertised or the ball got dropped. > > > > Hmmmm, C++ exceptions work in -stable with -O and have for at least > > a year. At least they are working for us in our environment. > > What's busted? > > Per thread exception stacks? THat's where I'd look... > > -- Terry > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message