RFR: 8315576: compiler/codecache/CodeCacheFullCountTest.java fails after JDK-8314837 [v3]

Vladimir Kozlov kvn at openjdk.org
Thu Sep 21 18:47:53 UTC 2023


On Wed, 20 Sep 2023 21:04:09 GMT, Yi-Fan Tsai <duke at openjdk.org> wrote:

>> CodeCacheFullCountTest disables code cache flushing, and loads classes to fill up the code cache.
>> 
>> The test expected two scenarios:
>> 1. The compilers are disabled, adapters could still be created, and the process continues and terminates normally.
>> 2. The adapters cannot be allocated and VirtualMachineError has been thrown and printed to stderr in `ThreadGroup.uncaughtException`.
>> 
>> When the test runs with option `-Xcomp`, `-esa`, and `-XX:-TieredCompilation`, more codes are compiled and the code cache becomes full earlier. Two more scenarios are found:
>> 
>> 3. The adapters cannot be allocated during initialization of VM. The error message is printed to tty/stdout (`vm_exit_during_initialization` in `Method::make_adapters`) rather than stderr. (This is scenario of the bug report on windows-x64.)
>> 4. The adapters could not be allocated, and an VirtualMachineError was thrown and wrapped in other exceptions. The nested exceptions could not be printed by `printStackTrace` in `ThreadGroup.uncaughtException` while the code cache is full. Another VirtualMachineError was thrown and eventually printed by `JavaThread::exit` without its message. (This scenario was found with the same options of the bug report on linux-x64.)
>> 
>> More details of an example of scenario 4: the adapters could not be allocated in `loadClass`, and an VirtualMachineError was thrown and wrapped in LambdaConversionException in `InnerClassLambdaMetafactory.buildCallSite` and then BootstrapMethodError in `BootstrapMethodInvoker.invoke`. Printing these chained Throwable's in `ThreadGroup.uncaughtException` causes another VirtualMachineError thrown by `java.lang.StackTraceElement`. 
>> 
>>  stderr: [OpenJDK 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
>> OpenJDK 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
>> OpenJDK 64-Bit Server VM warning: C2 initialization failed. Shutting down all compilers
>> Exception in thread "main" java.lang.BootstrapMethodError: bootstrap method initialization exception
>> 
>> Exception: java.lang.VirtualMachineError thrown from the UncaughtExceptionHandler in thread "main"
>> ]
>> 
>> 
>> This change handles scenario 3 by checking the message in both stdout and stderr, and handles scenario 4 by exposing the root cause of VirtualMachineError. The second part is similar to  `CodeCacheOverflowProcessor.isThrowableCausedByVME` but without calling `String.matches` while code cache is full.
>> 
>> Th...
>
> Yi-Fan Tsai has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Expose the cause of Throwable

Okay. I think it is fine now.

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15604#pullrequestreview-1638485100


More information about the hotspot-compiler-dev mailing list