Review request (S): 6539281 -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
staffan.larsen at oracle.com
Thu Dec 2 11:14:21 PST 2010
Yes, you are right. I can't figure out a way to avoid this, unless I copy all of the code from the normal methods into jniCheck.cpp and never call the unchecked versions.
Will do the isCopy == true check.
On 2 dec 2010, at 20.03, Tom Rodriguez wrote:
> 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.
More information about the hotspot-runtime-dev