JDK-6219495 : CompiledMethodLoad reports incorrect addresses in the location map
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-01-20
  • Updated: 2010-04-02
  • Resolved: 2005-02-09
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.
Other JDK 6
5.0u3Fixed 6 b23Fixed
Description
In the CompiledMethodLoad event the 'map' parameter to the event provides the profiler with an address map so that native addresses can be mapped to the bci in the method. Unfortunately we are reporting the address as offset from nmethod's instruction starting address (which isn't the same as the code_addr reported to the profiler because there is some header data before the instructions).
###@###.### 2005-1-20 12:42:50 GMT

Specifically, the jvmtiAddrLocationMap.start_address should be an absolute address, not an offset. Per the JVM TI spec:

    Starting native address of code corresponding to a location


###@###.### 2005-1-21 00:08:04 GMT

Comments
EVALUATION As per description ###@###.### 2005-1-27 12:18:28 GMT
27-01-2005

SUGGESTED FIX *** w:jvmtiCodeBlobEvents.cpp Tue Jan 18 17:01:24 2005 --- ./jvmtiCodeBlobEvents.cpp Thu Jan 20 10:35:24 2005 *************** *** 418,424 **** int bci = sd->bci(); if (bci != InvocationEntryBci) { assert(map_length < pcds_in_method, "checking"); ! map[map_length].start_address = (const void*)(intptr_t)pcd->pc_offset( ); map[map_length].location = bci; ++map_length; } --- 418,424 ---- int bci = sd->bci(); if (bci != InvocationEntryBci) { assert(map_length < pcds_in_method, "checking"); ! map[map_length].start_address = (const void*) pcd->real_pc(nm); map[map_length].location = bci; ++map_length; } ###@###.### 2005-1-20 12:42:50 GMT
20-01-2005