From ab1614e29962f987b1aa84db27be8ffb7038e91a Mon Sep 17 00:00:00 2001 From: poonam Date: Sun, 15 Mar 2009 18:11:46 -0700 Subject: [PATCH] 6812971: SA: re-attaching to process fails Summary: After attaching, de-attaching SA from a process, the second time attach() call fails. This happens because in VM.initialize(), Universe does not get re-initialized before it is accessed. Reviewed-by: swamyv --- agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index 0272c0693..8f176f2f5 100644 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -342,11 +342,13 @@ public class VM { throw new RuntimeException("Attempt to initialize VM twice"); } soleInstance = new VM(db, debugger, debugger.getMachineDescription().isBigEndian()); - debugger.putHeapConst(Universe.getHeapBase(), soleInstance.getHeapOopSize(), - soleInstance.logMinObjAlignmentInBytes); + for (Iterator iter = vmInitializedObservers.iterator(); iter.hasNext(); ) { ((Observer) iter.next()).update(null, null); } + + debugger.putHeapConst(Universe.getHeapBase(), soleInstance.getHeapOopSize(), + soleInstance.logMinObjAlignmentInBytes); } /** This is used by the debugging system */ -- GitLab