JDK-5106020 : SEGV in regression test java/lang/Character/Supplementary.java on Solaris 8
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS:
    solaris,solaris_8,solaris_9,solaris_10 solaris,solaris_8,solaris_9,solaris_10
  • CPU: sparc
  • Submitted: 2004-09-23
  • Updated: 2004-12-15
  • Resolved: 2004-12-15
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.
Other JDK 6
5.0u8Fixed 6 b16Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
The j2se regression test test/java/lang/Character/Supplementary.java
started failing with Mustang build b04, only on solaris-sparc Solaris 8.

It has not been seen to fail on windows or linux, or solaris-sparc Solaris 9,
or on solaris-x86 Solaris 10, but has been seen to fail on multiple Solaris 8
machines.

The presence of a core file, and the error message

execStatus=Failed. Unexpected exit from test [exit code: 11]

are indicative of a SEGV.

More precisely, nightly build b04-2004-09-14 works, while b04-2004-09-15 fails.

shell transcript extract follows:

/u/martin/jct-tools/2.1.6/solaris/bin/jtreg -automatic -jdk:/java/re/jdk/1.6.0/nightly/binaries/solaris-sparc/b04-2004-09-14/jdk1.6.0/ Supplementary.java
Directory "./JTreport" not found: Creating
Directory "./JTwork" not found: Creating
Directory "./JTwork/scratch" not found: Creating
test results: passed: 1
Report written to /u/martin/ws/tiger/test/java/lang/Character/JTreport/report.html
Results written to /u/martin/ws/tiger/test/java/lang/Character/JTwork
/u/martin/jct-tools/2.1.6/solaris/bin/jtreg -automatic -jdk:/java/re/jdk/1.6.0/nightly/binaries/solaris-sparc/b04-2004-09-15/jdk1.6.0/ Supplementary.java
Directory "./JTreport" not found: Creating
Directory "./JTwork" not found: Creating
Directory "./JTwork/scratch" not found: Creating
test results: failed: 1
Report written to /u/martin/ws/tiger/test/java/lang/Character/JTreport/report.html
Results written to /u/martin/ws/tiger/test/java/lang/Character/JTwork
Error: some tests failed or other problems occurred

Here is the jtr file:

description=file:///java/jdk/1.6.0/ws/integration/TL/j2se/test/java/lang/Character/Supplementary.java
end=Wed Sep 22 17:47:26 PDT 2004
environment=regtest
execStatus=Failed. Unexpected exit from test [exit code: 11]
javatestOS=SunOS 5.8 (sparc)
javatestVersion=2.1.6
script=com.sun.javatest.regtest.RegressionScript 
sections=script_messages compile build main
start=Wed Sep 22 17:44:45 PDT 2004
status=Failed. Unexpected exit from test [exit code: 11]
test=java/lang/Character/Supplementary.java
work=/tmp/w/java/lang/Character

#section:script_messages
----------messages:(4/235)----------
JDK under test: (/java/re/jdk/1.6.0/nightly/binaries/solaris-sparc/latest)
java version "1.6.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta-b05)
Java HotSpot(TM) Client VM (build 1.6.0-beta-b05, mixed mode)

#section:compile
----------messages:(3/207)----------
command: compile /java/jdk/1.6.0/ws/integration/TL/j2se/test/java/lang/Character/Supplementary.java 
reason: User specified action: run compile -source 1.5 Supplementary.java 
elapsed time (seconds): 11.728
----------System.out:(0/0)----------
----------System.err:(0/0)----------
result: Passed. Compilation successful

#section:build
----------messages:(3/100)----------
command: build Supplementary 
reason: Named class compiled on demand
elapsed time (seconds): 0.0060
result: Passed. No need to compile: Supplementary.java

#section:main
----------messages:(3/127)----------
command: main Supplementary
reason: User specified action: run main/timeout=600 Supplementary 
elapsed time (seconds): 149.078
----------System.out:(0/0)----------
----------System.err:(0/0)----------
result: Failed. Unexpected exit from test [exit code: 11]


test result: Failed. Unexpected exit from test [exit code: 11]

Comments
EVALUATION This is actually broken in 1.5.0 but recent changes have turned it from accidentally working code into a crash. The code for 4826722 in sharedRuntime.cpp is missing a case for when an exception occurs in the ientries code. In 1.5.0 it happens to work out that casting the ientries CodeBlob to an nmethod and calling inlinecache_check_contains on it returns true which causes it to dispatch to the throw_NullPointerException_at_call_entry code which does the right thing. In 1.6.0 this happens to return false and so we go down the wrong path and die. The fix is simply to handle the ientries case the same as C2 handles the c2i adapter case. We should probably fix this in a 1.5.0 update release as well since there's no telling when an unreleated change could cause this to start dying there too. ###@###.### 2004-11-30 19:15:06 GMT
30-11-2004

SUGGESTED FIX *** /tmp/geta29076 Tue Nov 30 11:09:33 2004 --- sharedRuntime.cpp Mon Nov 29 19:04:10 2004 *************** *** 499,516 **** // 2. Inline-cache check in nmethod, or // 3. Implict null exception in nmethod - #ifdef COMPILER2 if (!cb->is_nmethod()) { if (OptoRuntime::uncommon_trap_blob() != NULL && OptoRuntime::uncommon_trap_blob()->contains(pc)) { ShouldNotReachHere(); } guarantee((cb->is_c2i_adapter() && ((C2IAdapter*)cb)->inlinecache_check_contains(pc)), "exception happened outside interpreter, nmethods and vtable stubs (2)"); // There is no handler here, so we will simply unwind. return StubRoutines::throw_NullPointerException_at_call_entry(); } - #endif // COMPILER2 // Otherwise, it's an nmethod. Consult its exception handlers. nmethod* nm = (nmethod*)cb; --- 499,521 ---- // 2. Inline-cache check in nmethod, or // 3. Implict null exception in nmethod if (!cb->is_nmethod()) { + #ifdef COMPILER2 if (OptoRuntime::uncommon_trap_blob() != NULL && OptoRuntime::uncommon_trap_blob()->contains(pc)) { ShouldNotReachHere(); } guarantee((cb->is_c2i_adapter() && ((C2IAdapter*)cb)->inlinecache_check_contains(pc)), "exception happened outside interpreter, nmethods and vtable stubs (2)"); + #endif // COMPILER2 + #ifdef COMPILER1 + CodeBlob* ientries = Runtime1::blob_for(Runtime1::interpreter_entries_id); + guarantee(ientries->contains(pc), + "exception happened outside interpreter, nmethods and vtable stubs (3)"); + #endif // COMPILER1 // There is no handler here, so we will simply unwind. return StubRoutines::throw_NullPointerException_at_call_entry(); } // Otherwise, it's an nmethod. Consult its exception handlers. nmethod* nm = (nmethod*)cb; ###@###.### 2004-11-30 19:15:06 GMT
30-11-2004