JDK-8294514 : Wrong initialization of nmethod::_consts_offset for native nmethods
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-28
  • Updated: 2022-10-10
  • Resolved: 2022-10-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b18Fixed
Related Reports
Relates :  
Description
Symptom 1: Negative sizes of constants sections for native nmethods

Reproduce:

* Build with attached patch
* Run `java -Xcomp -Xlog:jit+compilation=debug -version`

The output will contain "NEGATIVE constants section size" for every native nmethod.

Symptom 2: Empty constants section in PrintAssembly output for (Loom) continuation
enter intrinsic even though, at least on PPC, it is not empty.

Analysis: JDK-6961697 [1] moved the constants section before the instruction section. This was
reflected in the initialization of nmethod::_consts_offset done by the nmethod
constructor for c1/c2 compiled nmethods. It was forgotten though to update the
constructor for native nmethods.

[1] Commit for JDK-6961697
    https://github.com/openjdk/jdk/commit/6a0c40f1fee892687ab615dd2566109e8204ec96

Comments
Changeset: b4e74aea Author: Richard Reingruber <rrich@openjdk.org> Date: 2022-10-05 09:33:45 +0000 URL: https://git.openjdk.org/jdk/commit/b4e74aeabfd41ee76b6bf8b779c1741b30b6f438
05-10-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10482 Date: 2022-09-29 08:16:27 +0000
29-09-2022

ILW = incorrect log output; always; no workaround = LHH = P4
28-09-2022