Menu

Crash when using float point mode...

Anonymous
2010-08-07
2013-04-25
  • Anonymous

    Anonymous - 2010-08-07

    …and 2 dimensional FLOAT arrays. This happens both in 3.1 and 2.02 .When the float array is single dimensional there's no problem.
    No prob in fixed point mode.

    ps. When i say crash i mean that the midlet does not start in wireless tool kit emulator and SJboy emulator.

     
  • Javier Santo Domingo

    I can't reproduce that error here. Could you please provide some source code with that problem? Just paste here a non-working piece of code and I'll check it.

    Thanks!

     
  • Anonymous

    Anonymous - 2010-08-08

    program testbug;

    var
    a                         : integer ;
    bug : array  of real ;  // <- crashes on floating point mode only
    //bug : array     of real ;      // <- never crashes

    begin
      DrawText('Hello world', 0, 0);
      Repaint;
      delay (20000)
    end.

    //Project Properies..
    //MIdlet type          : MIDP 2.0 Fullscreen
    //MIDP version    : MIDP2.0
    //Real numbers : Floating Point => crash IF multi dimensioned float array exists
    //                           : Fixed Point    => no problem

    i re-tested it last night both in 3.1 and 2.02 versions just to be sure  , and yes the bug is real , I get a blank screen if the program is compiled on Floating Point mode.

     
  • Javier Santo Domingo

    I see, I was not able to reproduce the bug since I was trying with same dimensions matrix:

    test: array[0..15,0..15] of real; // this works as expected
    

    and the problem only presents when the dimensions of the matrix are different:

    test: array[0..3,0..4] of real; // hangs out
    

    but from my tests comes up that it happens also with other complex types like "string" or "http", no matter the Real Numbers mode value.

    So it seems to be a problem with the "bidimentional array" support and not with the real type at all. It also turns out a simple temporary workaround: if your array is dimensioned to 10x8, just level it to 10x10 and you will get the midlet working. Ugly but effective by the moment heh.

    I'll investigate this issue in my free time this week hopefully, and will post the results of it here.

    Thanks for your report!

     
  • Javier Santo Domingo

    Well, finally this week I had some time to spend investigating what's going on here, and I have found it.

    Inspecting the bytecode generated I have found the problem was an out-of-bound access in the array's initialization loop of the complex type (Real, string, a custom "record" class, etc). It was trying to initialize the dimension 0 with the size of the dimension 1, and the dimension 1 with the size of dimension 0 (that's why it worked when the dimensions where the same size). Now it's fixed and it is included in the release I'm performing right now (MIDletPascal 3.1 CANDIDATE).

    Other topic that might be interesting to express here is the difference between "Fixed-point" and "Floating-point" behaviour of the Real type. That comes from the fact that in "Floating-point" the Real type it's a complex type linked to the Real-Java floating point library (to an old version of it btw). It has been distributed the 1.07 from MP 2 until the last MP version I had released weeks ago (MP 3,1 BETA) but Roar Lauritzsen has updated his floating point library up to version 1.13 during the last couple of years, so the update of that library in MP is an extra work I have performed for this new release, since he has updated some stuff that have impact in the speed of the calculations, and that means more speed for our midlets.

    So, please, to everyone reading this: if you find any bug about this topics (or anything else) please report it so I can fix it.

    Thanks again for your report!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.