I concur with Markus. Pairing JVM_CONSTANT_UnresolvedClassInError with
JVM_CONSTANT_UnresolvedClass in the ConstantPool::copy_entry_to()
switch looks like the right thing to do.

The usual questions:

- why wasn't this failure mode seen before JDK8?
- was this failure caught somewhere else before JDK8 and changes
  in JDK8 exposed a new code path?

Reasoning about this from a 30,000 foot view, I don't see any reason
why you can't redefine a class that has a constant pool ref that
refers to a class in error. You won't be able to use the error'ed
class, but there's no reason it can't be in there... Or does that
violate the rule that you can't redefine a class that isn't fully
linked (what ever that means...)???

So what does your new test on JDK7 or JDK6? Just curious...

Dan


On 2/24/14 2:42 AM, Markus Gronlund wrote:
Hi Staffan,

I would think this is the correct fix.

The other two constant pool "error" tags, besides UnresolvedClassInError, which signal 
constant pool resolution errors are MethodTypeInError and MethodHandleInError - these error tags 
are associated with their corresponding "success" tags in switch targets in 
ConstantPool::copy_entry_to(), as well as in additional routines in constantPool.cpp.

In addition, in other routines in ConstantPool.cpp, the error tag 
JVM_CONSTANT_UnresolvedClassInError is associated with 
JVM_CONSTANT_UnresolvedClass -  ConstantPool::resolve_constant_at_impl() for 
example.

Thanks
Markus


-----Original Message-----
From: Staffan Larsen
Sent: den 21 februari 2014 15:11
To: hotspot-runtime-dev; serviceability-dev@openjdk.java.net 
serviceability-dev@openjdk.java.net
Subject: RFR: 8035150 ShouldNotReachHere() in ConstantPool::copy_entry_to

This is an attempt to solve a crash while redefining a class that has 
unresolved class references in its constant pool. I would appreciate some extra 
scrutiny here since I am unfamiliar with this code path.

I have also added a test that causes a JVM crash without the fix.

The updates to the test library is all code copied from the jdk version of the 
test library.

webrev: http://cr.openjdk.java.net/~sla/8035150/webrev.00/
bug: https://bugs.openjdk.java.net/browse/JDK-8035150

Thanks,
/Staffan

Reply via email to