Bug 84953 - dlclose on invalid handle should not segfault?
dlclose on invalid handle should not segfault?
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc (Show other bugs)
1.0
i386 Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-24 04:51 EST by Joe Orton
Modified: 2016-11-24 10:14 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-27 19:33:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joe Orton 2003-02-24 04:51:58 EST
Description of problem:
dlclose(NULL) segfaults - Single Unix v3 implies this should not:

"If the object could not be closed, or if handle does not refer to an open
object, dlclose() shall return a non-zero value"

Version-Release number of selected component (if applicable):
glibc-2.3.1-46

How reproducible:
Always

Steps to Reproduce:
1. cat > dl.c <<EOF
#include <dlfcn.h>
int main() { dlclose(0L); }
EOF
2. cc dl.c -dl
3. ./a.out
    
Actual results:
Segfault

Expected results:
nothing

Additional info:
Comment 1 Ulrich Drepper 2004-09-27 19:33:00 EDT
It should and it always will.  There is no way to reliably test for
invalid descriptors and in any case it would be a burden which correct
programs has to carry.  glibc is a runtime library, no debugging library.

And POSIX/SUS never requires that such tests are performed.  In some
cases wording like this might have slipped into the specification but
it would be changed immediately when reported.

Note You need to log in before you can comment on or make changes to this bug.