Menu

#37 Luaj 2.0.3 works, but 3.0 does not

v3.0-beta1
closed-fixed
nobody
None
5
2015-05-01
2014-08-07
No

On Cinterion TC65i JME platform, luaj 2.0.3 works. After switching to 3.0, the following error started appearing:

JAVA ERROR: Unrecoverable error in MIDlet.startApp() java.lang.Error: 137

java.lang.Error: 137
- org.luaj.vm2.LuaTable$Entry.find(), bci=2
- org.luaj.vm2.LuaTable.hashset(), bci=47
- org.luaj.vm2.LuaTable.rawset(), bci=22
- org.luaj.vm2.LuaTable.set(), bci=57
- org.luaj.vm2.LuaValue.set(), bci=6
- org.luaj.vm2.lib.BaseLib.call(), bci=49
- org.luaj.vm2.LuaValue.load(), bci=5
- org.luaj.vm2.lib.jme.JmePlatform.standardGlobals(), bci=16
- org.pictus.jean.Jean.initApp(), bci=338
- org.pictus.jean.Jean.startApp(), bci=46
- javax.microedition.midlet.Main.run(), bci=3

The following statement is enough for the error to occur:

Globals globals = JmePlatform.standardGlobals();

The error seems to happen in src/core/org/luaj/vm2/LuaTable.java in the StrongSlot find(LuaValue) method of the "Entry" class.

Discussion

  • Rostislav Opocensky

    I have found that this issue can be solved by the following patch:

    --- luaj-3.0-orig/src/core/org/luaj/vm2/LuaTable.java   2014-07-06 07:12:00.000000000 +0200
    +++ luaj-3.0/src/core/org/luaj/vm2/LuaTable.java        2014-08-20 19:24:18.446361030 +0200
    @@ -1133,6 +1133,10 @@
                    public Slot relink( Slot rest ) {
                            return ( rest != null ) ? new LinkSlot( this, rest ) : (Slot)this;
                    }
    +
    +               public abstract boolean keyeq( LuaValue key );
    +
    +               public abstract int keyindex( int hashMask );
            }
    
            static class NormalEntry extends Entry {
    

    I am no expert in Java. (This is why I need Lua :-) So I cannot tell if it is an error to omit the keyeq() and keyindex() methods in the abstract class. However, after adding them as shown above the code executes correctly on my JME platform.

     

    Last edit: Rostislav Opocensky 2014-08-20
  • James Roseborough

    Applying this patch for version 3.0.1, however, I have no way to reproduce this so can't verify that it is really fixed.

     
  • James Roseborough

    • status: open --> pending-fixed
     
  • James Roseborough

    • status: pending-fixed --> closed-fixed
     
  • James Roseborough

    Is fixed in version 3.0.1.

     

Log in to post a comment.