On Mon, 2 Sep 2024 10:30:25 GMT, Amit Kumar <amitku...@openjdk.org> wrote:

>> Thanks Chris and Matias for reviewing parts of this.
>
> Hi @coleenp, 
> 
> I got this error while build on my Mac-M1, did you see something like this ? 
> : 
> 
> ERROR: Failed to generate link optimization data. This is likely a problem 
> with the newly built JVM/JDK.
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  Internal Error 
> (/Users/amitkumar/jdk/src/hotspot/share/oops/klassFlags.hpp:72), pid=57968, 
> tid=10499
> #  assert(!is_value_based_class()) failed: set once
> #
> # JRE version:  (24.0) (fastdebug build )
> # Java VM: OpenJDK 64-Bit Server VM (fastdebug 
> 24-internal-adhoc.amitkumar.jdk, mixed mode, sharing, tiered, compressed 
> oops, compressed class ptrs, g1 gc, bsd-aarch64)
> # No core dump will be written. Core dumps have been disabled. To enable core 
> dumping, try "ulimit -c unlimited" before starting Java again
> #
> # An error report file with more information is saved as:
> # /Users/amitkumar/jdk/make/hs_err_pid57968.log
> #
> #
> 
> 
> These are the changes with which I am build the JVM. I can reproduce it on my 
> s390x-machine as well. 
> 
> diff --git a/src/hotspot/share/runtime/globals.hpp 
> b/src/hotspot/share/runtime/globals.hpp
> index d442894798b..fbd1a2b3281 100644
> --- a/src/hotspot/share/runtime/globals.hpp
> +++ b/src/hotspot/share/runtime/globals.hpp
> @@ -170,7 +170,7 @@ const int ObjectAlignmentInBytes = 8;
>    product(bool, AlwaysSafeConstructors, false, EXPERIMENTAL,                \
>            "Force safe construction, as if all fields are final.")           \
>                                                                              \
> -  product(bool, UnlockDiagnosticVMOptions, trueInDebug, DIAGNOSTIC,         \
> +  product(bool, UnlockDiagnosticVMOptions, true, DIAGNOSTIC,         \
>            "Enable normal processing of flags relating to field diagnostics")\
>                                                                              \
>    product(bool, UnlockExperimentalVMOptions, false, EXPERIMENTAL,           \
> @@ -819,7 +819,7 @@ const int ObjectAlignmentInBytes = 8;
>    product(bool, RestrictContended, true,                                    \
>            "Restrict @Contended to trusted classes")                         \
>                                                                              \
> -  product(int, DiagnoseSyncOnValueBasedClasses, 0, DIAGNOSTIC,              \
> +  product(int, DiagnoseSyncOnValueBasedClasses, 1, DIAGNOSTIC,              \
>               "Detect and take action upon identifying synchronization on "  \
>               "value based classes. Modes: "                          ...

@offamitkumar  Thank you for finding this bug. These flags have asserts that 
they're only set once, but CDS restores sets the value for this flag.  Since it 
was set when dumping the archive, it resets it, which is okay in this case.  I  
have a fix for this.

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

PR Comment: https://git.openjdk.org/jdk/pull/20719#issuecomment-2326395437

Reply via email to