From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3344 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: patch: make the size of errbuf configurable Date: Sun, 19 May 2013 17:48:00 -0400 Message-ID: <20130519214800.GH20323@brightrain.aerifal.cx> References: <5199324A.7020805@eservices.virginia.edu> <20130519210509.GA1075@port70.net> <519945C5.30106@gentoo.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1369000094 3092 80.91.229.3 (19 May 2013 21:48:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 May 2013 21:48:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3348-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 19 23:48:13 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UeBSf-0007jC-85 for gllmg-musl@plane.gmane.org; Sun, 19 May 2013 23:48:13 +0200 Original-Received: (qmail 26526 invoked by uid 550); 19 May 2013 21:48:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26517 invoked from network); 19 May 2013 21:48:12 -0000 Content-Disposition: inline In-Reply-To: <519945C5.30106@gentoo.org> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3344 Archived-At: On Sun, May 19, 2013 at 11:36:05PM +0200, Luca Barbato wrote: > On 05/19/2013 11:05 PM, Szabolcs Nagy wrote: > > * Z. Gilboa [2013-05-19 16:12:58 -0400]: > >> When a shared library that resides in a deeply nested folder > >> contains unresolved (long-named, mangled) symbols, the displayed > >> name of the library and/or symbol might get truncated. The attached > >> patch makes the size of errbuf (ldso/dynlink.c) configurable > >> (--with-ld-errbuf-size), while yet leaving the default size of 128 > >> unaffected. > > > > i dont think this is the best place to start adding configurations > > > > i'd prefer simply increasing the buffer if this is an issue > > > > c++ mangled names can get pretty insane, i just checked my system > > check boost-spirit for the most amazing results (we are talking > kilobytes for a single symbol) In this case, I tend to think the current limit is just a bug. It should suffice to just keep track of the current buffer size and malloc a new buffer when a larger message is needed, leaving the old message forever in the previous buffer. To avoid too many such allocations, size can be doubled each time it's insufficient. If allocation fails, the error message can be replaced with "internal dynamic linker allocation failure" which will always fit in the old buffer. Note that in a correct program, the buffer should never be used anyway, so it shouldn't lead to bloat. Rich