JDK-4054295 : UnknownError while loading class with super_class equal to zero
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.1.2
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1997-05-23
  • Updated: 1998-12-25
  • Resolved: 1997-07-02
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
1.2.0 1.2alpha2Fixed
Description
The section "4.1 ClassFile" of JVM spec says about super_class item:

"If the value of super_class is zero, then this class file must represent
the class java.lang.Object."

While loading class that is not java.lang.Object and that has super_class 
item equal to zero the exception UnknownError is thrown.

To reproduce run JCK test
   tests/vm/classfmt/clf/clfsup004/clfsup00401/clfsup00401.html

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.2alpha2 INTEGRATED IN: 1.2alpha2 VERIFIED IN: 1.2
14-06-2004

EVALUATION This test still fails in 1.1.3, but is fixed in 1.2, which has had its class loading rewritten. I think that the only real problem here is that the wrong error is being thrown, and I think that is only because someone threw a nonexistant error from C. I think that the culprit is the following in classresolver.c: if (cbSuperclass(cb) == NULL) { if (cbSuperName(cb)) { ...much deleted... } else if (cb == classJavaLangObject) { cbSuperclass(cb) = 0; } else { *detail = cbName(cb); return JAVAPKG "ClassFormatException"; } } CCSet(cb, Initialized); The trouble is, "ClassFormatException" doesn't exist, so when it's thrown it's replaced by "UnknownError". The writer meant to use "ClassFormatError". I don't think it's important to fix this for sparkler given that it's just the wrong exception being thrown, but the fix would be obvious. In 1.2 alpha2 the right error is thrown. timothy.lindholm@Eng 1997-07-01
01-07-1997