JDK-8151064 : com/sun/jdi/RedefineAddPrivateMethod.sh fails intermittently
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_11
  • CPU: x86_64
  • Submitted: 2016-03-02
  • Updated: 2016-07-21
  • Resolved: 2016-03-03
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 8 JDK 9
8u102Fixed 9 b110Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
In the 2016-03-01 JDK9-hs-rt nightly, the following test failed:

    com/sun/jdi/RedefineAddPrivateMethod.sh

Here is a snippet of the .jtr file:

#section:shell
----------messages:(3/144)----------
command: shell RedefineAddPrivateMethod.sh
reason: User specified action: run shell RedefineAddPrivateMethod.sh 
elapsed time (seconds): 11.174
----------System.out:(26/1641)----------
--Compiling first version of /export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184/shtest.java with options: -g
compiling  shtest.java

--Compiling second version of /export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184/shtest.java with -g

--Starting jdb, address=
Listening at address: sca00csv.us.oracle.com:37763
--Starting debuggee with args from TESTVMOPTS and/or TESTJAVAOPTS:  -Xmixed -server -XX:MaxRAMFraction=8 -XX:+CreateCoredumpOnCrash -XX:ReservedCodeCacheSize=256M -XX:NativeMemoryTracking=detail
Cmd: /export/local/aurora/CommonData/TEST_JAVA_HOME/bin/java  -classpath /export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184 -DHANGINGJAVA-7184_DEB  -Xmixed -server -XX:MaxRAMFraction=8 -XX:+CreateCoredumpOnCrash -XX:ReservedCodeCacheSize=256M -XX:NativeMemoryTracking=detail             -Djtreg.classDir=/export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184             -showversion              -agentlib:jdwp=transport=dt_socket,address=37763,server=n,suspend=y              shtest
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 shtest:3.
It will be set after the class is loaded.
main[1] > Unable to set deferred breakpoint shtest:3 : No code at line 3 in shtest

Stopping due to deferred breakpoint errors.
"thread=main", java.lang.Class.getDeclaredMethods0(), line=-1 bci=-1

main[1] main[1] Unable to set breakpoint shtest:3 : No code at line 3 in shtest
main[1] > 
The application exited
Input stream closed.
----------System.err:(17/842)----------
ShellScaffold.sh: Version
--Sending cmd:  stop at shtest:3
--Sending cmd:  run
java version "9-internal"
Java(TM) SE Runtime Environment (fastdebug build 9-internal+0-2016-03-02-004742.mgronlun.upstream)
Java HotSpot(TM) 64-Bit Server VM (fastdebug build 9-internal+0-2016-03-02-004742.mgronlun.upstream, mixed mode)

--Sending cmd:  redefine shtest /export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184/vers2/shtest.class
--Sending cmd:  stop at shtest:3
--Sending cmd:  cont
--JDB finished: The application exited
--Finish without sending "quit" command to JDB
-rw-r--r--   1 root     root          52 Mar  2 04:56 /export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184/testFailed
<cleanup:_begin_failFile_contents>
 
--Fail: main: jdb input stream closed prematurely
<cleanup:_end_failFile_contents>

Based on the output above:

main[1] > Unable to set deferred breakpoint shtest:3 : No code at line 3 in shtest

it looks like the redefined class was not compiled with the '-g' option.

Update: however the test output says that the classes were compiled with '-g':

--Compiling first version of /export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184/shtest.java with options: -g
compiling  shtest.java

--Compiling second version of /export/local/aurora/sandbox/results/workDir/classes/0/com/sun/jdi/aa7184/shtest.java with -g


This test was recently added by JDK-8149743.


Comments
Managed to reproduce it and have a fix.
03-03-2016

I'm guessing it could be fixed by doing the change below but I'm not sure how to verify that, since I don't know why it would fail intermittently like this. Never saw any problems when testing through jprt/rbt. diff --git a/test/com/sun/jdi/RedefineAddPrivateMethod.sh b/test/com/sun/jdi/RedefineAddPrivateMethod.sh --- a/test/com/sun/jdi/RedefineAddPrivateMethod.sh +++ b/test/com/sun/jdi/RedefineAddPrivateMethod.sh @@ -35,7 +35,7 @@ cat <<EOF > $1.java.1 public class $1 { static public void main(String[] args) { - // @1 breakpoint @2 breakpoint + return; // @1 breakpoint @2 breakpoint } // @1 uncomment private static void test() {}
02-03-2016

Only intermittently? Are there any obvious patterns to the failures, a specific platform or something?
02-03-2016

Andreas, this one is strange. Can you take a look?
02-03-2016

Since this appears to be an intermittent failure, I'm not tagging it with 'integration_blocker'. Let's see what Andreas says...
02-03-2016