JDK-4926491 : To fix dtrace after sharing is putback
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-09-23
  • Updated: 2012-10-08
  • Resolved: 2003-11-19
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
5.0 b29Fixed
Related Reports
Relates :  
Description
dtrace support will not work after sharing is putback,
so there will be a need to make it working again.

For details, please, see Ken's email bellow:

Date: Mon, 22 Sep 2003 13:28:55 -0700
From: Kenneth Russell <###@###.###>
Subject: Re: sharing wrt dtrace
To: Serguei Spitsyn <###@###.###>
Cc: ###@###.###, Sundar <###@###.###>

Fred's made the needed changes so the files compile but they won't work yet.
The bug ID under which we will be checking in the class data sharing code is

4416624: multiple JVM runtimes do not share memory between themselves

The sharing putback makes changes to several data structures but I think the
only relevant change for the dtrace code is that methodOops have been split
into two pieces, the read-write portion (still called methodOop) and the
read-only portion (called constMethodOop). The constMethodOop contains the
unchanging data including the bytecodes. The read-write methodOop points to
the constMethodOop and the frame points to the read-write methodOop. There is
a webrev of the current code at
http://analemma.sfbay/net/animorphic/export/kbr/webrevs/class_data_sharing/2/
though we're going to do some cleanup of the SCCS deltas before sending it
out for broader review in a day or so.

-Ken

###@###.### 2003-09-22

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b29 tiger-beta
14-06-2004

EVALUATION ###@###.### 2003-11-03 New JvmOffsets constants have to be introduced/renamed and used consistently: methodOopDesc_constMethod constMethodOopDesc_flags constMethodOopDesc_code_size constMethodOopDesc_name_index constMethodOopDesc_signature_index constMethodOopDesc_has_linenumber_table The fixes effect the following files in the dtrace directory: generateJvmOffsets.cpp, libjvm_db.c, jhelper.d Some changes are already integrated as part of sharing support putback. Others are still to be implemented.
11-06-2004

SUGGESTED FIX ###@###.### 2003-11-03 Suggested fix corresponds to that described in Evaluation. The fix effects the following files in the src/os/solaris/dtrace directory: generateJvmOffsets.cpp, libjvm_db.c, jhelper.d Changes for generateJvmOffsets.cpp and libjvm_db.c were prepared by Tom. % sccs sccsdiff -c -r1.10 -r1.11 generateJvmOffsets.cpp ------- generateJvmOffsets.cpp ------- *** /tmp/geta506977 Mon Nov 3 15:24:06 2003 --- /tmp/getb506977 Mon Nov 3 15:24:06 2003 *************** *** 198,216 **** printf("\n"); GEN_VALUE(AccessFlags_NATIVE, JVM_ACC_NATIVE); ! GEN_VALUE(AccessFlags_HAS_LINE_NUMBER_TABLE, JVM_ACC_HAS_LINE_NUMBER_TABLE); GEN_OFFSET(AccessFlags, _flags); GEN_OFFSET(symbolOopDesc, _length); GEN_OFFSET(symbolOopDesc, _body); printf("\n"); GEN_OFFSET(methodOopDesc, _constants); GEN_OFFSET(methodOopDesc, _access_flags); printf("\n"); GEN_OFFSET(constMethodOopDesc, _name_index); GEN_OFFSET(constMethodOopDesc, _signature_index); - GEN_OFFSET(constMethodOopDesc, _code_size); printf("\n"); GEN_OFFSET(CodeHeap, _memory); --- 198,218 ---- printf("\n"); GEN_VALUE(AccessFlags_NATIVE, JVM_ACC_NATIVE); ! GEN_VALUE(constMethodOopDesc_has_linenumber_table, constMethodOopDesc::_has_linenumber_table); GEN_OFFSET(AccessFlags, _flags); GEN_OFFSET(symbolOopDesc, _length); GEN_OFFSET(symbolOopDesc, _body); printf("\n"); + GEN_OFFSET(methodOopDesc, _constMethod); GEN_OFFSET(methodOopDesc, _constants); GEN_OFFSET(methodOopDesc, _access_flags); printf("\n"); + GEN_OFFSET(constMethodOopDesc, _flags); + GEN_OFFSET(constMethodOopDesc, _code_size); GEN_OFFSET(constMethodOopDesc, _name_index); GEN_OFFSET(constMethodOopDesc, _signature_index); printf("\n"); GEN_OFFSET(CodeHeap, _memory); % sccs sccsdiff -c -r1.11 -r1.12 jhelper.d ------- jhelper.d ------- *** /tmp/geta507012 Mon Nov 3 15:30:36 2003 --- /tmp/getb507012 Mon Nov 3 15:30:36 2003 *************** *** 109,116 **** copyin_offset(OFFSET_symbolOopDesc_length); copyin_offset(OFFSET_symbolOopDesc_body); copyin_offset(OFFSET_methodOopDesc_constants); ! copyin_offset(OFFSET_methodOopDesc_name_index); copyin_offset(OFFSET_CodeHeap_memory); copyin_offset(OFFSET_CodeHeap_segmap); --- 109,117 ---- copyin_offset(OFFSET_symbolOopDesc_length); copyin_offset(OFFSET_symbolOopDesc_body); + copyin_offset(OFFSET_methodOopDesc_constMethod); copyin_offset(OFFSET_methodOopDesc_constants); ! copyin_offset(OFFSET_constMethodOopDesc_name_index); copyin_offset(OFFSET_CodeHeap_memory); copyin_offset(OFFSET_CodeHeap_segmap); *************** *** 388,396 **** /!this->done && this->methodOop/ { MARK_LINE; ! this->nameIndex = copyin_uint16(this->methodOopPtr + ! this->OFFSET_methodOopDesc_name_index); this->constantPool = copyin_ptr(this->methodOopPtr + this->OFFSET_methodOopDesc_constants); --- 389,400 ---- /!this->done && this->methodOop/ { MARK_LINE; ! this->constMethod = copyin_ptr(this->methodOopPtr + ! this->OFFSET_methodOopDesc_constMethod); + this->nameIndex = copyin_uint16(this->constMethod + + this->OFFSET_constMethodOopDesc_name_index); + this->constantPool = copyin_ptr(this->methodOopPtr + this->OFFSET_methodOopDesc_constants); % sccs sccsdiff -c -r1.11 -r1.12 libjvm_db.c ------- libjvm_db.c ------- *** /tmp/geta506996 Mon Nov 3 15:27:20 2003 --- /tmp/getb506996 Mon Nov 3 15:27:20 2003 *************** *** 437,442 **** --- 437,443 ---- short nameIndex; short signatureIndex; uint64_t constantPool; + uint64_t constMethod; uint64_t nameSymbol; uint64_t signatureSymbol; uint64_t klassPtr; *************** *** 451,459 **** err = read_pointer(J, methodOopPtr + OFFSET_methodOopDesc_constants, &constantPool); CHECK_FAIL(err); /* To get name string */ ! err = ps_pread(J->P, methodOopPtr + OFFSET_constMethodOopDesc_name_index, &nameIndex, 2); CHECK_FAIL(err); err = read_pointer(J, constantPool + nameIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &nameSymbol); CHECK_FAIL(err); --- 452,462 ---- err = read_pointer(J, methodOopPtr + OFFSET_methodOopDesc_constants, &constantPool); CHECK_FAIL(err); + err = read_pointer(J, methodOopPtr + OFFSET_methodOopDesc_constMethod, &constMethod); + CHECK_FAIL(err); /* To get name string */ ! err = ps_pread(J->P, constMethod + OFFSET_constMethodOopDesc_name_index, &nameIndex, 2); CHECK_FAIL(err); err = read_pointer(J, constantPool + nameIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &nameSymbol); CHECK_FAIL(err); *************** *** 464,470 **** CHECK_FAIL(err); /* To get signature string */ ! err = ps_pread(J->P, methodOopPtr + OFFSET_constMethodOopDesc_signature_index, &signatureIndex, 2); CHECK_FAIL(err); err = read_pointer(J, constantPool + signatureIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &signatureSymbol); CHECK_FAIL(err); --- 467,473 ---- CHECK_FAIL(err); /* To get signature string */ ! err = ps_pread(J->P, constMethod + OFFSET_constMethodOopDesc_signature_index, &signatureIndex, 2); CHECK_FAIL(err); err = read_pointer(J, constantPool + signatureIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &signatureSymbol); CHECK_FAIL(err); *************** *** 661,667 **** uint64_t buffer; uint16_t code_size; uint64_t code_end_delta; ! int32_t access_flags; int32_t best_bci = 0; int32_t stream_bci = 0; int32_t stream_line = 0; --- 664,671 ---- uint64_t buffer; uint16_t code_size; uint64_t code_end_delta; ! uint64_t constMethod; ! int8_t access_flags; int32_t best_bci = 0; int32_t stream_bci = 0; int32_t stream_line = 0; *************** *** 675,687 **** name, vf->bci); } vf->line = 0; ! err = ps_pread(J->P, ! vf->methodOop + OFFSET_methodOopDesc_access_flags + OFFSET_AccessFlags_flags, ! &access_flags, SZ32); CHECK_FAIL(err); ! if (!(access_flags & AccessFlags_HAS_LINE_NUMBER_TABLE)) { if (debug > 2) fprintf(stderr, "\t line_number_from_bci: END: !HAS_LINE_NUMBER_TABLE \n\n"); return PS_OK; --- 679,692 ---- name, vf->bci); } + err = read_pointer(J, vf->methodOop + OFFSET_methodOopDesc_constMethod, &constMethod); + CHECK_FAIL(err); + vf->line = 0; ! err = ps_pread(J->P, constMethod + OFFSET_constMethodOopDesc_flags, &access_flags, sizeof(int8_t)); CHECK_FAIL(err); ! if (!(access_flags & constMethodOopDesc_has_linenumber_table)) { if (debug > 2) fprintf(stderr, "\t line_number_from_bci: END: !HAS_LINE_NUMBER_TABLE \n\n"); return PS_OK; *************** *** 691,702 **** * Not necessarily sorted and not necessarily one-to-one. */ ! err = ps_pread(J->P, vf->methodOop + OFFSET_constMethodOopDesc_code_size, &code_size, SZ16); CHECK_FAIL(err); /* inlined_table_start() */ code_end_delta = (uint64_t) (access_flags & AccessFlags_NATIVE) ? 2*POINTER_SIZE : 0; ! buffer = vf->methodOop + (uint64_t) SIZE_methodOopDesc + (uint64_t) code_size + code_end_delta; if (debug > 2) { fprintf(stderr, "\t\t line_number_from_bci: methodOop: %#llx, native: %d\n", --- 696,707 ---- * Not necessarily sorted and not necessarily one-to-one. */ ! err = ps_pread(J->P, constMethod + OFFSET_constMethodOopDesc_code_size, &code_size, SZ16); CHECK_FAIL(err); /* inlined_table_start() */ code_end_delta = (uint64_t) (access_flags & AccessFlags_NATIVE) ? 2*POINTER_SIZE : 0; ! buffer = constMethod + (uint64_t) SIZE_constMethodOopDesc + (uint64_t) code_size + code_end_delta; if (debug > 2) { fprintf(stderr, "\t\t line_number_from_bci: methodOop: %#llx, native: %d\n", *************** *** 969,979 **** size_t size, Jframe_t *jframe ) { ! uint64_t bci = is_bci(bcx) ? bcx : bcx - (methodOop + (uint64_t) SIZE_methodOopDesc); Vframe_t vframe = {0}; Vframe_t *vf = &vframe; int32_t err; if (debug) fprintf(stderr, "\t name_for_imethod: BEGIN: methodOop: %#llx\n", methodOop); --- 974,990 ---- size_t size, Jframe_t *jframe ) { ! uint64_t bci; ! uint64_t constMethod; Vframe_t vframe = {0}; Vframe_t *vf = &vframe; int32_t err; + err = read_pointer(J, methodOop + OFFSET_methodOopDesc_constMethod, &constMethod); + CHECK_FAIL(err); + + bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_constMethodOopDesc); + if (debug) fprintf(stderr, "\t name_for_imethod: BEGIN: methodOop: %#llx\n", methodOop); ss45998@tomsk
11-06-2004