harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r588713 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp
Date Fri, 26 Oct 2007 17:08:17 GMT
Author: gshimansky
Date: Fri Oct 26 10:08:16 2007
New Revision: 588713

URL: http://svn.apache.org/viewvc?rev=588713&view=rev
Log:
Applied VM side fix for HARMONY-5019
[jdktools][jpda] Agent has to ensure that all of its threads are terminated when Agent_OnUnload
exits


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp?rev=588713&r1=588712&r2=588713&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp Fri Oct 26 10:08:16 2007
@@ -234,6 +234,14 @@
     // prepare thread manager to shutdown
     hythread_shutdowning();
 
+    // Call Agent_OnUnload() for agents and unload agents.
+    // Gregory -
+    // We cannot call this function after vm_shutdown_stop_java_threads!!!
+    // In this case agent's thread won't be shutdown properly, and the
+    // code of agent's thread will run in unmapped address space
+    // of unloaded agent's library. This is bad and will almost certainly crash.
+    java_vm->vm_env->TI->Shutdown(java_vm);
+
     // Stop all (except current) java threads
     // before destroying VM-wide data.
     vm_shutdown_stop_java_threads(java_vm->vm_env);
@@ -251,9 +259,6 @@
     // Shutdown signals
     extern void shutdown_signals();
     shutdown_signals();
-
-    // Call Agent_OnUnload() for agents and unload agents.
-    java_vm->vm_env->TI->Shutdown(java_vm);
 
     // Block thread creation.
     // TODO: investigate how to achieve that with ThreadManager



Mime
View raw message