Harmony
  1. Harmony
  2. HARMONY-1908

[drlvm][opt] failed assert in ControlFlowGraph

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Environment:
      SUSE 9
    • Patch Info:
      Patch Available

      Description

      Steps to reproduce:
      ./java -Xem:opt -cp $classlib/modules/nio/bin/test:junit.jar junit.textui.TestRunner org.apache.harmony.nio.tests.java.nio.channels.SelectionKeyTest

      java: /export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:384: bool Jitrino::ControlFlowGraph::isEdgeProfileConsistent(bool, bool, bool): Assertion `doAssert?false:true' failed.
      SIGABRT in VM code.
      Stack trace:
      1: ?? (??:-1)
      2: abort (??:-1)
      3: __assert_fail (??:-1)
      4: Jitrino::ControlFlowGraph::isEdgeProfileConsistent(bool, bool, bool) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:385)
      5: Jitrino::ControlFlowGraph::smoothEdgeProfile() (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:947)
      6: Jitrino::StaticProfiler::estimateGraph(Jitrino::IRManager&, double, bool) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/dynopt/StaticProfiler.cpp:253)
      7: Jitrino::StaticProfilerPass::_run(Jitrino::IRManager&) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/dynopt/StaticProfiler.cpp:293)
      8: Jitrino::OptPass::run() (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/optimizer/optpass.cpp:61)
      9: Jitrino::runPipeline(Jitrino::CompilationContext*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/main/Jitrino.cpp:226)
      10: Jitrino::compileMethod(Jitrino::CompilationContext*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/main/Jitrino.cpp:261)
      11: Jitrino::Jitrino::CompileMethod(Jitrino::CompilationContext*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/main/Jitrino.cpp:286)
      12: JIT_compile_method_with_params (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/vm/drl/DrlJITInterface.cpp:282)
      13: Dll_JIT::compile_method_with_params(void*, Method*, OpenMethodExecutionParams) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/include/dll_jit_intf.h:86)
      14: compile_do_compilation_jit(Method*, JIT*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jit/compile.cpp:700)
      15: vm_compile_method (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/class_support/C_Interface.cpp:2538)
      16: DrlEMImpl::compileMethod(Method*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/em/src/DrlEMImpl.cpp:520)
      17: CompileMethod (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/em/src/em_intf.cpp:49)
      18: compile_do_compilation (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jit/compile.cpp:780)
      19: compile_jit_a_method(Method*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jit/compile.cpp:828)
      20: IP is 0x410D0172 <native code>
      21: java/nio/channels/spi/AbstractSelectableChannel.register(Ljava/nio/channels/Selector;ILjava/lang/Object;)Ljava/nio/channels/SelectionKey; (AbstractSelectableChannel.java:-1)
      SIGSEGV in VM code.
      Stack trace:
      22: Jitrino::Ia32::StackInfo::readByteSize(unsigned char const*) const (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp:107)
      23: Jitrino::Ia32::RuntimeInterface::getBcLocationForNative(Jitrino::MethodDesc*, unsigned long long, unsigned short*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/codegenerator/ia32/Ia32RuntimeInterface.cpp:78)
      24: Jitrino::Jitrino::GetBcLocationForNative(Jitrino::MethodDesc*, unsigned long long, unsigned short*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/main/Jitrino.cpp:358)
      25: get_bc_location_for_native (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/vm/drl/DrlJITInterface.cpp:590)
      26: Dll_JIT::get_bc_location_for_native(Method*, void*, unsigned short*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/include/dll_jit_intf.h:240)
      27: get_file_and_line (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/stack/stack_trace.cpp:60)
      28: st_get_java_method_info (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/stack/stack_dump.cpp:196)
      29: st_print_stack(Registers*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/stack/stack_dump.cpp:242)
      30: abort_handler(int, siginfo*, void*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/util/linux/signals_ia32.cpp:614)
      <end of stack trace>

        Issue Links

          Activity

          Hide
          Alexey Varlamov added a comment -

          Fixed at r474240

          Show
          Alexey Varlamov added a comment - Fixed at r474240
          Hide
          Alexey Varlamov added a comment -

          Checked the patch, it works. Thanks!

          Show
          Alexey Varlamov added a comment - Checked the patch, it works. Thanks!
          Hide
          Mikhail Fursov added a comment -

          The patch for 1969 fixes this problem too.
          So no need to remove the assertion in CFG. The reason of failure was inconsistent loop structure.

          Show
          Mikhail Fursov added a comment - The patch for 1969 fixes this problem too. So no need to remove the assertion in CFG. The reason of failure was inconsistent loop structure.
          Hide
          Mikhail Fursov added a comment -

          the solution of this problem is depends on Harmony-1969. The same method (pattern) is affected.

          Show
          Mikhail Fursov added a comment - the solution of this problem is depends on Harmony-1969. The same method (pattern) is affected.
          Hide
          Mikhail Fursov added a comment -

          This is OK.
          Without the monexit problem this bugs is very low-proirity one. The most simple solution, of course, is to remove the failing assertion. The most interesting solution is to find out the reason of failure: why num_loop_cycles<1. AFAIU the part of the problem is floating point arithmetic. But I'm not sure if we have no other problem here.

          Show
          Mikhail Fursov added a comment - This is OK. Without the monexit problem this bugs is very low-proirity one. The most simple solution, of course, is to remove the failing assertion. The most interesting solution is to find out the reason of failure: why num_loop_cycles<1. AFAIU the part of the problem is floating point arithmetic. But I'm not sure if we have no other problem here.
          Hide
          Egor Pasko added a comment -

          I created a separate issue for the loop nesting problem: HARMONY-1969.
          Leaving this issue to decide whether we need assertions like this in smoothEdgeProfile()

          Show
          Egor Pasko added a comment - I created a separate issue for the loop nesting problem: HARMONY-1969 . Leaving this issue to decide whether we need assertions like this in smoothEdgeProfile()
          Hide
          Mikhail Fursov added a comment -

          This bug reveals new problem. The affected method has illegal loop structure in HIR because of the bug in the translator (with nested monitors).
          Still working on it..

          Show
          Mikhail Fursov added a comment - This bug reveals new problem. The affected method has illegal loop structure in HIR because of the bug in the translator (with nested monitors). Still working on it..
          Hide
          Mikhail Fursov added a comment -

          Very strange behaviour. I'm trying to reproduce and find the reason...

          Show
          Mikhail Fursov added a comment - Very strange behaviour. I'm trying to reproduce and find the reason...

            People

            • Assignee:
              Alexey Varlamov
              Reporter:
              Alexey Varlamov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development