BZ #89: VM crash when invoking method that return float from reflection code

Status fields:

creation_ts:2008-07-08 10:33
component:reflection
version:0.98
rep_platform:arm
op_sys:Linux
bug_status:RESOLVED
resolution:FIXED
reporter:tanarat1@hotmail.com
Recently, I tried to invoke a method that return float using reflection API and the VM
crashes. The following is what I have tested.

/** CODE BEGINS HERE **/
public class CacaoFloatBug {

     public static void main(String[] args) {
          try {
               Class cls = Class.forName("CacaoFloatBug$FloatReflect");
               CacaoFloatBug floatBug = new CacaoFloatBug();
               FloatReflect floatReflect = floatBug.new FloatReflect();
               Method mth = cls.getMethod("returnFloat", null);
               Float retFloatValue = (Float) mth.invoke(floatReflect, null);
               System.out.println("Returned Value is " + retFloatValue);
          } catch (Exception e) {
               e.printStackTrace();
          }
     }

     public class FloatReflect {
          public FloatReflect() {
          }

          public float returnFloat() {
               float ret = 1.0f;
               return ret;
          }

     }

}
/** CODE ENDS HERE **/

The following is the error message that I got

===> i am going to exit after this debugging message!
got asm_debug(0x51, 0x5f6ee8, (nil), 0x7b0bb8)
LOG: [0x4001c820] leave you now
Aborted

The version of Cacao that I used was 0.98+hg20071001-r6
The version of classpath was 0.97.1-r1
I run above script on Nokia N800 internet tablet with latest OS2008(Diablo)

Comment #1 by twisti@complang.tuwien.ac.at on 2008-07-08 11:05:55

I added a regression test:

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

Comment #2 by twisti@complang.tuwien.ac.at on 2008-07-08 11:19:58

$ java -cp junit4-4.3.1.jar:. org.junit.runner.JUnitCore PR89
JUnit version 4.3.1
..
Time: 0.18

OK (2 tests)

The fix was trivial:

http://mips.complang.tuwien.ac.at/hg/cacao/rev/977d67511f9c

Maybe we only had the check in there because we never had a testcase.  This changeset is
applied to default and cacao-1.0.x branch and will be included in the 0.99.2 release.