RFR: 8048190: NoClassDefFoundError omits original ExceptionInInitializerError [v8]

Coleen Phillimore coleenp at openjdk.java.net
Tue Aug 10 12:50:20 UTC 2021


On Tue, 10 Aug 2021 07:37:36 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:
>> 
>>  - Make Hashtable a fixed size, not resizable and bigger.
>>  - Merge branch 'master' into init-oom
>>  - Throw EIIE with the original exception as the cause and stack trace. Much safer. Also remove the redundant test and not try to get OOM because that would make the test unreliable.
>>  - Hooray another jasm file gone!
>>  - Fix java.base/bootstrap class loader comment.
>>  - Create new exception during initialization saving, so only need to save an oop. (Could potentially move to Doug's secret Class location.  If the exception is not bootstrap exception, throw EIIE instead with message of original exception.
>>  - Merge branch 'master' into init-oom
>>  - David review comments.
>>  - Merge branch 'master' into init-oom
>>  - 8048190: NoClassDefFoundError omits original ExceptionInInitializerError
>>  - ... and 1 more: https://git.openjdk.java.net/jdk/compare/1de39e8a...ffec5bbd
>
> src/hotspot/share/classfile/javaClasses.cpp line 2665:
> 
>> 2663:   // the message and stack trace.
>> 2664: 
>> 2665:   // Now create the same exception with this stacktrace and thread name.
> 
> Comment needs updating

fixed.

> test/hotspot/jtreg/runtime/ClassInitErrors/InitExceptionUnloadTest.java line 53:
> 
>> 51:     static public class ThrowsSpecialException {
>> 52:         static {
>> 53:             if (true) foo();
> 
> Not sure why you need to define foo() - and if you use foo() you shouldn't need the "if (true)".

I've removed the foos.  They made jasm hacking easier when I thought I needed that.

> test/hotspot/jtreg/runtime/ClassInitErrors/InitExceptionUnloadTest.java line 60:
> 
>> 58:     }
>> 59: 
>> 60:     static public class InitOOM {
> 
> Why InitOOM instead of ThrowsOOM?

fixed. That's a bit more consistent.

> test/hotspot/jtreg/runtime/ClassInitErrors/InitExceptionUnloadTest.java line 135:
> 
>> 133:     public static void main(java.lang.String[] unused) throws Throwable {
>> 134:         test();
>> 135:         test();
> 
> Why twice?

The classes should be unloaded and the message should be the same for each iteration, ie, first call should get EIIE and second should get NCDFE.

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

PR: https://git.openjdk.java.net/jdk/pull/4996


More information about the hotspot-dev mailing list