This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should glibc be fully reentrant? What do we allow interposed symbols to do?


On Wed, 2014-10-22 at 22:29 -0400, Carlos O'Donell wrote:
> On 10/21/2014 06:47 PM, Roland McGrath wrote:
> > But the slippery slope concerns me most of all.
> 
> Any function the user interposes acts as a synchronous interrupt on the
> runtime.

Note that is simpler because we have no parallelism in glibc right now.
And we may never have a need for this because we don't do big chunks of
work, but it's worth considering, I think.  Once you go parallel,
"synchronous interrupt" constricts the implementation to a larger degree
than when this applies just to a single thread that doesn't change.

> It is my opinion that users expect to be able to call any routine in the
> runtime without caution unless we tell them otherwise.
> 
> Given that dlopen locks are recursive, as are stdio locks, I propose we
> fully support this notion that users already believe exists.

Well, what this tells us is that these two things do not disallow
reentrancy on all the resources they protect with locks.  But that
doesn't quite tell us that they can deal with reentrancy in all
situations, right?

> The alternative is that we don't support it and treat interposed functions
> as if they were in a signal handler context, only being allowed to call
> async-signal-safe functions, and we might as well remove the recursive
> support from the locks such that users get useful backtraces from deadlocks.
> It is my opinion that such a direction would not help our users and would
> not help the project.
> 
> The similar situations we need to clarify are LD_AUDIT modules, and
> IFUNC resolvers, but let us proceed orderly one topic at a time.
> 
> In summary
> ==========
> 
> Allow interposed functions to call back into the runtime, and fix any
> places where this breaks.

As worded, I do not agree.  IMHO, this should be opt-in.  It may very
well be that we'd want an opt-in for large sets of functionality, but
I'd be concerned about promising support for this *in general*.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]