JDK-8025841 : JVMTI: "vtable stub" dynamic code notification is misplaced
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: hs24,hs25,6,7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-10-02
  • Updated: 2015-04-14
  • Resolved: 2014-02-07
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 8 JDK 9
8u20Fixed 9 b04Fixed
Related Reports
Duplicate :  
Description
JVMTI_EVENT_DYNAMIC_CODE_GENERATED for "vtable stub" gets scheduled when a new chunk of memory for subsequent vtable and itable stubs is allocated. That chunk is uninitialized (contains zeros or garbage) although due to the fact that the actual event delivery is deferred, at least one vtable comes out right. This event should describe an individual vtable/itable stub (base address and size) and only after it's been created (memory is actually populated with code). Where VM diagnostic messages about vtable/itable stubs are issued upon -XX:+PrintAdapterHandlers appears exactly the right place for JVMTI events as well.

Getting vtables/itables right is important in the context of performance analysis as that dynamically generated code may accumulate quite noticeable CPU time (especially itabes), sometimes larger than the actual Java methods called.

Comments
Assigning the bug to Oleg as he is contributing and testing the suggested fix.
01-02-2014

Increased the bug priority to P3. ILW=MMM (Medium Impact - important for Oracle Studio Performance Analyzer, Medium Likelihood, Medium Workaround) The reasons are: - Important for profiling data quality of the Oracle Studio Performance Analyzer - The fix is ready for review
01-02-2014

I have attached an improved patch that takes care of events generated with jvmti->GenerateEvents().
13-11-2013

One complication is with the JVMTI_EVENT_DYNAMIC_CODE_GENERATED event. It still reports allocated chunks (BufferBlobs), not individual vtable or itable stubs. One JVMTI test, em04t001, notices the difference and reports an error.
11-10-2013

I have attached a patch which I verified to solve the problem with a profiling tool I use.
03-10-2013

Oleg has a fix in mind and would like to make a progress on this bug resolution as this issue is important for Oracle Studio Performance Analyzer. I'm going to review and sponsor the push into the hotspot-rt. I've temporarily assigned this bug to myself to hold people from fixing it. :)
03-10-2013