This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/14989] Implement double dlclose() detection as required by POSIX
- From: "carlos at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 28 Apr 2017 19:22:32 +0000
- Subject: [Bug dynamic-link/14989] Implement double dlclose() detection as required by POSIX
- Auto-submitted: auto-generated
- References: <bug-14989-131@http.sourceware.org/bugzilla/>
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.