mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Z. Gilboa" <zg7s@eservices.virginia.edu>
To: <musl@lists.openwall.com>
Subject: Re: patch: make the size of errbuf configurable
Date: Sun, 19 May 2013 17:51:05 -0400	[thread overview]
Message-ID: <51994949.1060305@eservices.virginia.edu> (raw)
In-Reply-To: <20130519210341.GG20323@brightrain.aerifal.cx>

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



  reply	other threads:[~2013-05-19 21:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-19 20:12 Z. Gilboa
2013-05-19 21:03 ` Rich Felker
2013-05-19 21:51   ` Z. Gilboa [this message]
2013-05-19 22:09     ` Rich Felker
2013-05-19 22:26       ` Z. Gilboa
2013-05-19 23:22         ` Rich Felker
2013-05-20  0:09           ` Z. Gilboa
2013-05-20  0:21             ` Rich Felker
2013-05-20  0:37               ` Z. Gilboa
2013-05-19 21:05 ` Szabolcs Nagy
2013-05-19 21:36   ` Luca Barbato
2013-05-19 21:48     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51994949.1060305@eservices.virginia.edu \
    --to=zg7s@eservices.virginia.edu \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).