Anonymous | Login | 2025-01-16 17:44 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 | ||
0000982 | [1003.1(2013)/Issue7+TC1] System Interfaces | Editorial | Clarification Requested | 2015-08-31 19:41 | 2024-06-11 09:02 | ||
Reporter | dalias | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Closed | ||||||
Name | Rich Felker | ||||||
Organization | musl libc | ||||||
User Reference | |||||||
Section | dlopen | ||||||
Page Number | 738 | ||||||
Line Number | 24875 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | Note: 0003277 | ||||||
Summary | 0000982: Ambiguity in dlopen's definition of "load order" for symbol resolution | ||||||
Description |
Load order is defined as: "Load order establishes an ordering among symbol definitions, such that the first definition loaded (including definitions from the process image file and any dependent executable object files loaded with it) has priority over executable object files added later (by dlopen())." However, an ambiguity arises when an object is loaded as RTLD_LOCAL then later converted to RTLD_GLOBAL by a subsequent dlopen. Consider the case where libraries A and B both define a symbol "foo", and the following sequence of dlopen calls: 1. dlopen("A", RTLD_LOCAL) 2. dlopen("B", RTLD_GLOBAL) 3. dlopen("A", RTLD_GLOBAL) After step 1, "foo" is undefined, because RTLD_LOCAL precludes making A's definition available. After step 2, "foo" has a definition provided by B, as there is only one definition available. After step 3, it's not clear what happens. A contains the first-loaded definition of "foo", and a strict literal reading would suggest that the definition in A should therefore have priority. However, as far as I know this neither matches historical implementations (tested against glibc) nor user expectations. The alternate interpretation is that "loaded" should be read as meaning "loaded and made available". In that case, after step 3, the definition of "foo" would still be provided by B. |
||||||
Desired Action |
Clarify the definition of load order to remove the ambiguity when an object originally loaded RTLD_LOCAL is loaded again with RTLD_GLOBAL, or explicitly state that it is unspecified or implementation-defined if there are historical implementations with conflicting behavior. |
||||||
Tags | tc3-2008 | ||||||
Attached Files | |||||||
|
Issue History | |||
Date Modified | Username | Field | Change |
2015-08-31 19:41 | dalias | New Issue | |
2015-08-31 19:41 | dalias | Name | => Rich Felker |
2015-08-31 19:41 | dalias | Organization | => musl libc |
2015-08-31 19:41 | dalias | Section | => dlopen |
2015-08-31 19:41 | dalias | Page Number | => unknown |
2015-08-31 19:41 | dalias | Line Number | => unknown |
2015-09-26 06:22 | shware_systems | Note Added: 0002846 | |
2015-09-26 06:25 | shware_systems | Note Edited: 0002846 | |
2015-09-26 22:09 | shware_systems | Note Added: 0002847 | |
2015-09-28 00:26 | dalias | Note Added: 0002848 | |
2015-09-28 04:31 | shware_systems | Note Added: 0002849 | |
2015-09-28 15:51 | dalias | Note Added: 0002850 | |
2016-06-30 16:02 | geoffclare | Note Added: 0003277 | |
2016-06-30 16:04 | geoffclare | Interp Status | => --- |
2016-06-30 16:04 | geoffclare | Final Accepted Text | => Note: 0003277 |
2016-06-30 16:04 | geoffclare | Status | New => Resolved |
2016-06-30 16:04 | geoffclare | Resolution | Open => Accepted As Marked |
2016-06-30 16:04 | geoffclare | Tag Attached: tc3-2008 | |
2016-06-30 16:07 | geoffclare | Page Number | unknown => 738 |
2016-06-30 16:07 | geoffclare | Line Number | unknown => 24875 |
2019-10-18 15:42 | geoffclare | Status | Resolved => Applied |
2024-06-11 09:02 | agadmin | Status | Applied => Closed |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |