From owner-cvs-all Mon Jun 10 14:43:42 2002 Delivered-To: cvs-all@freebsd.org Received: from gyros.marcuscom.com (dhcp-64-102-60-60.cisco.com [64.102.60.60]) by hub.freebsd.org (Postfix) with ESMTP id A003237B407; Mon, 10 Jun 2002 14:43:36 -0700 (PDT) Received: from gyros.marcuscom.com (localhost [127.0.0.1]) by gyros.marcuscom.com (8.12.3/8.12.3) with ESMTP id g5ALhSHW047204; Mon, 10 Jun 2002 17:43:28 -0400 (EDT) (envelope-from marcus@marcuscom.com) Received: (from marcus@localhost) by gyros.marcuscom.com (8.12.3/8.12.3/Submit) id g5ALhRLJ047203; Mon, 10 Jun 2002 17:43:27 -0400 (EDT) X-Authentication-Warning: gyros.marcuscom.com: marcus set sender to marcus@marcuscom.com using -f Subject: Re: cvs commit: src/libexec/rtld-elf/i386 reloc.c From: Joe Marcus Clarke To: Matt Dillon Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org In-Reply-To: <200206101852.g5AIqWd98998@freefall.freebsd.org> References: <200206101852.g5AIqWd98998@freefall.freebsd.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 10 Jun 2002 17:43:27 -0400 Message-Id: <1023745407.46871.2.camel@gyros.marcuscom.com> Mime-Version: 1.0 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 2002-06-10 at 14:52, Matt Dillon wrote: > dillon 2002/06/10 11:52:32 PDT > > Modified files: > libexec/rtld-elf/i386 reloc.c > Log: > In tracking down an installation seg fault with then openoffice port > Martin Blapp determined that the elf dynamic loader was at fault. In > particular, the loader uses alloca() to allocate a symbol cache on the > stack. Normally this would work just fine, but if the loader is called > from a threaded program and the object being loaded is fairly large the > alloca() can blow away the thread stack and effect other nearby thread > stacks as well. My testing showed that the symbol cache can be as large > as 250KBytes during the openoffice port build and install sequence. Martin > was able to work around the problem by disabling the symbol cache > (cache = NULL;). However, this solution is not adequate for commit because > it can cause an enormous cpu burden for applications which do a lot of > dynamic loading (e.g. like konqueror). > > The solution is to use anonymous mmap() to temporarily allocate space to > hold the symbol cache. In testing I found that replacing the alloca() > with mmap() has no observable degredation in performance. > > It should be noted that this bug does not necessarily cause an immediate > crash but can instead result in long term corruption and instability in > applications that load modules from threads. The bug is almost certainly > responsible for some of the instabilities found in konqueror, for example, > and possibly netscape too. This may also fix the seg fault encountered while building Mozilla. I'll investigate. Joe > > Sleuthing work by: Martin Blapp > X-MFC after: Before or after the 4.6 release depending on the release engineers > > Revision Changes Path > 1.9 +20 -8 src/libexec/rtld-elf/i386/reloc.c > -- PGP Key : http://www.marcuscom.com/pgp.asc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message