RFR: 8329850: [AIX] Allow loading of different members of same shared library archive [v3]

Thomas Stuefe stuefe at openjdk.org
Thu Apr 25 14:26:35 UTC 2024


On Thu, 25 Apr 2024 13:32:11 GMT, Joachim Kern <jkern at openjdk.org> wrote:

>> src/hotspot/os/aix/porting_aix.cpp line 1069:
>> 
>>> 1067:           (p_handletable + i)->inode == libstat.st_ino &&
>>> 1068:           (p_handletable + i)->devid == libstat.st_dev &&
>>> 1069:           (((p_handletable + i)->member == member) ||
>> 
>> If this ever fires (wildly unlikely), its a bug. You are comparing a stack address with something that lives in C heap right now.
>
> I discussed this with Martin. The meaning of the line is: Check if both are nullptr.
> My original implementation was:
> (((p_handletable + i)->member == nullptr && member == nullptr) ||
> Martin favoured the shorter version above which will have the same result.

It is, to me, not obvious where the member is reset. We delete it, but don't set the pointer to NULL.So, its not obvious that entry->member could not point to a former stale c heap address.

In any case, I prefer the cleanly written out logic. The generated code will be the same anyway, so this brevity just obfuscates your intent and confuses casual readers.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18676#discussion_r1579570079


More information about the hotspot-runtime-dev mailing list