RFR: 8288282: Zero-release build is broken after JDK-8279047 due to UseHeavyMonitors is read-only [v2]

David Holmes dholmes at openjdk.java.net
Mon Jun 13 11:29:08 UTC 2022


On Mon, 13 Jun 2022 09:42:44 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>>> Let's not force VM into different option settings in `release` and `fastdebug`, that's just calling for trouble.
>> 
>> So what's the trouble would be?
>> 
>> There are many VM flags which are only available for debug VMs.
>> 
>> ./share/runtime/globals.hpp:  develop(bool, LargePagesIndividualAllocationInjectError, false,           \
>> ./share/runtime/globals.hpp:  develop(bool, TracePcPatching, false,                                     \
>> ./share/runtime/globals.hpp:  develop(bool, TraceRelocator, false,                                      \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyStack, false,                                         \
>> ./share/runtime/globals.hpp:  develop(bool, TraceDerivedPointers, false,                                \
>> ./share/runtime/globals.hpp:  develop(bool, TraceCallFixup, false,                                      \
>> ./share/runtime/globals.hpp:  develop(bool, DeoptimizeALot, false,                                      \
>> ./share/runtime/globals.hpp:  develop(bool, DeoptimizeRandom, false,                                    \
>> ./share/runtime/globals.hpp:  develop(bool, DeoptimizeObjectsALot, false,                               \
>> ./share/runtime/globals.hpp:  develop(uint64_t, DeoptimizeObjectsALotInterval, 5,                       \
>> ./share/runtime/globals.hpp:  develop(int, DeoptimizeObjectsALotThreadCountSingle, 1,                   \
>> ./share/runtime/globals.hpp:  develop(int, DeoptimizeObjectsALotThreadCountAll, 1,                      \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyStackAtCalls, false,                                  \
>> ./share/runtime/globals.hpp:  develop(bool, TraceJavaAssertions, false,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, UseMallocOnly, false,                                       \
>> ./share/runtime/globals.hpp:  develop(bool, ZapResourceArea, trueInDebug,                               \
>> ./share/runtime/globals.hpp:  develop(bool, ZapUnusedHeapArea, trueInDebug,                             \
>> ./share/runtime/globals.hpp:  develop(bool, CheckZapUnusedHeapArea, false,                              \
>> ./share/runtime/globals.hpp:  develop(bool, ZapFillerObjects, trueInDebug,                              \
>> ./share/runtime/globals.hpp:  develop(uintx, ErrorHandlerTest, 0,                                       \
>> ./share/runtime/globals.hpp:  develop(uintx, TestCrashInErrorHandler, 0,                                \
>> ./share/runtime/globals.hpp:  develop(bool, TestSafeFetchInErrorHandler, false   ,                      \
>> ./share/runtime/globals.hpp:  develop(bool, TestUnresponsiveErrorHandler, false,                        \
>> ./share/runtime/globals.hpp:  develop(bool, Verbose, false,                                             \
>> ./share/runtime/globals.hpp:  develop(bool, PrintMiscellaneous, false,                                  \
>> ./share/runtime/globals.hpp:  develop(bool, WizardMode, false,                                          \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyAdapterSharing, false,                                \
>> ./share/runtime/globals.hpp:  develop(bool, PrintDebugInfo, false,                                      \
>> ./share/runtime/globals.hpp:  develop(bool, PrintRelocations, false,                                    \
>> ./share/runtime/globals.hpp:  develop(bool, PrintDependencies, false,                                   \
>> ./share/runtime/globals.hpp:  develop(bool, PrintExceptionHandlers, false,                              \
>> ./share/runtime/globals.hpp:  develop(bool, StressCompiledExceptionHandlers, false,                     \
>> ./share/runtime/globals.hpp:  develop(bool, InterceptOSException, false,                                \
>> ./share/runtime/globals.hpp:  develop(bool, PrintCodeCache2, false,                                     \
>> ./share/runtime/globals.hpp:  develop(bool, RegisterReferences, true,                                   \
>> ./share/runtime/globals.hpp:  develop(bool, PrintCodeCacheExtension, false,                             \
>> ./share/runtime/globals.hpp:  develop(bool, UsePrivilegedStack, true,                                   \
>> ./share/runtime/globals.hpp:  develop(bool, LoadLineNumberTables, true,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, LoadLocalVariableTables, true,                              \
>> ./share/runtime/globals.hpp:  develop(bool, LoadLocalVariableTypeTables, true,                          \
>> ./share/runtime/globals.hpp:  develop(uintx, PreallocatedOutOfMemoryErrorCount, 4,                      \
>> ./share/runtime/globals.hpp:  develop(bool, StressRewriter, false,                                      \
>> ./share/runtime/globals.hpp:  develop(bool, TraceBytecodes, false,                                      \
>> ./share/runtime/globals.hpp:  develop(bool, TraceICs, false,                                            \
>> ./share/runtime/globals.hpp:  develop(bool, TraceInlineCacheClearing, false,                            \
>> ./share/runtime/globals.hpp:  develop(bool, TraceDependencies, false,                                   \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyDependencies, trueInDebug,                            \
>> ./share/runtime/globals.hpp:  develop(bool, TraceNewOopMapGeneration, false,                            \
>> ./share/runtime/globals.hpp:  develop(bool, TraceNewOopMapGenerationDetailed, false,                    \
>> ./share/runtime/globals.hpp:  develop(bool, TimeOopMap, false,                                          \
>> ./share/runtime/globals.hpp:  develop(bool, TimeOopMap2, false,                                         \
>> ./share/runtime/globals.hpp:  develop(bool, TraceOopMapRewrites, false,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, TraceICBuffer, false,                                       \
>> ./share/runtime/globals.hpp:  develop(bool, TraceCompiledIC, false,                                     \
>> ./share/runtime/globals.hpp:  develop(bool, FLSVerifyDictionary, false,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, TraceFinalizerRegistration, false,                          \
>> ./share/runtime/globals.hpp:  develop(bool, InjectCompilerCreationFailure, false,                       \
>> ./share/runtime/globals.hpp:  develop(bool, GenerateSynchronizationCode, true,                          \
>> ./share/runtime/globals.hpp:  develop(bool, GenerateRangeChecks, true,                                  \
>> ./share/runtime/globals.hpp:  develop(bool, UseCHA, true,                                               \
>> ./share/runtime/globals.hpp:  develop(bool, TraceMethodReplacement, false,                              \
>> ./share/runtime/globals.hpp:  develop(bool, PrintMethodFlushing, false,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, StressCodeBuffers, false,                                   \
>> ./share/runtime/globals.hpp:  develop(bool, UseHeavyMonitors, false,                                    \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyHeavyMonitors, false,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, DebugVtables, false,                                        \
>> ./share/runtime/globals.hpp:  develop(bool, TraceCreateZombies, false,                                  \
>> ./share/runtime/globals.hpp:  develop(bool, TypeProfileCasts,  true,                                    \
>> ./share/runtime/globals.hpp:  develop(bool, TraceLivenessGen, false,                                    \
>> ./share/runtime/globals.hpp:  develop(intx, FastAllocateSizeLimit, 128*K,                               \
>> ./share/runtime/globals.hpp:  develop(bool, CountCompiledCalls, false,                                  \
>> ./share/runtime/globals.hpp:  develop(bool, UseFastSignatureHandlers, true,                             \
>> ./share/runtime/globals.hpp:  develop(bool, CountBytecodes, false,                                      \
>> ./share/runtime/globals.hpp:  develop(bool, PrintBytecodeHistogram, false,                              \
>> ./share/runtime/globals.hpp:  develop(bool, PrintBytecodePairHistogram, false,                          \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyOops, false,                                          \
>> ./share/runtime/globals.hpp:  develop(bool, CheckUnhandledOops, false,                                  \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyJNIFields, trueInDebug,                               \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyFPU, false,                                           \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyThread, false,                                        \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyActivationFrameSize, false,                           \
>> ./share/runtime/globals.hpp:  develop(bool, TraceFrequencyInlining, false,                              \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyDataPointer, trueInDebug,                             \
>> ./share/runtime/globals.hpp:  develop(intx, CounterHalfLifeTime,    30,                                 \
>> ./share/runtime/globals.hpp:  develop(intx, CounterDecayMinIntervalLength,   500,                       \
>> ./share/runtime/globals.hpp:  develop(bool, PrintDeoptimizationDetails, false,                          \
>> ./share/runtime/globals.hpp:  develop(bool, DebugDeoptimization, false,                                 \
>> ./share/runtime/globals.hpp:  develop(intx, MallocCatchPtr, -1,                                         \
>> ./share/runtime/globals.hpp:  develop(intx, StackPrintLimit, 100,                                       \
>> ./share/runtime/globals.hpp:  develop(intx, MaxForceInlineLevel, 100,                                   \
>> ./share/runtime/globals.hpp:  develop(intx, MethodHistogramCutoff, 100,                                 \
>> ./share/runtime/globals.hpp:  develop(intx, DontYieldALotInterval,    10,                               \
>> ./share/runtime/globals.hpp:  develop(intx, BciProfileWidth,      2,                                    \
>> ./share/runtime/globals.hpp:  develop(intx, InlineThrowCount,    50,                                    \
>> ./share/runtime/globals.hpp:  develop(intx, InlineThrowMaxSize,   200,                                  \
>> ./share/runtime/globals.hpp:  develop(size_t, CompressedClassSpaceBaseAddress, 0,                       \
>> ./share/runtime/globals.hpp:  develop(bool, MetaspaceGuardAllocations, false,                           \
>> ./share/runtime/globals.hpp:  develop(intx, BinarySwitchThreshold, 5,                                   \
>> ./share/runtime/globals.hpp:  develop(intx, StopInterpreterAt, 0,                                       \
>> ./share/runtime/globals.hpp:  develop(intx, TraceBytecodesAt, 0,                                        \
>> ./share/runtime/globals.hpp:  develop(intx, NewCodeParameter,      0,                                   \
>> ./share/runtime/globals.hpp:  develop(intx, MinOopMapAllocation,     8,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, LoomDeoptAfterThaw, false,                                  \
>> ./share/runtime/globals.hpp:  develop(bool, LoomVerifyAfterThaw, false,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyContinuations, false,                                 \
>> ./share/runtime/globals.hpp:  develop(bool, UseContinuationFastPath, true,                              \
>> ./share/runtime/globals.hpp:  develop(int, VerifyMetaspaceInterval, DEBUG_ONLY(500) NOT_DEBUG(0),       \
>> ./share/runtime/globals.hpp:  develop(bool, TraceMemoryWriteback, false,                                \
>> ./share/runtime/globals.hpp:  develop(bool, VerifyCrossModifyFence,                                     \
>> ./share/runtime/globals.hpp:  develop(bool, TraceOptimizedUpcallStubs, false,                              \
>
>> > Let's not force VM into different option settings in `release` and `fastdebug`, that's just calling for trouble.
>> 
>> So what's the trouble would be?
>> There are many VM flags which are only available for debug VMs.
> 
> Those flags are usually having the same value for release and debug VMs. Your current patch changes the flag values depending on VM mode, which exposes potentially different behaviors depending on VM mode. Imagine chasing a bug in `release` VM that does not reproduce in `debug` VM, those are not fun. Let's not do that. It would be all around easier and safer. to just disable to flag in all VM modes.
> 
> The block your patch is modifying is added by me in JDK-8273486, I say we just redo it without involving `UseHeavyMonitors` at all, and just disable the test that is affected by it.

It made more sense to me to keep what was the existing debug behaviour, but I don't have any interest in Zero at all, so whatever you want to do @shipilev is fine by me.

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

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


More information about the hotspot-dev mailing list