RFR: JDK-8315706: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java real fix for failure on AIX [v5]
Thomas Stuefe
stuefe at openjdk.org
Mon Nov 27 15:11:26 UTC 2023
On Mon, 27 Nov 2023 13:23:42 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Joachim Kern has updated the pull request incrementally with one additional commit since the last revision:
>>
>> adopt types
>
> This now causes problems with
>
> https://github.com/openjdk/jdk/pull/16604#issuecomment-1827661214
>
> since it removes the possibility of silently alternating the file path inside os::dll_load, which would be the preferred way for AIX to handle *.a shared objects. So this causes even more ifdef AIX to bloom up everywhere.
>
> A much better solution would have been to mimic stable-handle behavior inside the AIX version of `os::dll_load`.
>
> Proposal for an alternate solution: Hold dlhandle-to-(inode, devid)tuple mappings in a hash table. On dlopen, look up dl-handle by (inode, filename) tupel. On dlclose, remove entry. Could have been done inside os_aix.cpp without any changes to shared coding, and would have provided complete coverage for all users of dll_load.
> @tstuefe: Hi Thomas, I'm not sure if I got it. We can make (inode, devid) to a hash, which replaces the dlhandle on return of os::dlload. This hash would of course be the same if the same library is loaded twice. But I do not know how to handle the two real dlhandles.
Why do you need two dlhandles?
A handle returned from dlopen should be valid for the whole process. If you cache that in a hashmap, and for the second caller of os::dll_load() return the cached variant, this should work, no?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15583#issuecomment-1828019003
More information about the serviceability-dev
mailing list