RFR(S): 8016277: Crash in nmethod::is_compiled_by_c1() on x86

Niclas Adlertz niclas.adlertz at oracle.com
Wed Aug 21 01:45:06 PDT 2013


Looks good! 

I would appreciate if you could add brackets to the simple if statements:
if (compiler() == NULL) {
  return false;
}

And also, if you could put the comment above the line instead of to the right:

// the Method may be reclaimed by class unloading now that the nmethod is in zombie state
_method = NULL;

Kind Regards,
Niclas Adlertz


On 21 aug 2013, at 10:01, Roland Westrelin <roland.westrelin at oracle.com> wrote:

> http://cr.openjdk.java.net/~roland/8016277/webrev.00/
> 
> Once an nmethod becomes zombie, its Method can be reclaimed so the reference to the Method in the nmethod becomes invalid.
> 
> My change sets the nmethod's _method to NULL once the nmethod is in the zombie state so that we risk using an invalid reference. The crash itself was cause by nmethod::is_native_method() (which uses the Method pointer of the nmethod) called from nmethod::is_compiled_by_c1() by some verification code. I changed the implementation of the nmethod::is_compiled_by_* so that they don't need to call is_native_method() (a call that was anyway useless because for a native method the compiler() is NULL).
> 
> Roland.



More information about the hotspot-runtime-dev mailing list