From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3345 Path: news.gmane.org!not-for-mail From: "Z. Gilboa" Newsgroups: gmane.linux.lib.musl.general Subject: Re: patch: make the size of errbuf configurable Date: Sun, 19 May 2013 17:51:05 -0400 Message-ID: <51994949.1060305@eservices.virginia.edu> References: <5199324A.7020805@eservices.virginia.edu> <20130519210341.GG20323@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1369000282 5293 80.91.229.3 (19 May 2013 21:51:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 May 2013 21:51:22 +0000 (UTC) To: Original-X-From: musl-return-3349-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 19 23:51:22 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 1UeBVf-0001UI-6g for gllmg-musl@plane.gmane.org; Sun, 19 May 2013 23:51:19 +0200 Original-Received: (qmail 30139 invoked by uid 550); 19 May 2013 21:51:18 -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 30131 invoked from network); 19 May 2013 21:51:18 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 In-Reply-To: <20130519210341.GG20323@brightrain.aerifal.cx> X-Originating-IP: [128.143.141.130] Xref: news.gmane.org gmane.linux.lib.musl.general:3345 Archived-At: On 05/19/2013 05:03 PM, Rich Felker wrote: > 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) certainly; the initial motivation was log-file processing. > 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. In my understanding, the current approach of having a fixed buffer size is by far the superior one. And I also see your point about keeping the number of configurable options to a minimum. With this in mind, here are some alternatives: 1) remove the change from _configure_, but keep the change in _dynlink.c_ intact, which would allow developers to control the buffer size via CFLAGS. Add a note to the documentation (and configure's --help) about the option to do so. 2) discard the patch altogether, but add a list of "strategic code locations" to the documentation... Any thoughts? > > I'd welcome input on which approach users would prefer. > > Rich