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

java_g: Segmentation violation

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      fcs
    • CPU:
      x86
    • OS:
      windows_nt

      Backports

        Description



        Name: szC45993 Date: 12/13/99



         /net/sqesvr/vsn/testbase/testbase_nsk/src/nsk/arguments/args00125 test,
        which uses developing options, crashes java_g (java version "1.2.2"
        Java HotSpot(TM) Server VM (2.0rc1, mixed mode, debug build I))
        on WinNT (Pentium II, 350MHz, 128Mb RAM, Windows NT 4.0 Workstation).
        See log and sources below.

        TONGA'S LOG:
        ============
        [#] cd d:/zss/TONGA_WSs/ZSS_workdir/Administrator.NT.x86/args00125
        [#] f:/ld24/java/hotspot/jdk1.2.2/win32/bin/java_g -XX":"Flags=f:/ld24/java/zss/TONGA_WSs/testbase_js/src/nsk/arguments/args00125/gammarc.gammarc -verify args00125
        VM option '+PrintSymbolTableSizeHistogram'
        VM option '+PrintScopeTree'
        VM option '+DebugVtables'
        VM option '+PrintVtables'
        VM option '+PrintVtableStats'
        VM option '+TraceCreateZombies'
        Initializing: java/lang/Object
        Initializing: java/lang/Number
        Initializing: java/lang/Long
        Initializing: java/lang/Integer
        Initializing: java/lang/Short
        Initializing: java/lang/Byte
        Initializing: java/lang/Double
        Initializing: java/lang/Float
        Initializing: java/lang/Character
        Initializing: java/lang/Boolean

        ...

        Initializing: java/io/FilePermission$1
        Initializing: java/lang/RuntimePermission
        Initializing: args00125
        Initializing: java/lang/Long
        0: 1356128
        Initializing: MemoryObject
        1: 1336200
        2: 1316592
        3: 1296984
        4: 1277376
        Test passed.

         static void args00125.main(jobject) [1] + Done(139) f:/ld24/java/hotspot/jdk1.2.2/win32/bin/java_g -XX":"Flags=f:/ld24/java/zss/TONGA_WSs/testbase_js/src/nsk/arguments/args00125/gammarc.gammarc -verify args00125
          997 Segmentation violation f:/ld24/java/hotspot/jdk1.2.2/win32/bin/java_g
        [#] echo $?
        139
        [#]

        SOURCES:
        ========

        //--------------------- args00125.java:
        //args00125.java
        /* This test simply creates a series of circularly
         * linked memeory objects which should be able to be
         * GC'd
         */


        class MemoryObject
        {
            byte array[];
            MemoryObject next;
            MemoryObject previous;

            public MemoryObject(int size)
            {
                array = new byte[size];
            }
        }

        class args00125
        {
            static final int ARRAY_SIZE = 100;
            static final int OBJECT_SIZE = 10;
            static final int LOOP_COUNT = 5;
            static final int CIRCULARITY_SIZE = 3;

            static MemoryObject memoryArray[] = new MemoryObject[ARRAY_SIZE];

            public static void main(String args[])
            {
                for (int j = 0; j < LOOP_COUNT; j++)
                {
                    System.out.println(j + ": " + Runtime.getRuntime().freeMemory());
                    for (int i = 0; i < ARRAY_SIZE; i ++)
                    {
                        memoryArray[i] = new MemoryObject(OBJECT_SIZE);
                        makeCircular(memoryArray[i], CIRCULARITY_SIZE);
                    }
                }

                // if there's any memory left, let's assume it's okay
                System.out.println("Test passed.");

            }

            public static void makeCircular(MemoryObject mObj, int depth)
            {
        MemoryObject tmpObj = mObj;

                for (int i = 0; i < depth; i++)
                {
                    tmpObj.next = new MemoryObject(OBJECT_SIZE);
                    tmpObj= tmpObj.next;
                }
        tmpObj.next = mObj;
            }

            public static void confirmCircular(MemoryObject mObj)
            {
        int count = 0;
        MemoryObject mObj2 = mObj;
        while (mObj2.next != mObj)
        {
        count++;
        mObj2 = mObj2.next;
        }
        System.out.println("Circularity level: " + count);
            }
        }
        //---------------------



        #--------------------- gammarc.gammarc:
        +PrintSymbolTableSizeHistogram
        +PrintScopeTree
        +DebugVtables
        +PrintVtables
        +PrintVtableStats
        +TraceCreateZombies
        #---------------------


        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                tcramersunw Timothy Cramer (Inactive)
                Reporter:
                zsssunw Zss Zss (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: