GC Crash on Repeated Array Allocation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LJRT |
Confirmed
|
High
|
Unassigned |
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).
Backtrace:
#0 0x080687d9 in getsize (ptr=0x80d0f6c) at ../../.
#1 0x08069b51 in traverse_inc () at ../../.
#2 gc () at ../../.
#3 0x08069f45 in conclude_gc_cycle (size=100032, tmplate=0x8166bf4) at ../../.
#4 check_free_
#5 gc_new (size=100032, tmplate=0x8166bf4) at ../../.
#6 0x0806dfa0 in newJByteArray (__eFlag_
at ../../.
#7 0x08054529 in GCTest_
#8 0x0806bcc1 in ljrt_thread_start (arg=0xbffff31c) at ../../.
#9 0xb7fad955 in start_thread (arg=0xb7638b70) at pthread_
#10 0xb7f06e7e in clone () at ../sysdeps/
Changed in ljrt: | |
importance: | Undecided → High |
status: | New → Confirmed |
description: | updated |
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.