From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3341 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:03:41 -0400 Message-ID: <20130519210341.GG20323@brightrain.aerifal.cx> References: <5199324A.7020805@eservices.virginia.edu> 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 1368997434 9752 80.91.229.3 (19 May 2013 21:03:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 May 2013 21:03:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3345-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 19 23:03:54 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 1UeAll-0003NK-WE for gllmg-musl@plane.gmane.org; Sun, 19 May 2013 23:03:54 +0200 Original-Received: (qmail 32416 invoked by uid 550); 19 May 2013 21:03:53 -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 32408 invoked from network); 19 May 2013 21:03:53 -0000 Content-Disposition: inline In-Reply-To: <5199324A.7020805@eservices.virginia.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3341 Archived-At: On Sun, May 19, 2013 at 04:12:58PM -0400, Z. Gilboa wrote: > Greetings, > > 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. If at some point we do have build configurations, I'd want it to be more structured, and for the user-visible names not to reflect internal variable names, but something more meaningful to users. With that said, in this case I think a different solution is called for, mainly because having configurability for such small details is setting a precedent that, if followed, could lead to hundreds of trivial configurable knobs and the same testability nightmare that plagues uClibc. My preference is that either long pathnames should be truncated in a reasonable way (keep in mind that the message is *not* parsable by the caller; the only way it can be used is presenting it to the user) or larger buffers should be dynamically allocated. The only reason I did not go the dynamic-allocation path to begin with was to make it so non-thread-safe usage of dlerror yields (at worst) corrupted messages rather than crashes. This can also be achieved with dynamic allocation (as long as the old too-short buffer is never freed), but it's more complex. I'd welcome input on which approach users would prefer. Rich