Skip to content

Implement JVM_dladdr() for jdk27+ on AIX#23626

Merged
pshipton merged 1 commit intoeclipse-openj9:masterfrom
keithc-ca:JVM_dladdr
Apr 6, 2026
Merged

Implement JVM_dladdr() for jdk27+ on AIX#23626
pshipton merged 1 commit intoeclipse-openj9:masterfrom
keithc-ca:JVM_dladdr

Conversation

@keithc-ca
Copy link
Copy Markdown
Contributor

This fixes the link error seen in recent acceptance builds; e.g. https://openj9-jenkins.osuosl.org/job/Pipeline-OpenJDK-Acceptance/1210.

@keithc-ca keithc-ca requested a review from pshipton April 1, 2026 17:46
@keithc-ca keithc-ca marked this pull request as draft April 1, 2026 17:52
@keithc-ca
Copy link
Copy Markdown
Contributor Author

Updated to remove the unwanted field dli_fbase.

@keithc-ca
Copy link
Copy Markdown
Contributor Author

Jenkins compile aix jdknext depends ibmruntimes/openj9-openjdk-jdk#openj9-staging

Comment thread runtime/j9vm/javanextvmi.cpp Outdated
@keithc-ca
Copy link
Copy Markdown
Contributor Author

Updates:

  • check for ENOMEM == errno
  • include sys/ldr.h
  • test AIXPPC instead of OMR_OS_AIX
  • add missing casts

@keithc-ca
Copy link
Copy Markdown
Contributor Author

Jenkins compile aix jdknext depends ibmruntimes/openj9-openjdk-jdk#openj9-staging

@pshipton
Copy link
Copy Markdown
Member

pshipton commented Apr 2, 2026

Seems it built but then crashed.

18:38:09  Module=/home/jenkins/workspace/Build_JDKnext_ppc64_aix_Personal/build/aix-ppc64-server-release/jdk/lib/libawt.so
18:38:09  Module_base_address=090000000724D000
18:38:09  Target=2_90_20260401_79 (AIX 7.2)
18:38:09  CPU=ppc64 (16 logical CPUs) (0x780000000 RAM)
18:38:09  ----------- Stack Backtrace -----------
18:38:09  JNI_OnLoad+0xc (0x09000000072E7F30 [libawt.so+0x9af30])
18:38:09  Java_jdk_internal_loader_NativeLibraries_load+0x120 (0x09000000064E0A04 [libjava.so+0x8a04])

@keithc-ca
Copy link
Copy Markdown
Contributor Author

The crash seen earlier is addressed by:

  • not returning a pointer to freed memory
  • handling the situation where the provided address refers to a function descriptor instead of a function directly

Comment thread runtime/j9vm/javanextvmi.cpp
@pshipton
Copy link
Copy Markdown
Member

pshipton commented Apr 2, 2026

Pls add tracepoints to JVM_dladdr().

@keithc-ca keithc-ca force-pushed the JVM_dladdr branch 2 times, most recently from 5ca22f9 to 4e85e02 Compare April 6, 2026 15:30
@keithc-ca
Copy link
Copy Markdown
Contributor Author

Tracepoints added in 4e85e02 (and rebased).

@pshipton
Copy link
Copy Markdown
Member

pshipton commented Apr 6, 2026

Jenkins compile aix jdknext depends ibmruntimes/openj9-openjdk-jdk#openj9-staging

@keithc-ca
Copy link
Copy Markdown
Contributor Author

That build should be expected to fail (jni_md.h not found) without ibmruntimes/openj9-openjdk-jdk#1203.

@pshipton
Copy link
Copy Markdown
Member

pshipton commented Apr 6, 2026

I didn't think that happenes in these type of builds. The last build "worked", it just crashed afterwards.

@keithc-ca
Copy link
Copy Markdown
Contributor Author

I think the previous crash prevented it from getting to the point where the missing header would be noticed, but I suppose we'll see.

@pshipton
Copy link
Copy Markdown
Member

pshipton commented Apr 6, 2026

These builds don't include OpenJCEPlus, which I think is what exposed the "jni_md.h not found". Otherwise we would have noticed this earlier in the acceptance builds.

@pshipton
Copy link
Copy Markdown
Member

pshipton commented Apr 6, 2026

12:43:46  /home/jenkins/workspace/Build_JDKnext_ppc64_aix_Personal/openj9/runtime/j9vm/javanextvmi.cpp:891:40: error: too few arguments provided to function-like macro invocation
12:43:46    891 |         Trc_JVM_dladdr_exit(addr, info, result);
12:43:46        |                                               ^
12:43:46  /home/jenkins/workspace/Build_JDKnext_ppc64_aix_Personal/build/aix-ppc64-server-release/vm/runtime/j9vm/ut_j9scar.h:2169:9: note: macro 'Trc_JVM_dladdr_exit' defined here
12:43:46   2169 | #define Trc_JVM_dladdr_exit(thr, P1, P2, P3) \
12:43:46        |         ^
12:43:46  [ 29%] Building CXX object runtime/gc_vlhgc/CMakeFiles/j9gcvlhgc_full.dir/ConfigurationIncrementalGenerational.cpp.o
12:43:46  /home/jenkins/workspace/Build_JDKnext_ppc64_aix_Personal/openj9/runtime/j9vm/javanextvmi.cpp:891:2: error: use of undeclared identifier 'Trc_JVM_dladdr_exit'
12:43:46    891 |         Trc_JVM_dladdr_exit(addr, info, result);
12:43:46        |         ^

Comment thread runtime/j9vm/j9scar.tdf Outdated
Comment thread runtime/j9vm/j9scar.tdf Outdated
Comment thread runtime/j9vm/javanextvmi.cpp Outdated
Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
@pshipton
Copy link
Copy Markdown
Member

pshipton commented Apr 6, 2026

Jenkins compile aix jdknext depends ibmruntimes/openj9-openjdk-jdk#openj9-staging

@pshipton pshipton merged commit 86dfe3a into eclipse-openj9:master Apr 6, 2026
5 checks passed
@keithc-ca keithc-ca deleted the JVM_dladdr branch April 6, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants