Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 84953 - dlclose on invalid handle should not segfault?
Summary: dlclose on invalid handle should not segfault?
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc
Version: 1.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
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:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2004-09-27 23:33:00 UTC

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):

How reproducible:

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

Expected results:

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.