JDK-8164012 : com/sun/jdi/CatchPatternTest.sh fails on jdk9/hs with Required output "Exception occurred: java.lang.IllegalMonitorStateException" not found
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-08-15
  • Updated: 2018-08-09
  • Resolved: 2016-08-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b133Fixed
Related Reports
Relates :  
Description
com/sun/jdi/CatchPatternTest.sh fails for the jdk9/hs  snapshot with Exception occurred: java.lang.NoSuchMethodError. This has to be fixed or the test excluded (in jdk9/dev) before the snapshot is pushed to jdk9/dev

Exception occurred: java.lang.IllegalArgumentException (to be caught at: CatchPatternTestTarg.loop(), line=21 bci=15)"thread=main", CatchPatternTestTarg.bark(), line=6 bci=53
6                throw new IllegalArgumentException("IllegalArgumentException");

main[1] > 
Exception occurred: java.lang.NoSuchMethodError (to be caught at: java.lang.invoke.MemberName$Factory.resolve(), line=1,045 bci=56)"thread=main", java.lang.invoke.MethodHandleNatives.resolve(), line=-1 bci=-1

main[1] > 
Exception occurred: java.lang.NoSuchMethodError (to be caught at: java.lang.invoke.MemberName$Factory.resolve(), line=1,045 bci=56)"thread=main", java.lang.invoke.MethodHandleNatives.resolve(), line=-1 bci=-1

main[1] Removed: all java.lang.I*
main[1] >  loop: IllegalArgumentException caught and ignored.
 bark: 1
 loop: ArithmeticException caught and ignored.
 bark: 2
 loop: IllegalMonitorStateException caught and ignored.
partOne completed

Breakpoint hit: "thread=main", CatchPatternTestTarg.partTwo(), line=32 bci=0
32            loop(3);

main[1]  bark: 0
 loop: IllegalArgumentException caught and ignored.
 bark: 1
 loop: ArithmeticException caught and ignored.
 bark: 2
 loop: IllegalMonitorStateException caught and ignored.
 bark: 3
 loop: IndexOutOfBoundsException caught and ignored.
partTwo completed
Goodbye from CatchPatternTestTarg!
STDERR:
ShellScaffold.sh: Running with timeout_factor = 4
--Sending cmd:  stop in CatchPatternTestTarg.main
--Sending cmd:  stop in CatchPatternTestTarg.partTwo
--Sending cmd:  run
java version "9-internal"
Java(TM) SE Runtime Environment (build 9-internal+0-2016-08-12-210054.amurillo.jdk9-hs-2016-08-12-jdk9-dev-control)
Java HotSpot(TM) Server VM (build 9-internal+0-2016-08-12-210054.amurillo.jdk9-hs-2016-08-12-jdk9-dev-control, mixed mode)

--Sending cmd:  ignore uncaught java.lang.Throwable
--Sending cmd:  catch all java.lang.I*
--Sending cmd:  cont
--Sending cmd:  cont
--Sending cmd:  cont
--Sending cmd:  ignore all java.lang.I*
--Sending cmd:  cont
--Finish execution with sending "quit" command to JDB
--Sending cmd: quit
--Quit cmd was sent
--waitForFinish: Waiting for all processes to finish
-rw-rw-r-- 1 jprtadm jprtadm 2116 Aug 12 18:49 /scratch/opt/jprt/T/P1/210054.amurillo/s/jdk/testoutput/jdk_jdi/JTwork/classes/com/sun/jdi/aa12140/testFailed
<cleanup:_begin_failFile_contents>
 
--Fail: main: Required output "Exception occurred: java.lang.IllegalMonitorStateException" not found in /scratch/opt/jprt/T/P1/210054.amurillo/s/jdk/testoutput/jdk_jdi/JTwork/classes/com/sun/jdi/aa12140/jxdbOutput.txt /scratch/opt/jprt/T/P1/210054.amurillo/s/jdk/testoutput/jdk_jdi/JTwork/classes/com/sun/jdi/aa12140/jxdbOutput.txt
---- contents of /scratch/opt/jprt/T/P1/210054.amurillo/s/jdk/testoutput/jdk_jdi/JTwork/classes/com/sun/jdi/aa12140/jxdbOutput.txt follows -------
Listening at address: 
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
> 
VM Started: No frames on the current call stack

main[1] Deferring breakpoint CatchPatternTestTarg.main.
It will be set after the class is loaded.
main[1] Deferring breakpoint CatchPatternTestTarg.partTwo.
It will be set after the class is loaded.
main[1] > Set deferred breakpoint CatchPatternTestTarg.partTwo
Set deferred breakpoint CatchPatternTestTarg.main

Breakpoint hit: "thread=main", CatchPatternTestTarg.main(), line=36 bci=0
36            System.out.println("Howdy!");

main[1] Removed: uncaught java.lang.Throwable
main[1] Deferring all java.lang.I*.
It will be set after the class is loaded.
main[1] > 
Exception occurred: java.lang.IllegalArgumentException (to be caught at: CatchPatternTestTarg.loop(), line=21 bci=15)"thread=main", CatchPatternTestTarg.bark(), line=6 bci=53
6                throw new IllegalArgumentException("IllegalArgumentException");

main[1] > 
Exception occurred: java.lang.NoSuchMethodError (to be caught at: java.lang.invoke.MemberName$Factory.resolve(), line=1,045 bci=56)"thread=main", java.lang.invoke.MethodHandleNatives.resolve(), line=-1 bci=-1

main[1] > 
Exception occurred: java.lang.NoSuchMethodError (to be caught at: java.lang.invoke.MemberName$Factory.resolve(), line=1,045 bci=56)"thread=main", java.lang.invoke.MethodHandleNatives.resolve(), line=-1 bci=-1

main[1] Removed: all java.lang.I*
main[1] > 
Breakpoint hit: "thread=main", CatchPatternTestTarg.partTwo(), line=32 bci=0
32            loop(3);
Comments
Was there any constraint preventing this for being pushed to jdk9/dev? I got the PIT cert from SQE, so i will be pushing the snapshot later today and this test will start failing on mach5 and jprt jobs. Please exclude the test in jdk9/dev until this fix from jdk9/hs makes it there
16-08-2016

Great. Can you make and push that change on jdk9/dev?
15-08-2016

The test instructs jdb to break on all exceptions matching "java.lang.I*" (that's a capital 'i'). The semantics of that operation actually means "break on all exceptions which have a class name or superclass name matching this string". Some of the recent changes in java.lang.invoke now causes the code to throw numerous java.lang.NoSuchMethodErrors. This is a subclass of java.lang.IncompatibleClassChangeError, which matches "java.lang.I*". The net result is that jdb will break on a lot more places (all the NoSuchMethodError exceptions) than the test expects and the test fails. We can work around this in the test by changing this line: cmd catch all java.lang.I* to the following two lines: cmd catch all java.lang.Il* cmd catch all java.lang.Ind* This will still match the exception types the test is looking for (IllegalArgumentException, IllegalMonitorStateException, and IndexOutOfBoundsException), but it will not match IncompatibleClassChangeError.
15-08-2016

RULE "com/sun/jdi/CatchPatternTest.sh" ExitCode 1
15-08-2016

I found the test output for this completely indecipherable. The synopsis refers to NoSuchMethodError but the actual failure seems to be: --Fail: main: Required output "Exception occurred: java.lang.IllegalMonitorStateException" not found in /scratch/opt/jprt/T/P1/210054.amurillo/s/jdk/testoutput/jdk_jdi/JTwork/classes/com/sun/jdi/aa12140/jxdbOutput.txt /scratch/opt/jprt/T/P1/210054.amurillo/s/jdk/testoutput/jdk_jdi/JTwork/classes/com/sun/jdi/aa12140/jxdbOutput.txt Though it is impossible to tell what output comes from where in this test!
15-08-2016