JDK-4779324 : 1.4.1: CMS+ParNew crash with Garbage1 test case from HP
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 1.4.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: generic
  • Submitted: 2002-11-15
  • Updated: 2003-03-26
  • Resolved: 2003-03-26
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_03 03Fixed
Related Reports
Relates :  
Description
Name: ks84122			Date: 11/14/2002

Original description from HP:
----------------------------
Server and client debug VM (build 1.4.1-b21-debug, mixed mode) crashes when using -Xconcgc and -XX:+UseParNewGC options together on Solaris.

$ uname -a
SunOS hppdl694 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-4

$ jdk141_b21/jdk1.4.1/bin/java_g -XX:+UseParNewGC -Xconcgc -verbose:gc Garbage1 none
VM option '+UseParNewGC'
#
# HotSpot Virtual Machine Error, Internal Error
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1-b21-debug mixed mode)
#
# Fatal: must own lock CompactibleFreeListSpace._lock
#
# Error ID: /BUILD_AREA/jdk1.4.1/hotspot/src/share/vm/runtime/mutexLocker.cpp, 93 [ Patched ]
#
# Problematic Thread: prio=10 tid=0xb4448 nid=0x4 runnable
#
Dumping core....
Abort(coredump)


----------------------------
The source code of the test case is in the following:

// Garbage1.java
// java Garbage1 [none|before|after]
// Demonstration of the garbage collector and finalization

class Chair
{
  static boolean gcrun = false;
  static boolean f = false;
  static int created = 0;
  static int finalized = 0;
  int i;

  Chair()
  {
    i = ++ created;
        if((created % 10000) == 0)
          System.out.println("Created " + created);
  }

  protected void finalize()
  {
    if(!gcrun)
        {
      gcrun = true;
          System.out.println("Beginning to finalize after " + created +
                                                  " Chairs have been created");
        }
        if(i == 50000)
        {
      System.out.println("Finalizing Chair #300000, " + "Setting flag to" +
                                                  " stop Chair creation");
          f = true;
        }
        finalized ++;

        if(finalized >= created)
          System.out.println("All " + finalized + " finalized");
  }
}

public class Garbage1
{
  public static void main(String [] args)
  {
        int count = 1;
        long t1 = System.currentTimeMillis();
    if (args.length == 0)
        {
      System.err.println("Usage: \n" + "java Garbage1 before\n or:\n" +
                                                  "java Garbage1 after");
      return;
        }

        while(!Chair.f)
        {
      new Chair();
          new String("To take up space");
        //  if (count++ % 50000 == 0)
                // System.gc();
        }

        System.out.println("After all Chairs have been created:\n" +
        "total created = " + Chair.created +
        ", total finalized = " + Chair.finalized);

        if(args[0].equals("before"))
        {
      System.out.println("gc():");
          System.gc();
          System.out.println("runFinalization():");
          System.runFinalization();
        }
        System.out.println("bye!");
        if(args[0].equals("after"))
          System.runFinalizersOnExit(true);

        long t2 = System.currentTimeMillis();
        System.out.println("Finish: " + (t2-t1) + "ms" );
  }
}
(Review ID: 166982) 
======================================================================

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

WORK AROUND See workaround described in 4683022 of which this is a duplicate.
11-06-2004

EVALUATION this bug fix involves two bug fixes for customer: 4698056: CMS: +UseConcMarkSweepGC crashes debug VM on Windows 4683022: CMS: race during cms generation expansion when UseParNewGC Test case works with those two fixes in. reopen for tracking correct history information purpose. ###@###.### 2003-03-20
20-03-2003

SUGGESTED FIX see fix of 4698056 and 4683022. ###@###.### 2003-03-20
20-03-2003