Harmony
  1. Harmony
  2. HARMONY-1909

[drlvm][opt] failed assert in Node::insertInst

    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

      To reproduce:
      ./java -Xem:opt -cp $classlib/modules/luni/bin/test:$WRK/junit.jar junit.textui.TestRunner tests.api.java.lang.reflect.FieldTest

      java: /export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:154: void Jitrino::Node::insertInst(Jitrino::CFGInst*, Jitrino::CFGInst*): Assertion `prevInst->isHeaderCriticalInst()' failed.
      SIGABRT in VM code.
      Stack trace:
      1: ?? (??:-1)
      2: abort (??:-1)
      3: __assert_fail (??:-1)
      4: Jitrino::Node::insertInst(Jitrino::CFGInst*, Jitrino::CFGInst*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:155)
      5: Jitrino::CFGInst::insertAfter(Jitrino::CFGInst*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:984)
      6: Jitrino::ControlFlowGraph::moveInstructions(Jitrino::Node*, Jitrino::Node*, bool) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:822)
      7: Jitrino::ControlFlowGraph::mergeBlocks(Jitrino::Node*, Jitrino::Node*, bool) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:528)
      8: Jitrino::ControlFlowGraph::mergeAdjacentNodes(bool, bool) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/shared/ControlFlowGraph.cpp:546)
      9: Jitrino::DeadCodeEliminator::eliminateDeadCode(bool) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/optimizer/deadcodeeliminator.cpp:1042)
      10: Jitrino::DeadCodeEliminationPass::_run(Jitrino::IRManager&) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/optimizer/deadcodeeliminator.cpp:47)
      11: Jitrino::OptPass::run() (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/optimizer/optpass.cpp:61)
      12: Jitrino::runPipeline(Jitrino::CompilationContext*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/main/Jitrino.cpp:226)
      13: Jitrino::compileMethod(Jitrino::CompilationContext*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/main/Jitrino.cpp:261)
      14: Jitrino::Jitrino::CompileMethod(Jitrino::CompilationContext*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/main/Jitrino.cpp:286)
      15: JIT_compile_method_with_params (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/vm/drl/DrlJITInterface.cpp:282)
      16: 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)
      17: compile_do_compilation_jit(Method*, JIT*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jit/compile.cpp:700)
      18: vm_compile_method (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/class_support/C_Interface.cpp:2538)
      19: DrlEMImpl::compileMethod(Method*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/em/src/DrlEMImpl.cpp:520)
      20: CompileMethod (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/em/src/em_intf.cpp:49)
      21: compile_do_compilation (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jit/compile.cpp:780)
      22: compile_jit_a_method(Method*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jit/compile.cpp:828)
      23: IP is 0x410D0172 <native code>
      24: vm_invoke_native_array_stub (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/util/ia32/base/invoke_native_stub_ia32.asm:41)
      25: JIT_execute_method_default(void*, _jmethodID*, jvalue*, jvalue*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/util/ia32/base/ini_iA32.cpp:199)
      26: DrlEMImpl::executeMethod(_jmethodID*, jvalue*, jvalue*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/em/src/DrlEMImpl.cpp:489)
      27: ExecuteMethod (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/em/src/em_intf.cpp:43)
      28: vm_execute_java_method_array(_jmethodID*, jvalue*, jvalue*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jit/ini.cpp:60)
      29: call_method_no_ref_result (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jni/jni_method.cpp:165)
      30: CallVoidMethodA(JNIEnv_External*, _jobject*, _jmethodID*, jvalue*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/jni/jni_method.cpp:200)
      31: invoke_primitive_method (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp:185)
      32: Java_java_lang_reflect_VMReflection_invokeMethod (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp:221)
      33: IP is 0x41125C79 <native code>
      34: java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (??:-1)
      35: junit/framework/TestCase.runTest()V (TestCase.java:154)
      36: junit/framework/TestCase.runBare()V (TestCase.java:-1)
      37: junit/framework/TestResult$1.protect()V (TestResult.java:-1)
      38: junit/framework/TestResult.runProtected(Ljunit/framework/Test;Ljunit/framework/Protectable;)V (TestResult.java:-1)
      39: junit/framework/TestResult.run(Ljunit/framework/TestCase;)V (TestResult.java:-1)
      40: junit/framework/TestCase.run(Ljunit/framework/TestResult;)V (TestCase.java:-1)
      SIGSEGV in VM code.
      Stack trace:
      41: Jitrino::Ia32::StackInfo::readByteSize(unsigned char const*) const (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp:107)
      42: 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)
      43: 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)
      44: get_bc_location_for_native (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/jitrino/src/vm/drl/DrlJITInterface.cpp:590)
      45: 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)
      46: get_file_and_line (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/stack/stack_trace.cpp:60)
      47: st_get_java_method_info (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/stack/stack_dump.cpp:196)
      48: st_print_stack(Registers*) (/export/users2/avarlamo/linux.ia32/svn-repo/drlvm/vm/vmcore/src/stack/stack_dump.cpp:242)
      49: 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>

      1. 1909.diff
        1.0 kB
        Mikhail Fursov

        Activity

        Hide
        Alexey Varlamov added a comment -

        The same assertion fails with CipherInputStreamTest:
        ./java -Xem:opt -Xbootclasspath/a:$classlib/modules/crypto/bin/test/api.injected:junit.jar junit.textui.TestRunner javax.crypto.CipherInputStreamTest
        Backtrace is identical.

        Show
        Alexey Varlamov added a comment - The same assertion fails with CipherInputStreamTest: ./java -Xem:opt -Xbootclasspath/a:$classlib/modules/crypto/bin/test/api.injected:junit.jar junit.textui.TestRunner javax.crypto.CipherInputStreamTest Backtrace is identical.
        Hide
        Alexey Varlamov added a comment -

        And the same with BoxTest:
        ./java -Xem:opt -cp $classlib/modules/swing/bin/test:junit.jar:$classlib/deploy/build/test/support.jar junit.textui.TestRunner javax.swing.BoxTest

        Show
        Alexey Varlamov added a comment - And the same with BoxTest: ./java -Xem:opt -cp $classlib/modules/swing/bin/test:junit.jar:$classlib/deploy/build/test/support.jar junit.textui.TestRunner javax.swing.BoxTest
        Hide
        Alexey Varlamov added a comment -

        And the same for ComponentUITest:
        ./java -Xem:opt -cp $classlib/modules/swing/bin/test:junit.jar:$classlib/deploy/build/test/support.jar junit.textui.TestRunner javax.swing.plaf.ComponentUITest

        Show
        Alexey Varlamov added a comment - And the same for ComponentUITest: ./java -Xem:opt -cp $classlib/modules/swing/bin/test:junit.jar:$classlib/deploy/build/test/support.jar junit.textui.TestRunner javax.swing.plaf.ComponentUITest
        Hide
        Mikhail Fursov added a comment -

        The problem is known: CFG must not merge nodes with phi-insts.
        Fix will be added soon

        Show
        Mikhail Fursov added a comment - The problem is known: CFG must not merge nodes with phi-insts. Fix will be added soon
        Hide
        Mikhail Fursov added a comment -

        The fix. Please verify that this patch fixes all of your problems.

        Show
        Mikhail Fursov added a comment - The fix. Please verify that this patch fixes all of your problems.
        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
        Geir Magnusson Jr added a comment -

        I can't duplicate the problem. I get this (notice the additional part of the classpath) :

        geir@t42-laptop:~/dev/apache/harmony/enhanced/trunk/working_vm/build/deploy/jre/bin$ ./java -version
        Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
        java version "1.5.0"
        pre-alpha : not complete or compatible
        svn = r471468, (Nov 5 2006), Linux/ia32/gcc 3.4.6, debug build
        http://incubator.apache.org/harmony
        geir@t42-laptop:~/dev/apache/harmony/enhanced/trunk/working_vm/build/deploy/jre/bin$ ./java -Xem:opt -cp $classlib/modules/luni/bin/test:junit.jar:$classlib/build/test_support/ junit.textui.TestRunner tests.api.java.lang.reflect.FieldTest
        ..F.......................
        Time: 0.455
        There was 1 failure:
        1) test_getLjava_lang_Object(tests.api.java.lang.reflect.FieldTest)junit.framework.AssertionFailedError: No expected IllegalAccessException during get tests
        at tests.api.java.lang.reflect.FieldTest.test_getLjava_lang_Object(FieldTest.java:143)
        at java.lang.reflect.VMReflection.invokeMethod(Native Method)

        FAILURES!!!
        Tests run: 25, Failures: 1, Errors: 0

        geir@t42-laptop:~/dev/apache/harmony/enhanced/trunk/working_vm/build/deploy/jre/bin$

        Show
        Geir Magnusson Jr added a comment - I can't duplicate the problem. I get this (notice the additional part of the classpath) : geir@t42-laptop:~/dev/apache/harmony/enhanced/trunk/working_vm/build/deploy/jre/bin$ ./java -version Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. java version "1.5.0" pre-alpha : not complete or compatible svn = r471468, (Nov 5 2006), Linux/ia32/gcc 3.4.6, debug build http://incubator.apache.org/harmony geir@t42-laptop:~/dev/apache/harmony/enhanced/trunk/working_vm/build/deploy/jre/bin$ ./java -Xem:opt -cp $classlib/modules/luni/bin/test:junit.jar:$classlib/build/test_support/ junit.textui.TestRunner tests.api.java.lang.reflect.FieldTest ..F....................... Time: 0.455 There was 1 failure: 1) test_getLjava_lang_Object(tests.api.java.lang.reflect.FieldTest)junit.framework.AssertionFailedError: No expected IllegalAccessException during get tests at tests.api.java.lang.reflect.FieldTest.test_getLjava_lang_Object(FieldTest.java:143) at java.lang.reflect.VMReflection.invokeMethod(Native Method) FAILURES!!! Tests run: 25, Failures: 1, Errors: 0 geir@t42-laptop:~/dev/apache/harmony/enhanced/trunk/working_vm/build/deploy/jre/bin$
        Hide
        Mikhail Fursov added a comment -

        The same problem again (as in another JIRA). I think you use release jitrino build... Do you ?

        Show
        Mikhail Fursov added a comment - The same problem again (as in another JIRA). I think you use release jitrino build... Do you ?
        Hide
        Alexey Varlamov added a comment -

        Mikhail, looking at the console output, I'd say it was debug build. The problem is that jitrino library is always compiled in release mode, see hardcoded string "-Dvm.jitrino.cfg=release" in build.sh/build.bat. I will raise this issue on dev-list.

        Show
        Alexey Varlamov added a comment - Mikhail, looking at the console output, I'd say it was debug build. The problem is that jitrino library is always compiled in release mode, see hardcoded string "-Dvm.jitrino.cfg=release" in build.sh/build.bat. I will raise this issue on dev-list.
        Hide
        Alexey Varlamov added a comment -

        Fixed at r474239

        Show
        Alexey Varlamov added a comment - Fixed at r474239

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development