Giter Club home page Giter Club logo

jdisasm's People

Contributors

aunkrig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jdisasm's Issues

Disassembler seems to swallow the corrupted part of code without error against corrupted class file

Migrated from janino-compiler/janino#113 - the original issue was fixed, but while debugging, disassembler doesn't give any information against corrupted class file hence had to figure out with the field code (byte array) against debugger.

Corrupted class file was generated from Janino (the reason was janino-compiler/janino#113) - I've set breakpoint to UnitCompiler.addClassFile and force debugger to write cf.byteArray() to the file, as well as run Disassembler.disassembleToStdout(cf.toByteArray()).

Archive.zip

  • error-codegen.log: The code triggered the bug janino-compiler/janino#113

  • classfile.class: The content cf.byteArray() is stored.

  • classfile.class.decompiled-javac: The output from javap -c -p -v classfile.class

It threw error and stopped printing out disassembled code where the bug has been spotted. (tableswitch is in offset 578 in expand_doConsume - got the information while debugging with code field)

Error: A serious internal error has occurred: java.lang.NegativeArraySizeException
Please file a bug report, and include the following information:
java.lang.NegativeArraySizeException
	at com.sun.tools.classfile.Instruction.accept(Instruction.java:288)
	at com.sun.tools.javap.CodeWriter.writeInstr(CodeWriter.java:126)
	at com.sun.tools.javap.CodeWriter.writeInstrs(CodeWriter.java:108)
	at com.sun.tools.javap.CodeWriter.write(CodeWriter.java:75)
	at com.sun.tools.javap.AttributeWriter.visitCode(AttributeWriter.java:220)
	at com.sun.tools.javap.AttributeWriter.visitCode(AttributeWriter.java:75)
	at com.sun.tools.classfile.Code_attribute.accept(Code_attribute.java:102)
	at com.sun.tools.javap.AttributeWriter.write(AttributeWriter.java:101)
	at com.sun.tools.javap.ClassWriter.writeMethod(ClassWriter.java:508)
	at com.sun.tools.javap.ClassWriter.writeMethods(ClassWriter.java:412)
	at com.sun.tools.javap.ClassWriter.write(ClassWriter.java:217)
	at com.sun.tools.javap.JavapTask.write(JavapTask.java:784)
	at com.sun.tools.javap.JavapTask.writeClass(JavapTask.java:606)
	at com.sun.tools.javap.JavapTask.run(JavapTask.java:560)
	at com.sun.tools.javap.JavapTask.run(JavapTask.java:423)
	at com.sun.tools.javap.Main.main(Main.java:46)
  • classfile.class.decompiled-jdisasm-1.x: The output from Disassembler.disassembleToStdout(cf.toByteArray()) (I've done with two versions: 1.4 and 1.5)

  • classfile.class.decompiled-jdisasm-1.5-cli: The output from de.unkrig.jdisasm.Disassembler -verbose

All outputs from jdisasm silently threw out the part (entire code in the method - expand_doConsume) where corrupted operation is placed.

As jdisasm is the recommended way to report the bug on Janino, it would be nice to catch the corrupted code and throw out error (or tolerate the error but log the error message at least).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.