[9] RFR(S): 8139150: ClassVerifier frees exception message while it's still in use (original) (raw)
Tobias Hartmann tobias.hartmann at oracle.com
Fri Oct 9 07:07:25 UTC 2015
- Previous message: [9] RFR(S): 8139150: ClassVerifier frees exception message while it's still in use
- Next message: [9] RFR(S): 8139150: ClassVerifier frees exception message while it's still in use
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks, Zoltán!
Best, Tobias
On 08.10.2015 17:51, Zoltán Majó wrote:
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
- Previous message: [9] RFR(S): 8139150: ClassVerifier frees exception message while it's still in use
- Next message: [9] RFR(S): 8139150: ClassVerifier frees exception message while it's still in use
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]