GC Crash on Repeated Array Allocation

Bug #878860 reported by Jesper Öqvist on 2011-10-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

The GC crashes (with default GC algorithm) on the second test in the test-program "gctest":

The relevant part of this program is:

for (int i = 0; i < LIMIT; ++i) {
 byte[] a = new byte[BYTES];

LIMIT and BYTES are rather large (1000000 and 100000 respectively).

#0 0x080687d9 in getsize (ptr=0x80d0f6c) at ../../../..//gc/gci_common.c:71
#1 0x08069b51 in traverse_inc () at ../../../..//gc/gc_incremental_ms.c:243
#2 gc () at ../../../..//gc/gc_incremental_ms.c:431
#3 0x08069f45 in conclude_gc_cycle (size=100032, tmplate=0x8166bf4) at ../../../..//gc/gc_incremental_ms.c:515
#4 check_free_mem_or_do_gc (size=100032, tmplate=0x8166bf4) at ../../../..//gc/gc_incremental_ms.c:627
#5 gc_new (size=100032, tmplate=0x8166bf4) at ../../../..//gc/gc_incremental_ms.c:707
#6 0x0806dfa0 in newJByteArray (__eFlag__=0xb763837c, size=100000)
    at ../../../..//javalib/native/pthread/../common/javatypes.c:191
#7 0x08054529 in GCTest_main_java_lang_StringA (__eFlag__=0xb763837c, gc_param_args=0xb7638374) at GCTest.c:805
#8 0x0806bcc1 in ljrt_thread_start (arg=0xbffff31c) at ../../../..//javalib/native/pthread/ljrt_threading.c:663
#9 0xb7fad955 in start_thread (arg=0xb7638b70) at pthread_create.c:300
#10 0xb7f06e7e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Changed in ljrt:
importance: Undecided → High
status: New → Confirmed
description: updated
Jesper Öqvist (jesper-oqvist) wrote :

The bug seems to be caused by the new array root references being pushed before the array objects have been initialized. The repeated array allocations force a GC cycle right after the new array reference has been pushed.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers