JDK-5053217 : VM segv's running jvmti/jvmpi profiler
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-05-26
  • Updated: 2004-06-25
  • Resolved: 2004-06-15
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
1.4.2_06 06Fixed
Description
This test case came from escalation 1-728488 and was seen with 1.4.2.
It is similar to bug 4614956 which was a crash caused by the interpreter. This
bug is -server only. Run the attached test case with

java -server -XX:+ShowMessageBoxOnError -Xrunmyprofiler LargeHeapTest 100000

and hit <return> whenever the program stops. It should segv. quickly.


Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.2_06 generic tiger-rc FIXED IN: 1.4.2_06 tiger-rc INTEGRATED IN: 1.4.2_06 tiger-b56 tiger-rc
08-07-2004

SUGGESTED FIX - #pragma ident "@(#)generateOptoStub.cpp 1.84 04/02/04 17:34:30 JVM" + #pragma ident "@(#)generateOptoStub.cpp 1.85 04/06/08 13:02:38 JVM" #endif // // Copyright 2004 Sun Microsystems, Inc. All rights reserved. // SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. // #include "incls/_precompiled.incl" #include "incls/_generateOptoStub.cpp.incl" //-----------------------plus_adr---------------------------------------------- *** 93,112 **** --- 93,119 ---- static_klass = method->holder(); ciInstance* mirror = static_klass->java_mirror(); mirror_node = makecon(TypeInstPtr::make(mirror)); assert(jni_sig, "sanity"); // Static JNI calls pass the static_klass mirror. They need it // boxed. The box has to update the stack prior to setting // thread_in_native in order to be GC safe. mirror_box = _gvn.transform( new (2) BoxNode(mirror_node) ); } + // Call jvmpi before we wrap incoming arguments so we can + // pass the receiver as an oop and not a handle. + + if (C->need_jvmpi_method_event()) { + make_jvmpi_method_entry(); + } + // Do we need to wrap incoming arguments in handles? // Generate code to put the oop on the stack and return its address. Node *unwrapped_this = map()->in(TypeFunc::Parms+0); Node** parm_boxes = NULL; uint num_parm_boxes = 0; if( wrap_oops ) { parm_boxes = NEW_RESOURCE_ARRAY(Node*, parm_cnt); // generous, OK! for( i = TypeFunc::Parms; i < parm_cnt; i++ ) { if (jdomain->field_at(i)->isa_oop_ptr()) { // Replace parameter with handle *** 129,151 **** --- 136,155 ---- // with a conditional-move, the c-mov represents a normal use // along the main path and so unavoidably hoists the BoxNode. Node* cmp = _gvn.transform( new (3) CmpPNode(map()->in(i), null()) ); Node* b = _gvn.transform( new (2) BoolNode(cmp, BoolTest::eq) ); Node* cmov = _gvn.transform( CMoveNode::make(NULL, b, box, map()->in(i), TypeRawPtr::BOTTOM) ); map()->set_req( i, cmov ); } } } if (C->need_jvmpi_method_event()) { make_jvmpi_method_entry(); } Node* flock_obj = NULL; Node* flock_obj_box = NULL; FastLockNode* flock = NULL; // Do we need to lock argument 0? Is this a synchronized native call? if (method != NULL && method->flags().is_synchronized()) { // Lock either the class-mirror or the regular 'this' pointer flock_obj = static_klass ? mirror_node : unwrapped_this; flock_obj_box = static_klass ? mirror_box : parm_boxes[0]; flock = shared_lock(flock_obj);
08-07-2004

EVALUATION This is a bug in passing the receiver to the jvmti/jvmpi agent when calling a native method. We pass a handle instead of an oop. ###@###.### 2004-05-26
26-05-2004