JDK-8181171 : Deleting method for RedefineClasses breaks ResolvedMethodName
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-05-27
  • Updated: 2019-08-20
  • Resolved: 2019-02-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b10Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
For class redefinition, we save ResolvedMethodName (once MemberName) so that the new Method* can replace the old Method*.   If the old Method* is deleted, we don't have anything to replace it with.

        if (old_method->is_deleted()) {
          // leave deleted method in ResolvedMethod for now (this is a bug that we don't mark
          // these on_stack)
          continue;
        }

Comments
Could you possibly add the test case? Thanks.
12-12-2018

Reopening. We might be able to break this with nestmates, since they have access to private methods of another class. Yeah, I can break this with a test case.
20-11-2018

Update: I don't think this is a bug. If the old version of the class is no longer running, GC reclaims the memory for the ResolvedMethod oop and clears the weak reference in the ResolvedMethodTable that points to it, which in turn points to the deleted Method. If the old version of the class is running, the memory for the deleted method will not be reclaimed. Closing as NAI. We should probably update this comment though.
19-11-2018

I think JDK-8210457 is caused by deleting a method during redefinition while adding the method to the ResolvedMethodTable. So this bug needs to be fixed first. [~sspitsyn] have you started on this?
19-11-2018

[~dholmes] made it confidential. Thanks you for the catch.
06-07-2018

I think to fix this, MetadataOnStackMark needs to walk the ResolvedMethodTable.
05-07-2018