[9] RFR(S): 8139150: ClassVerifier frees exception message while it's still in use (original) (raw)

Zoltán Majó zoltan.majo at oracle.com
Thu Oct 8 15:51:47 UTC 2015


Hi Tobias,

the fix looks good to me. (I'm not a Reviewer.)

Best regards,

Zoltan

On 10/08/2015 05:38 PM, Tobias Hartmann wrote:

Hi,

please review the following patch. https://bugs.openjdk.java.net/browse/JDK-8139150 http://cr.openjdk.java.net/~thartmann/8139150/webrev.00/ Problem: If class verification fails in StackMapReader::parseverificationtype(), ClassVerifier::classformaterror() is invoked to pass the error message. The method allocates a new string and saves it in ClassVerifier::message. The problem is that the caller creates a new ResourceMark that leads to message being deallocated after return. However, later in Verifier::verify() we call ClassVerifier::exceptionmessage() to get the message and pass it on. Solution: We should not create a ResourceMark here. There is a top level ResourceMark in Verifier::verify() that will take care of freeing the memory allocated in ClassVerifier::classformaterror(). Tested with JPRT and the failing testcase. Thanks, Tobias



More information about the hotspot-dev mailing list