[Kaffe] Illegal Instruction generated by kaffe JIT?

Moses DeJong dejong at cs.umn.edu
Mon Mar 29 03:27:03 PST 1999


On Thu, 25 Mar 1999, Godmar Back wrote:

> > 
> > On 25 Mar 1999, Alexandre Oliva wrote:
> > 
> > > On Mar 24, 1999, Moses DeJong <dejong at cs.umn.edu> wrote:
> > > 
> > > > When I do that I get an error like this.
> > > 
> > > > (gdb) findNativeMethod 0x276954
> > > > Cannot access memory at address 0x54.
> > > 
> > > This usually means the address you have provided is not associated
> > > with any JIT-compiled method, but I may be wrong.  Try the new, much
> > > simpler version I'm installing right now.  It also introduces JITwhere
> > 
> > 
> > I tried that with no luck. Here is the output I am getting.
> > 
> > (gdb) source gdbinit
> > (gdb) bt      
> > #0  0x730074 in ?? ()
> > #1  0x14f3ec in ?? ()
> > #2  0x4eec0c in ?? ()
> > #3  0x5097ec in ?? ()
> > #4  0x4fc880 in ?? ()
> > #5  0x508894 in ?? ()
> > #6  0x4efe90 in ?? ()
> > #7  0x257820 in ?? ()
> > #8  0x258604 in ?? ()
> > #9  0x256388 in ?? ()
> > #10 0x258460 in ?? ()
> > #11 0x24c10c in ?? ()
> > #12 0x1a0d74 in ?? ()
> > #13 0x49e364 in ?? ()
> > #14 0x257820 in ?? ()
> > #15 0x258604 in ?? ()
> > #16 0x24c10c in ?? ()
> > #17 0x1a0d74 in ?? ()
> > #18 0x2e2544 in ?? ()
> > #19 0x257820 in ?? ()
> > #20 0x258604 in ?? ()
> > #21 0x256388 in ?? ()
> > #22 0x258460 in ?? ()
> > #23 0x46210c in ?? ()
> > #24 0x257820 in ?? ()
> > #25 0x258604 in ?? ()
> > #26 0x24c10c in ?? ()
> > #27 0x3239dc in ?? ()
> > #28 0x39f31c in ?? ()
> > #29 0x257820 in ?? ()
> > #30 0x258604 in ?? ()
> > #31 0x24c10c in ?? ()
> > #32 0x1a0d74 in ?? ()
> > #33 0x3a6a28 in ?? ()
> > #34 0x257820 in ?? ()
> > #35 0x258604 in ?? ()
> > #36 0x24c10c in ?? ()
> > #37 0x1a0d74 in ?? ()
> > #38 0x365d2c in ?? ()
> > #39 0x19de6c in ?? ()
> > #40 0x257820 in ?? ()
> > #41 0x258604 in ?? ()
> > #42 0x24c10c in ?? ()
> > #43 0x3239dc in ?? ()
> > #44 0x198634 in ?? ()
> > #45 0xef4b2b9c in callMethodV (meth=0xcf99d, func=0x15a680, obj=0xefffe976, args=0xefffebcc, 
> >     ret=0xefffea70) at ../../../kaffe/kaffevm/support.c:557
> > #46 0xef4aa38c in Kaffe_CallStaticVoidMethodV (env=0xef4ec350, cls=0x15a568, meth=0x15a5d8, 
> >     args=0xefffebc8) at ../../../kaffe/kaffevm/jni.c:2280
> > #47 0xef4aa40c in Kaffe_CallStaticVoidMethod (env=0xef4ec350, cls=0x15a568, meth=0x15a5d8)
> >     at ../../../kaffe/kaffevm/jni.c:2293
> > #48 0x12160 in main2 (env=0xef4ec350, argv=0xeffff0bc, farg=2, argc=1) at ../../../kaffe/kaffe/main.c:189
> > #49 0x12018 in main (argc=2, argv=0xeffff0bc) at ../../../kaffe/kaffe/main.c:109
> > 
> > (gdb) JITWhere 0x730074
> > Cannot access memory at address 0x1c.
> > 
> 
> Well, 0x730074 is probably part of a char[], namely "st".
> By then, all is lost already.
> Try the pc values of stackframes higher up.
> 
> 	- Godmar
> 
> 




I have been trying to find out why kaffe is crashing with
an illegal instruction error and I have gotten a little
farther.

Here is the error I was getting.


Program received signal SIGILL, Illegal instruction.

#0  0x200020 in ?? ()
#1  0x2b283c in ?? ()
#2  0x2a4968 in ?? ()
#3  0x24d820 in ?? ()
#4  0x246604 in ?? ()
#5  0x24c388 in ?? ()
#6  0x246460 in ?? ()
#7  0x2442fc in ?? ()
#8  0x1930f4 in ?? ()
#9  0x4de2e0 in ?? ()
#10 0x24d820 in ?? ()
#11 0x246604 in ?? ()
#12 0x2442fc in ?? ()
#13 0x1930f4 in ?? ()
#14 0x496364 in ?? ()
#15 0x24d820 in ?? ()
#16 0x246604 in ?? ()
#17 0x2442fc in ?? ()
#18 0x1930f4 in ?? ()
#19 0x2c38cc in ?? ()
#20 0x24d820 in ?? ()
#21 0x246604 in ?? ()
#22 0x24c388 in ?? ()
#23 0x246460 in ?? ()
#24 0x45210c in ?? ()
#25 0x24d820 in ?? ()
#26 0x246604 in ?? ()
#27 0x2442fc in ?? ()
#28 0x3159dc in ?? ()
#29 0x39331c in ?? ()
#30 0x24d820 in ?? ()
#31 0x246604 in ?? ()
#32 0x2442fc in ?? ()
#33 0x1930f4 in ?? ()
#34 0x39aa28 in ?? ()
#35 0x24d820 in ?? ()
#36 0x246604 in ?? ()
#37 0x2442fc in ?? ()
#38 0x1930f4 in ?? ()
#39 0x35dd2c in ?? ()
#40 0x195e6c in ?? ()
#41 0x24d820 in ?? ()
#42 0x246604 in ?? ()
#43 0x2442fc in ?? ()
#44 0x3159dc in ?? ()
#45 0x18a634 in ?? ()
#46 0xef4beb54 in callMethodV (meth=0xcd51d, func=0x150300, obj=0xefffe89e, args=0xefffeaf4, ret=0x
efffe998)
    at ../../../kaffe/kaffevm/support.c:557
#47 0xef4b6cb4 in Kaffe_CallStaticVoidMethodV (env=0xef4f2b68, cls=0x1501e8, meth=0x150258, args=0x
efffeaf0)
    at ../../../kaffe/kaffevm/jni.c:2280
#48 0xef4b6d34 in Kaffe_CallStaticVoidMethod (env=0xef4f2b68, cls=0x1501e8, meth=0x150258)
    at ../../../kaffe/kaffevm/jni.c:2293
#49 0x12138 in main2 (env=0xef4f2b68, argv=0xefffefe4, farg=2, argc=1) at ../../../kaffe/kaffe/main
.c:189
#50 0x11ff0 in main (argc=2, argv=0xefffefe4) at ../../../kaffe/kaffe/main.c:109




Some folks on the list told me to use the findNativeMethod command to see where
it was crashing. Here were the results I got from that.




findNat 0x200020
Cannot access memory at address 0x1c.

findNat 0x2b283c
tcl/lang/ArrayObject.dereferenceArrayDims;(Ltcl/lang/Interp;Ljava/lang/Object;ILtcl/lang/TclObject;
)Ljava/lang/Object;: 2b27f0 2b2f18

findNat 0x2a4968
tcl/lang/ArrayObject.cmdProc;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;)V: 2a4010 2a577c

findNat 0x24d820
tcl/lang/Parser.evalObjv;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;II)V: 24cfd8 24d8cc

findNat 0x246604
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x24c388
tcl/lang/Parser.evalTokens;(Ltcl/lang/Interp;[Ltcl/lang/TclToken;II)Ltcl/lang/TclObject;: 24c010 24
c8b4

findNat 0x246460
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x2442fc
tcl/lang/Interp.eval;(Ljava/lang/String;I)V: 244218 244304

findNat 0x1930f4
tcl/lang/Interp.eval;(Ltcl/lang/TclObject;I)V: 193088 1930fc

findNat 0x2c38cc
tcl/lang/CatchCmd.cmdProc;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;)V: 2c3788 2c3a94

findNat 0x24d820
tcl/lang/Parser.evalObjv;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;II)V: 24cfd8 24d8cc

findNat 0x246604
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x24c388
tcl/lang/Parser.evalTokens;(Ltcl/lang/Interp;[Ltcl/lang/TclToken;II)Ltcl/lang/TclObject;: 24c010 24
c8b4

findNat 0x246460
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x45210c
tcl/lang/Procedure.cmdProc;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;)V: 452010 45263c

findNat 0x24d820
tcl/lang/Parser.evalObjv;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;II)V: 24cfd8 24d8cc

findNat 0x246604
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x24c388
tcl/lang/Parser.evalTokens;(Ltcl/lang/Interp;[Ltcl/lang/TclToken;II)Ltcl/lang/TclObject;: 24c010 24
c8b4

findNat 0x246460
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x45210c
tcl/lang/Procedure.cmdProc;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;)V: 452010 45263c

findNat 0x24d820
tcl/lang/Parser.evalObjv;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;II)V: 24cfd8 24d8cc

findNat 0x246604
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x2442fc
tcl/lang/Interp.eval;(Ljava/lang/String;I)V: 244218 244304

findNat 0x3159dc
tcl/lang/Interp.evalFile;(Ljava/lang/String;)V: 3157b0 315c84

findNat 0x39331c
tcl/lang/SourceCmd.cmdProc;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;)V: 392fd0 393530

findNat 0x24d820
tcl/lang/Parser.evalObjv;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;II)V: 24cfd8 24d8cc

findNat 0x246604
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x2442fc
tcl/lang/Interp.eval;(Ljava/lang/String;I)V: 244218 244304

findNat 0x1930f4
tcl/lang/Interp.eval;(Ltcl/lang/TclObject;I)V: 193088 1930fc

findNat 0x35dd2c
tcl/lang/ForeachCmd.cmdProc;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;)V: 35cfd8 35df48

findNat 0x195e6c
tcl/lang/AutoloadStub.cmdProc;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;)V: 1957b0 195e74

findNat 0x24d820
tcl/lang/Parser.evalObjv;(Ltcl/lang/Interp;[Ltcl/lang/TclObject;II)V: 24cfd8 24d8cc

findNat 0x246604
tcl/lang/Parser.eval2;(Ltcl/lang/Interp;[CIII)V: 246010 246b88

findNat 0x2442fc
tcl/lang/Interp.eval;(Ljava/lang/String;I)V: 244218 244304

findNat 0x3159dc
tcl/lang/Interp.evalFile;(Ljava/lang/String;)V: 3157b0 315c84

findNat 0x18a634
tcl/lang/Shell.main;([Ljava/lang/String;)V: 18a010 18a9a0



So it seems like the problem is in the JIT compiled version of the
tcl/lang/ArrayObject.dereferenceArrayDims() method. Here is the
implementation in Java.


private static Object
dereferenceArrayDims(
    Interp interp,              // Current interpreter.
    Object arrayObj,            // Array to dereference.  Must be an array.

    int numDerefDims,           // Number of dimensions to dereference.
    TclObject indexListObj)     // Index to dereference in each dim.
throws
    TclException                // May encounter bad array index or
                                // dereference a null array value.
{
    // Before derefencing any dimensions, check that the indexList isn't too
    // large--we want to return an array.

    int numDims = JavaInfoCmd.getNumDimsFromClass(arrayObj.getClass());
    if (numDims < numDerefDims) {
        throw new TclException(interp, "bad indexList \"" +
                indexListObj.toString() + "\": javaObj only has " +
                numDims + " dimension(s)");
    }

    Object subArrayObj = arrayObj;
    for (int dim = 0; dim < numDerefDims - 1; dim++) {

        int index = TclInteger.get(interp,
                TclList.index(interp, indexListObj, dim));
        try {
            subArrayObj = Array.get(subArrayObj, index);
        } catch (ArrayIndexOutOfBoundsException e) {
            int max = Array.getLength(subArrayObj) - 1;
            throw new TclException(interp, "array index \"" + index +
                    "\" is out of bounds: must be between 0 and " + max);
        }
        if (subArrayObj == null) {
            throw new TclException(interp,
                    "null value in dimension " + dim +
                    ": can't dereference " + numDims + " dimensions");
        }
    }
    return subArrayObj;
}


Does anyone know how I can focus the jit problem down to the Java
command that is compiled into the illegal instruction? Is there
some sort of "jit debug" option that will include this info
into the executable so that gdb can read it?

Mo DeJong
dejong at cs.umn.edu



More information about the kaffe mailing list