[crac] RFR: Fix ArchivedEnumTest.java testsuite regression [v2]

Jan Kratochvil jkratochvil at openjdk.org
Mon Sep 4 12:02:48 UTC 2023


> java.lang.RuntimeException: 'object points to a static field that may be reinitialized at runtime' found in stdout
>         at jdk.test.lib.process.OutputAnalyzer.shouldNotContain(OutputAnalyzer.java:267)
>         at ArchivedEnumTest.main(ArchivedEnumTest.java:49)
>         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>         at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
>         at java.base/java.lang.Thread.run(Thread.java:1570)
> 
> [1.337s][warning][cds,heap] Archive heap points to a static field that may be reinitialized at runtime:
> [1.337s][warning][cds,heap] Field: jdk/crac/impl/GlobalContext::GLOBAL_CONTEXT_IMPL_NAME
> [1.337s][warning][cds,heap] Value: java.lang.String
> [1.337s][warning][cds,heap] {0x00000000d7561560} - klass: 'java/lang/String'
> [1.337s][warning][cds,heap]  - string: ""
> [1.337s][warning][cds,heap]  - ---- fields (total size 3 words):
> [1.337s][warning][cds,heap]  - private 'hash' 'I' @12  0 (0x00000000)
> [1.337s][warning][cds,heap]  - private final 'coder' 'B' @16  0 (0x00)
> [1.338s][warning][cds,heap]  - private 'hashIsZero' 'Z' @17  true (0x01)
> [1.338s][warning][cds,heap]  - injected 'flags' 'B' @18  1 (0x01)
> [1.338s][warning][cds,heap]  - private final 'value' '[B' @20  [B{0x00000000d7561578} (0xd7561578)
> [1.338s][warning][cds,heap] --- trace begin ---
> [1.338s][warning][cds,heap] [ 0] (shared string table)
> [1.338s][warning][cds,heap] [ 1] {0x00000000d7561560} java.lang.String
> [1.338s][warning][cds,heap] --- trace end ---
> 
> 
> I haven't found a way how to fix [src/java.base/share/classes/jdk/crac/impl/GlobalContext.java](https://github.com/openjdk/crac/blob/crac/src/java.base/share/classes/jdk/crac/impl/GlobalContext.java) not regressing its current static field performance without adding this exception.

Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:

  Use only local variables.
   - suggested by Radim Vansa

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

Changes:
  - all: https://git.openjdk.org/crac/pull/109/files
  - new: https://git.openjdk.org/crac/pull/109/files/b76bedcd..41bd6f7d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=crac&pr=109&range=01
 - incr: https://webrevs.openjdk.org/?repo=crac&pr=109&range=00-01

  Stats: 8 lines in 2 files changed: 2 ins; 5 del; 1 mod
  Patch: https://git.openjdk.org/crac/pull/109.diff
  Fetch: git fetch https://git.openjdk.org/crac.git pull/109/head:pull/109

PR: https://git.openjdk.org/crac/pull/109


More information about the crac-dev mailing list