Review request (S): 6539281 -Xcheck:jni should validate char* argument to ReleaseStringUTFChars

Tom Rodriguez tom.rodriguez at
Thu Dec 2 11:03:00 PST 2010

On Dec 2, 2010, at 6:18 AM, Staffan Larsen wrote:

> Validate that ReleaseStringUTFChars/ReleaseStringChars is called with something allocated by GetStringUTChars/GetStringChars when running with -Xcheck:jni. This is accomplished by adding a well-known tag in the memory immediately before the pointer that is returned to the user. This tag is verified in ReleaseStringUTFChars.

Won't this cause the dtrace arguments not to match up anymore?  The return probe for GetStringChars will report the original allocation but the ReleaseStringChars will be passed the new allocation so they won't agree.  It's a minor issue but it does seem odd.

You might consider asserting that isCopy == true.


> Thanks,
> /Staffan

More information about the hotspot-runtime-dev mailing list