stack length differs ?!?!?!?

Help
2001-12-05
2003-04-26
  • Erich Jermann

    Erich Jermann - 2001-12-05

    Hi,

    I've got a problem decompiling a very long class file ...

    The classpath contains more then 5 megs of jars.

    Any idea what this could mean?

    Many thanks in advance.

    Exception while decompiling:java.lang.IllegalArgumentException: stack length differs
        at jode.flow.VariableStack.merge(VariableStack.java:77)
        at jode.flow.LoopBlock.mergeBreakedStack(LoopBlock.java:464)
        at jode.flow.BreakBlock.mapStackToLocal(BreakBlock.java:83)
        at jode.flow.JsrBlock.mapStackToLocal(JsrBlock.java:89)
        at jode.flow.SequentialBlock.mapStackToLocal(SequentialBlock.java:70)
        at jode.flow.SequentialBlock.mapStackToLocal(SequentialBlock.java:73)
        at jode.flow.LoopBlock.mapStackToLocal(LoopBlock.java:409)
        at jode.flow.SequentialBlock.mapStackToLocal(SequentialBlock.java:70)
        at jode.flow.SequentialBlock.mapStackToLocal(SequentialBlock.java:73)
        at jode.flow.FlowBlock.mapStackToLocal(FlowBlock.java:1531)
        at jode.flow.FlowBlock.mapStackToLocal(FlowBlock.java:1515)
        at jode.decompiler.MethodAnalyzer.analyzeCode(MethodAnalyzer.java:580)
        at jode.decompiler.MethodAnalyzer.analyze(MethodAnalyzer.java:652)
        at jode.decompiler.ClassAnalyzer.analyze(ClassAnalyzer.java:359)
        at jode.decompiler.MethodAnalyzer.analyzeInvokeOperator(MethodAnalyzer.java:1073)
        at jode.decompiler.MethodAnalyzer.analyzeInnerClasses(MethodAnalyzer.java:666)
        at jode.decompiler.ClassAnalyzer.analyzeInnerClasses(ClassAnalyzer.java:395)
        at jode.decompiler.ClassAnalyzer.dumpJavaFile(ClassAnalyzer.java:626)
        at jode.decompiler.Decompiler.decompile(Decompiler.java:192)
        at jode.swingui.Main.run(Main.java:204)
        at java.lang.Thread.run(Unknown Source)

     
    • Jochen Hoenicke

      Jochen Hoenicke - 2001-12-05

      This is a bug in Jode.  If you use the switch "--push=yes" the class should decompile without exception, although it can only produce some approximation of the original code.

      The problem was originally caused by either a synchronized or a try/finally block that jode didn't understand (every compiler version produces it's own bytecode for these blocks, sigh).  BTW, do you use jode-1.1.1?

       
    • Erich Jermann

      Erich Jermann - 2001-12-06

      Hi,

      Thanks for your very quick answer.

      Yes I use jode_1.1.1.

      Everything was decompiled now ... quite impressive, since JAD seems to decompile all files but half of the methods are missing.

      Thanks again.

      - Erich

       
    • Martín Ferrari

      Martín Ferrari - 2003-04-25

      I tried this approach, and tried using the CVS version (which didn't require the push option) but hoth of them created incompilable code...

      $ javac Facturacion.java
      Facturacion.java:148: not a statement
                              PUSH this;
                              ^
      Facturacion.java:148: ';' expected
                              PUSH this;
                                   ^

      etc etc etc
      Please, anybody could give me a clue? I am no a java programmer but I have to recover lost sources from a project.

       
      • Jochen Hoenicke

        Jochen Hoenicke - 2003-04-25

        My guess is that this is some bytecode which was obfuscated or optimized in some way. I can't say what exactly happens without seeing the context.  There should be a POP instruction somewhere that matches with the PUSH.

         
        • Martín Ferrari

          Martín Ferrari - 2003-04-26

          Hoenicke:

          thanks for your fast response.

          I have crossposted to the mailing list, and there I included the .class and the original source code since this is one of the few I have the original code available.

          Also, the PUSH seems to be unrecognized by the compiler...

           
    • Martín Ferrari

      Martín Ferrari - 2003-04-25

      Hoenicke:

      thanks for your fast response.

      I have crossposted to the mailing listm, and there I included the .class and the original source code since this is one of the few I have the original code available.

      Also, the PUSH seems to be unrecognized by the compiler...

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks