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

java_g -XX:+CheckMemoryInitialization crash in collectedHeap.inline.hpp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Other
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.1
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      hopper
    • CPU:
      generic
    • OS:
      solaris_2.6

      Description

      ###@###.### 04/15/2002

      The test case below results in a hotspot crash when run with
      java_g -XX:+CheckMemoryInitialization. Reproducible with the
      most recent 1.4.1 build: 1.4.1 beta-b08-debug, solaris 7

      Description from HP:
      ===================

      To reproduce compile and run:

      import java.io.*;
      public class TestGC64
      {
        static byte[] mybuf = new byte[15000];
        static int counter = 0;
        static void doWrite()
        {
          ++ counter;
          //mybuf = new byte[15000000]; mybuf = new byte[15000000]; mybuf = null;
          //while (true) {
              //mybuf = new byte[15000]; mybuf = new byte[15000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              mybuf = new byte[15000000]; mybuf = null;
              //System.out.print("x ");
              System.err.print(counter + " ");
          //}
          doWrite();
        }
        public static void main(String[] args)
        {
          try { System.gc(); doWrite(); }
          catch (java.lang.StackOverflowError e3)
          { System.out.println("WORKED"); }
        }
      }


      Most of the code not having direct impact have been commented out. Infact I was able to reproduce the problem with just a System.gc() in the program and nothing else.

      I get the following abort.

      --------------------------------------------------------------------
      VM option '+CheckMemoryInitialization'
      VM option '+ZapUnusedHeapArea'
      #
      # HotSpot Virtual Machine Error, assertion failure
      # Please report this error at
      # http://java.sun.com/cgi-bin/bugreport.cgi
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.0-b92-debug mixed mode)
      #
      # assert((*(intptr_t*) (result + slot)) == ((intptr_t) badHeapWordVal), "initialized memory")
      #
      # Error ID: /export/home3/jdk/jdk1.4/ws/hotspot/src/share/vm/memory/collectedHeap.inline.hpp, 93 [ Patched ]
      #
      # Problematic Thread: prio=5 tid=0x3d580 nid=0x1 runnable
      #
      Dumping core....
      --------------------------------------------------------------------

      Initially I ran into this problem with 64 bit and verified that 32 bit fails too.

      badHeapWordVal is defined as 0xBAADBABE in globalDefinitions.hpp.
      But for 64 bit mode it should be 0xBAADBABEBAADBABE. I fixed this place and execution continued and hit another similar assert.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jmcilreesunw James Mcilree (Inactive)
              Reporter:
              ksoshals Kirill Soshalskiy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: