On Fri, 30 Oct 2020 06:56:13 GMT, Richard Reingruber <rr...@openjdk.org> wrote:
>> Changes requested by coleenp (Reviewer). > > Hi Erik, > > is it possible for GC to mistake a primitive value for a reference when > posting the exit event? > > My understanding is: we are at a random bci of a method that is forced to > return early. The expression stack is emptied and the return value is pushed > on the expression stack then we call into the interpreter runtime to post the > JVMTI method exit event during which we come to a safepoint for GC. The oop > map for the bci does not cover this forced early return and if the return > value is an object then the reference pushed on the expression stack before > is not updated by GC. With your fix the value is updated if it is a reference. > > If this is correct then to me it appears as if GC can also crash because the > oop map for the random bci tells there has to be a reference at the stack > position of the return value if it actually is a primitive value. I think you've discovered JDK-6449023. ------------- PR: https://git.openjdk.java.net/jdk/pull/930