JDK-6500147 : VM SIGSEGV in GC: generation collection for allocation, mode: safepoint
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: linux
  • CPU: x86
  • Submitted: 2006-12-04
  • Updated: 2011-02-16
  • Resolved: 2007-04-23
Description
FULL PRODUCT VERSION :
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
also seen on 1.5.0_09

FULL OS VERSION :
2.6.15-27-686 #1 SMP PREEMPT Sat Sep 16 02:13:27 UTC 2006 i686 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
Mobile Intel(R) Celeron(R) CPU 2.40GHz

A DESCRIPTION OF THE PROBLEM :
Our  application as well as our test programm have shows several chrashes of the JVM which seen to be GC related. The VM crashes randomly after some time. While our main application did not put heavy load on the VM it seems to been easier to reproduce it with heavy memory load.
The following hs_err output is the resulot of the latest crash of the test program.
  See also:
http://jroller.com/page/dschneller?entry=java_5_random_vm_crashes

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test application and wait. In our test it sometimes took hours or days to get a crash.
Our last test was running 4 instances of the following command:
java -verbose:gc GCTest 20 40000
(creates 20 threads which continously allocate up to 40000 KB)
One of them crashed after 28 hrs of cpu time.


EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
JVM runs without crash infinitely

Actual:
JVM crashes after some time.
We always see messages similar to
"VM_Operation (0xb182fc64): generation collection for allocation, mode: safepoint, requested by thread 0xb1504ff0"

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Stacktrace attached seperatly

REPRODUCIBILITY :
This bug can be reproduced often.

---------- BEGIN SOURCE ----------
import java.util.Random;


public class GCTest {

    private static Thread[] threads;
    static Random tRandom;
    static int tKbPerAlloc;

    private static class MyRunnable implements Runnable {


        public void run() {
            while (true) {
                try {
                    Thread.sleep(200+tRandom.nextInt(200));
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                int tSize = tRandom.nextInt(tKbPerAlloc * 1024);
                System.out.println(Thread.currentThread().getName() + ": Allocating " + tSize / 1024 + "kbytes");
                byte[] tBytes = new byte[tSize];
            }
        }
    }

    public static void main(String[] args) {
        if (args.length != 2) {
            System.out.println("Options must be a number of threads and a maximum allocation size in kb");
        }
        int tNumThreads = Integer.parseInt(args[0]);
       tKbPerAlloc = Integer.parseInt(args[1]);
       tRandom = new Random();
        threads = new Thread[tNumThreads];
        for (int i = 0; i < tNumThreads; i++) {
            threads[i] = new Thread(new GCTest.MyRunnable(), "MemFiller_" + i);
            threads[i].start();
        }

        while (true) {
            for (int i = 0; i < threads.length; i++) {
                if (!threads[i].isAlive()) {
                    threads[i] = new Thread(new GCTest.MyRunnable(), "MemFiller_r" + i);
                    threads[i].start();
                }
            }

        }
    }
}
---------- END SOURCE ----------

Comments
EVALUATION Subject: Re: [Fwd: Re: [Fwd: Re: Bug#6500147]] Date: Thu, 05 Apr 2007 09:51:07 -0400 From: Manuel Darveau <###@###.###> To: Peter B. Kessler <###@###.###> CC: Eric Arseneau <###@###.###> Hi, after months of tests, we managed to prove that the RAM brand we used was defective with our board. The problem is now solved. Thank you so much for your help. Without the information you provided it would have been very difficult to prove that the software was not causing the crash. Again, thank you very much for your help. Manuel Darveau - Software engineer Miranda technologies inc. Head office, Montreal, Qc
22-04-2007