Anonymous | Login | 2024-04-23 17:26 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0000639 | [1003.1(2008)/Issue 7] System Interfaces | Editorial | Error | 2013-01-01 21:16 | 2013-01-10 17:11 | ||
Reporter | dalias | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Rejected | ||||
Status | Closed | ||||||
Name | Rich Felker | ||||||
Organization | musl libc | ||||||
User Reference | |||||||
Section | dlsym, dlclose | ||||||
Page Number | unknown | ||||||
Line Number | unknown | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0000639: dlsym, dlclose handling of invalid handles | ||||||
Description |
As written, the specification of dlsym and dlclose seems to require them to detect and report an error on attempts to use an invalid handle. Under RETURN VALUE: "If handle does not refer to a valid object opened by dlopen(), or if the named symbol cannot be found within any of the objects associated with handle, dlsym() shall return NULL. More detailed diagnostic information shall be available through dlerror ." and "If the object could not be closed, or if handle does not refer to an open object, dlclose() shall return a non-zero value. More detailed diagnostic information shall be available through dlerror()." This requirement seems to place an unnecessary burden on implementations that they iterate through a list of open libraries to verify that the argument is actually the handle for one, whereas efficient implementations would want to use the argument directly as a pointer. This is especially important for dlsym where performance may be relevant, and validating the library handle could easily turn a constant-time search (in the case where the symbol is known to be defined in the library itself) to a linear (or at best, logarithmic) time operation. |
||||||
Desired Action |
Strike the text about not referring to a valid object from the return value sections, yielding: "If the named symbol cannot be found within any of the objects associated with handle, dlsym() shall return NULL. More detailed diagnostic information shall be available through dlerror ." and "If the object could not be closed dlclose() shall return a non-zero value. More detailed diagnostic information shall be available through dlerror()." Further, add text to the descriptions reading: "If handle does not refer to a valid object opened by dlopen(), the behavior is undefined." |
||||||
Tags | No tags attached. | ||||||
Attached Files | |||||||
|
Relationships | |||||||
|
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |