JDK-4656449 : VM crashes on shutdown
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2002-03-21
  • Updated: 2012-10-08
  • Resolved: 2002-04-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
1.4.1 hopperFixed
Related Reports
Relates :  
Relates :  
Description
The following program crashes during VM shutdown in about 5/1000 runs
with current main/baseline (03/21/02) on Linux:

-------------------------------------------------------
import java.io.*;

public class ShutdownTest extends Thread {
   public void run() {
     while (true) {
       ShutdownTest st = new ShutdownTest();
       if (st == null) {
         System.out.println("st == null");
       }
     }
   }

   public static void main(String args[]) {
     System.out.println("- ShutdownTest -");

     for(int i = 0; i < 4; i++) {
       ShutdownTest st = new ShutdownTest();
       st.setDaemon(true);
       st.start();
     }
   }
}
------------------------------------------------------

Error message:

Unexpected Signal : 11 occurred at PC=0x402A945D during VM shutdown
Function=type__C4Item+0x9
Library=/home/huanghui/jdk1.4.1/jre/lib/i386/client/libjvm.so

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

WORK AROUND Add "System.exit(0)" to the end of main function.
11-06-2004

EVALUATION The crash is due to my misunderstanding on how CompileBroker::wait_for_thread_to_block() works when rewriting the VM shutdown code. Unlike what I thought, the compiler threads are only stopped so long as the safepoint lasts. So if they are not stopped at the final safepoint, they can start to run again once the safepoint ends. One possible fix is to stop compiler threads at final safepoint (change Threads::destroy_vm()), an alternative is to not restart compiler threads when a safepoint ends (change CompileBroker::maybe_block()). ###@###.### 2002-03-21 Fixed by stopping compiler threads at final safepont. ###@###.### 2002-04-10
21-03-2002