RFR: 8317689: [JVMCI] include error message when CreateJavaVM in libgraal fails

Doug Simon dnsimon at openjdk.org
Sat Oct 7 09:14:10 UTC 2023


Creating a new libgraal isolate can fail for a number of reasons. Currently, all that one sees on such a failure is a numeric error code. For example:


   2096 20291       4       java.lang.CharacterData::of (136 bytes)
   2096 20291       4       java.lang.CharacterData::of (136 bytes)   COMPILE SKIPPED: Error attaching to libjvmci (err: -1000000024)


Native Image is being enhanced to return an error message along with an error code by a non-standard `_strerror` argument passed to the `CreateJavaVM` JNI invocation interface function:


 |---------------|-----------------------------------------------------------------------------------|
 | _strerror     | extraInfo is a "const char**" value.                                              |
 |               | If CreateJavaVM returns non-zero, then extraInfo is assigned a newly malloc'ed    |
 |               | 0-terminated C string describing the error if a description is available.         |
 |---------------|-----------------------------------------------------------------------------------|


This PR updates JVMCI to take advantage of this Native Image enhancement.

This is sample `-XX:+PrintCompilation` output from testing this PR on libgraal:

   2096 20291       4       java.lang.CharacterData::of (136 bytes)
   2096 20291       4       java.lang.CharacterData::of (136 bytes)   COMPILE SKIPPED: Error attaching to libjvmci (err: -1000000024, Image page size is incompatible with run-time page size. Rebuild image with -H:PageSize=[pagesize] to set appropriately.)

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

Commit messages:
 - get error message from CreateJavaVM in libjvmci

Changes: https://git.openjdk.org/jdk/pull/16086/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16086&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8317689
  Stats: 33 lines in 6 files changed: 20 ins; 0 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/16086.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16086/head:pull/16086

PR: https://git.openjdk.org/jdk/pull/16086


More information about the hotspot-dev mailing list