Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4495990

VM crashes if a run method throws an expection in a finally block

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.3.1_07, 1.4.0
    • Fix Version/s: 1.3.1_10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      10
    • CPU:
      x86
    • OS:
      windows_nt, windows_2000

      Backports

        Description



        Name: rmT116609 Date: 08/23/2001


        java version "1.3.0"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
        Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

        This also happens with JDK 1.3.1, 1.4.0-beta-b65.

        VM crashes when running multi threaded application if a run method throws an
        exception in a finally block.

        A sample program that shows the problem follows:

        package untitled30;

        public class Application1 {
            boolean packFrame = false;

            /**Construct the application*/
            public Application1() {
            }
                
            void testThread(int size) {
                int i=0;
                while (i < size) {
                    TT tt = new TT();
                    tt.setLoop(i * 11);
                    tt.start();
                    i++;
                }
            }
            
            
            /**Main method*/
            public static void main(String[] args) {
                Application1 ap = new Application1();
                
                ap.testThread(100);
            }
            
            
            class TT extends Thread {
            
            
                    int loop=0;
                    
                    public void setLoop(int l) {
                        loop = l;
                    }
                    
                    public void run() {
                        int j =0;
                        try {
                            while (j < loop) {
                                if (j % 50 == 0)
                                    System.out.println("I am " + this + " " + j);
                                j++;
                            }

                        } catch (Exception e) {
                        
        } finally {
        System.out.println (" i die " + this);
        // the following throw can cause the VM to crash
                            try {
                                throw new Exception("Stack Cleanup");
                            } catch (Exception e) {
                            // Clean!
                            }
        }
                    }
            }
        }



        With JDK1.3.0:
        ----------

        I am Thread[Thread-17,5,main] 150
         i die Thread[Thread-17,5,main]
        #
        # HotSpot Virtual Machine Error, Internal Error
        # Please report this error at
        # http://java.sun.com/cgi-bin/bugreport.cgi
        #
        # Error ID: 43113F32554E54494D45110E4350500290
        #
        I am Thread[Thread-18,5,main] 0
        I am Thread[Thread-18,5,main] 50
        I am Thread[Thread-18,5,main] 100
        I am Thread[Thread-18,5,main] 150
         i die Thread[Thread-18,5,main]
        [error occured during error reporting]

        abnormal program termination


        With JDK1.3.1:
        -------------

        C:\>java Application1
         i die Thread[Thread-0,5,main]
        I am Thread[Thread-1,5,main] 0
        ----------------------------------
        ----------------------------------
        I am Thread[Thread-17,5,main] 100
        I am Thread[Thread-17,5,main] 150
         i die Thread[Thread-17,5,main]
        #
        # HotSpot Virtual Machine Error, Internal Error
        # Please report this error at
        # http://java.sun.com/cgi-bin/bugreport.cgi
        #
        # Error ID: 43113F32554E54494D45110E43505002D3
        #
        # Problematic Thread: prio=5 tid=0x777ad0 nid=0x138 runnable



        With JDK1.4.0-beta-b65:
        ----------------------

        C:\>java Application1
         i die Thread[Thread-0,5,main]
        I am Thread[Thread-1,5,main] 0
        -------------------------------
        --------------------------------
        I am Thread[Thread-36,5,main] 300
        I am Thread[Thread-36,5,main] 350
         i die Thread[Thread-36,5,main]
        #
        # HotSpot Virtual Machine Error, Internal Error
        # Please report this error at
        # http://java.sun.com/cgi-bin/bugreport.cgi
        #
        # Error ID: 43113F32554E54494D45110E4350500314
        #
        # Problematic Thread: prio=5 tid=0x00787ED0 nid=0x102 runnable
        #

        (Review ID: 130585)
        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                kbr Kenneth Russell (Inactive)
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: