RFR: JDK-8334217 : [AIX] Misleading error messages after JDK-8320005 [v6]

Joachim Kern jkern at openjdk.org
Wed Jul 3 15:12:34 UTC 2024


On Wed, 3 Jul 2024 15:09:19 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

>> dll_load_library() call fails is not analyzed (the ebuf content is ignored)
>> dll_load_library does not analyze the contents of ebuf which leads to misleading error message when library loading fails.
>> 
>> We now call  the second dll_load_library() only if the first returns with a 'No such file or directory' error message.
>> If the first dll_load_library() found the library is not able to load it by any reason, we do not try again with a .a extension.
>> [JDK-8334217](https://bugs.openjdk.org/browse/JDK-8334217)
>
> Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   semicolon

Changes requested by jkern (Committer).

src/hotspot/os/aix/os_aix.cpp line 116:

> 114: #endif
> 115: 
> 116: #define ERROR_NO_SUCH_FILE "No such file or directory"

Not needed anymore. Remove the #define line.

src/hotspot/os/aix/os_aix.cpp line 992:

> 990: }
> 991: 
> 992: static void* dll_load_library(const char *filename, int *errno, char *ebuf, int ebuflen) {

Do not use the global errno variable name here, instead use *eno

src/hotspot/os/aix/os_aix.cpp line 1020:

> 1018:   const char* error_report = nullptr;
> 1019:   JFR_ONLY(NativeLibraryLoadEvent load_event(filename, &result);)
> 1020:   result = Aix_dlopen(filename, errno, dflags, &error_report);

Do not use the global errno variable name here, instead use *eno

src/hotspot/os/aix/os_aix.cpp line 1058:

> 1056:   if (result == nullptr && eno == ENOENT && pointer_to_dot != nullptr && strcmp(pointer_to_dot, old_extension) == 0) {
> 1057:     snprintf(pointer_to_dot, sizeof(old_extension), "%s", new_extension);
> 1058:     result = dll_load_library(file_path, &errno, ebuf, ebuflen);

Do not use the global errno variable name here, instead use &eno

src/hotspot/os/aix/porting_aix.cpp line 1038:

> 1036: // This way we mimic dl handle equality for a library
> 1037: // opened a second time, as it is implemented on other platforms.
> 1038: void* Aix_dlopen(const char* filename, int *eno, int Flags, const char** error_report) {

I think you also have to adapt the `Aix_dlopen()` declaration in the header file `porting_aix.hpp`

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

PR Review: https://git.openjdk.org/jdk/pull/19887#pullrequestreview-2156701998
PR Review Comment: https://git.openjdk.org/jdk/pull/19887#discussion_r1664342741
PR Review Comment: https://git.openjdk.org/jdk/pull/19887#discussion_r1664343906
PR Review Comment: https://git.openjdk.org/jdk/pull/19887#discussion_r1664344622
PR Review Comment: https://git.openjdk.org/jdk/pull/19887#discussion_r1664346811
PR Review Comment: https://git.openjdk.org/jdk/pull/19887#discussion_r1664350925


More information about the hotspot-runtime-dev mailing list