• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • generic
    • generic

      Problem: The new attribute tests are tested on stable JDK. So it is not clear whether the new tests can detect errors in byte code.

      Goal: The goal of work is to introduce "bugs" to javac compiler to check that tests really detect bugs in the generated byte code.

      The idea:
      Add noise to generated byte code with a byte code manipulation library.
      Each test reads classfile either from disk or from in-memory-file-manager. Now the generated byte code is corrupted with byte code manipulation library ASM before reading from file manager. Corrupted class files are checked tests. It is assumed that all tests will fail in this case.

      How is byte code corrupted?
      For example, ASM calls visitOuterClass of MutatingClassVisitor to generate EnclosingMethod attribute. Four possible corruptions: to remove an attribute or to corrupt one of three argument of visitOuterClass. First corruption action is chosen randomly, the next action is the next action in an array that specified to corrupter. The same strategy is used for other attributes.

      To run tests with the corrupter add compiled lib/corrupter and asm5.0.3.jar to jtreg's classpath.

            aeremeev Andrei Eremeev
            aeremeev Andrei Eremeev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: