BZ #116: Segfault when creating multidimensional arry via reflection on OpenJDK

Status fields:

creation_ts:2008-12-12 18:16
component:vm
version:unspecified
rep_platform:All
op_sys:All
bug_status:RESOLVED
resolution:FIXED
reporter:michi@complang.tuwien.ac.at
When instantiating a new multidimensional array (more than 1 dimension) via reflection,
the VM segfaults. Note that this only happens with OpenJDK. This can be easily
reproduced by invoking the following:

java.lang.reflect.Array.newInstance(Foo.class, new int {23, 42})

The problem is, that JVM_NewMultiArray does not create the proper array class. I am
going to write a regression test for this one and fix it with the array access classes.

Comment #1 by michi@complang.tuwien.ac.at on 2008-12-12 18:43:55

As promised I added a regression test. Note that the test only checks some simple
assertions and can not serve as a full test of JVM_NewMultiArray, but it clearly detects
the segfault. Here is the test:

http://mips.complang.tuwien.ac.at/hg/cacao/rev/16a3c3f62de7

Comment #2 by michi@complang.tuwien.ac.at on 2008-12-15 22:20:49

This fixes the problem:

http://mips.complang.tuwien.ac.at/hg/cacao/rev/1be45ed2b11c