Bug 84953 - dlclose on invalid handle should not segfault?
Summary: dlclose on invalid handle should not segfault?
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc
Version: 1.0
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-02-24 09:51 UTC by Joe Orton
Modified: 2016-11-24 15:14 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-09-27 23:33:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Joe Orton 2003-02-24 09:51:58 UTC
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 23:33:00 UTC
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.