This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Removing longjmp error handling from the dynamic loader
On Mon, Mar 11, 2019 at 1:08 PM Florian Weimer <fweimer@redhat.com> wrote:
> * Zack Weinberg:
> > I haven't thought about this much, but I don't like the idea of
> > increasing the set of functions potentially executed during symbol
> > resolution to the tune of the entire unwinder, because of the unusual
> > constraints on code executed in that context (e.g. must not take
> > locks, must protect itself from cancellation, must not touch the
> > normal errno).
>
> This is a good point which I had not considered.
>
> My position is that errors during symbol resolution in lazy binding are
> never recoverable. If the error is not recoverable, there is no need to
> do any unwinding at all. We currently get this wrong for init/fini
> (bug 24304).
I tend to agree with this. I'm also honestly dubious of the value of
lazy binding anymore, but that we should think about separately.
> Rich Felker brought up this matter in conjunction with IFUNC resolvers.
> These can be called during relocation processing (from dlopen) or lazy
> binding, when they themselves trigger lazy binding. I think these
> errors should not be recoverable, either, whether they happen during
> relocation processing or lazy binding. But there is a narrow edge case
> (IFUNC resolver called during relocation processing which triggers lazy
> binding which fails in symbol lookup)
I wonder how practical it would be to discover the set of symbols that
an IFUNC resolver might attempt to use, and resolve those before
calling into the IFUNC resolver. IFUNCs are still new enough that we
could require additional annotations in the object file if that would
help.
zw