This is the mail archive of the glibc-bugs@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]

[Bug dynamic-link/14989] Implement double dlclose() detection as required by POSIX


https://sourceware.org/bugzilla/show_bug.cgi?id=14989

--- Comment #12 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Rich Felker from comment #11)
> It's essentially never useful for the reason the EBADF error from close is
> never useful: it can tell you whether the resource identifier was currently
> valid at the time of the close call, but not whether it referred to what you
> thought it did, or whether it acted on a resource owned by some other part
> of the program (or internal to the implementation) that you didn't intend to
> act on.

It is useful in specific cases. It requires that program logic allow you to
make the kind of assertions your claim.

I agree that in general you can't make abstract assertions about ownership of
the handle, but that has it's own problems (infinite memory requirements).

> The only reason to implement this behavior at all is for strict standards
> conformance.

I disagree as stated above. You can use program logic to allow you to make use
of the POSIX behaviour.

Knowing if it was _your_ handle, associated with _your_ dlopen, would be really
really nice to know. And I think we can do that with monotonically increasing
IDs at the expense of ABA on the detection in 32-bit. Though this would only be
a hardening feature of an ID-based implementation, and no worse than what POSIX
requires.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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