Harmony
  1. Harmony
  2. HARMONY-2073

[drlvm][unit] org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest crashes DRLVM

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Environment:
      SUSE Linux Enterprise Desktop 10 (i586)
      VERSION = 10

      Description

      $ drlvm/trunk/build/lnx_ia32_gcc_debug/deploy/jre/bin/java -Xbootclasspath/a:/nfs/site/proj/drl/mrt/users/af/bin/cruisecontrol-bin-2.4.1/lib/junit.jar:classlib/trunk/modules/beans/bin/test:classlib/trunk/modules/beans/bin/test_support junit.textui.TestRunner org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest
      ..class java.lang.NullPointerException: newInstance is null
      ........java: /nfs/site/proj/drl/mrt/users/af/ws/1/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp:384: void exn_raise_by_name_internal(const char*, const char*, _jobject*): Assertion `hythread_is_suspend_enabled()' failed.
      SIGABRT in VM code.
      SIGSEGV in VM code.
      Stack trace:
      [vm hangs]

      See http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM

        Issue Links

          Activity

          Hide
          Alexei Fedotov added a comment -

          The problem happens on the first invocation of the following function

          Breakpoint 2, exn_raise_by_name_internal (
          exc_name=0xb6dd02d4 "java/lang/StackOverflowError", exc_message=0x0,
          exc_cause=0x0)
          at /nfs/site/proj/drl/mrt/users/af/ws/1/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp:384

          I tracked this using
          (gdb) break exn_raise_by_name_internal

          Show
          Alexei Fedotov added a comment - The problem happens on the first invocation of the following function Breakpoint 2, exn_raise_by_name_internal ( exc_name=0xb6dd02d4 "java/lang/StackOverflowError", exc_message=0x0, exc_cause=0x0) at /nfs/site/proj/drl/mrt/users/af/ws/1/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp:384 I tracked this using (gdb) break exn_raise_by_name_internal
          Hide
          Alexei Fedotov added a comment -

          Alexei Zakharov helped me to understand that the test is obviously related to the enabling of PersistenceDelegateTest

          Show
          Alexei Fedotov added a comment - Alexei Zakharov helped me to understand that the test is obviously related to the enabling of PersistenceDelegateTest
          Hide
          Alexei Zakharov added a comment -

          BTW it crashes only on DEBUG DRLVM builds and passes RELEASE builds.

          Show
          Alexei Zakharov added a comment - BTW it crashes only on DEBUG DRLVM builds and passes RELEASE builds.
          Hide
          Alexey Varlamov added a comment -

          Is this problem intermittent? I do not observe it on fully debug DRLVM (including jitrino and kernel classes), SUSE 9 2.6.5-7.191-bigsmp. But the test failed with the following huge stack, below N = several hundreds:
          java.lang.NullPointerException
          at java.lang.Class.getSuperclass(Class.java:642)
          at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:31)
          [
          at org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$DummyPersistenceDelegate.initialize(PersistenceDelegateTest.java:401)
          at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:35)
          ] * N
          at org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest.testInitialize_circularRedundancy(PersistenceDelegateTest.java:184)
          at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)

          Show
          Alexey Varlamov added a comment - Is this problem intermittent? I do not observe it on fully debug DRLVM (including jitrino and kernel classes), SUSE 9 2.6.5-7.191-bigsmp. But the test failed with the following huge stack, below N = several hundreds: java.lang.NullPointerException at java.lang.Class.getSuperclass(Class.java:642) at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:31) [ at org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest$DummyPersistenceDelegate.initialize(PersistenceDelegateTest.java:401) at java.beans.PersistenceDelegate.initialize(PersistenceDelegate.java:35) ] * N at org.apache.harmony.beans.tests.java.beans.PersistenceDelegateTest.testInitialize_circularRedundancy(PersistenceDelegateTest.java:184) at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
          Hide
          Alexey Varlamov added a comment -

          Hmm, the above behaviour was for complete classlib test run. Standalone test crashes as described.

          Show
          Alexey Varlamov added a comment - Hmm, the above behaviour was for complete classlib test run. Standalone test crashes as described.
          Hide
          Alexei Zakharov added a comment -

          I've created a smaller test to reproduce the problem using the debug build on Win:

          CircularRedundancyTest.java:

          import java.beans.*;
          import junit.framework.TestCase;

          public class CircularRedundancyTest extends TestCase {

          public void testStackOverflow()

          { Encoder enc = new Encoder(); DummyPersistenceDelegate pd = new DummyPersistenceDelegate(); enc.setPersistenceDelegate(Object.class, pd); pd.initialize(Object2.class, new Object2(), new Object2(), enc); }

          static class DummyPersistenceDelegate extends PersistenceDelegate {
          public Expression instantiate(Object oldInstance, Encoder out)

          { return new Expression(oldInstance.getClass(), "new", null); }

          public void initialize(Class<?> type, Object oldInstance,
          Object newInstance, Encoder enc)

          { super.initialize(type, oldInstance, newInstance, enc); }

          }

          static class Object2 extends Object {}
          }

          reproduce-hy2073.bat:

          @echo off
          set VM_HOME=C:\Java\harmony\enhanced\drlvm\trunk\build\win_ia32_msvc_debug\deploy\jre
          REM set VM_HOME=C:\Java\harmony\enhanced\drlvm\trunk\build\win_ia32_msvc_release\deploy\jre
          set BUILD_DIR=C:\mydoc\projects\harmony-beans\build
          set ANT_LIB=C:\Java\apache-ant-1.6.5\lib
          set FORMATTER=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter
          set REPORT_FILE=testReport.txt

          %VM_HOME%\bin\java.exe -Xbootclasspath/p:%BUILD_DIR%\classes -classpath %BUILD_DIR%\tests;%ANT_LIB%\junit.jar;%ANT_LIB%\ant-launcher.jar;%ANT_LIB%\ant.jar;%ANT_LIB%\ant-junit.jar org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner CircularRedundancyTest formatter=%FORMATTER%,%REPORT_FILE%
          type %REPORT_FILE%

          No output means VM crash. If I run this directly using junit.textui.TestRunner the test passes.

          Have fun.

          Show
          Alexei Zakharov added a comment - I've created a smaller test to reproduce the problem using the debug build on Win: CircularRedundancyTest.java: — import java.beans.*; import junit.framework.TestCase; public class CircularRedundancyTest extends TestCase { public void testStackOverflow() { Encoder enc = new Encoder(); DummyPersistenceDelegate pd = new DummyPersistenceDelegate(); enc.setPersistenceDelegate(Object.class, pd); pd.initialize(Object2.class, new Object2(), new Object2(), enc); } static class DummyPersistenceDelegate extends PersistenceDelegate { public Expression instantiate(Object oldInstance, Encoder out) { return new Expression(oldInstance.getClass(), "new", null); } public void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder enc) { super.initialize(type, oldInstance, newInstance, enc); } } static class Object2 extends Object {} } — reproduce-hy2073.bat: — @echo off set VM_HOME=C:\Java\harmony\enhanced\drlvm\trunk\build\win_ia32_msvc_debug\deploy\jre REM set VM_HOME=C:\Java\harmony\enhanced\drlvm\trunk\build\win_ia32_msvc_release\deploy\jre set BUILD_DIR=C:\mydoc\projects\harmony-beans\build set ANT_LIB=C:\Java\apache-ant-1.6.5\lib set FORMATTER=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter set REPORT_FILE=testReport.txt %VM_HOME%\bin\java.exe -Xbootclasspath/p:%BUILD_DIR%\classes -classpath %BUILD_DIR%\tests;%ANT_LIB%\junit.jar;%ANT_LIB%\ant-launcher.jar;%ANT_LIB%\ant.jar;%ANT_LIB%\ant-junit.jar org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner CircularRedundancyTest formatter=%FORMATTER%,%REPORT_FILE% type %REPORT_FILE% — No output means VM crash. If I run this directly using junit.textui.TestRunner the test passes. Have fun.
          Hide
          Alexei Zakharov added a comment -

          I've commented out the testInitialize_circularRedundancy that was the cause of the problem. So now all tests pass on DRLVM DEBUG. However, the root cause should be investigated and fixed IMHO (I'm not the best candidate to do this).

          Show
          Alexei Zakharov added a comment - I've commented out the testInitialize_circularRedundancy that was the cause of the problem. So now all tests pass on DRLVM DEBUG. However, the root cause should be investigated and fixed IMHO (I'm not the best candidate to do this).
          Hide
          Alexei Zakharov added a comment -

          Since my last action was criticized by the community I uncommented testInitialize_circularRedundancy and put the whole PersistenceDelegateTest class to the exclude list (r472934).

          Show
          Alexei Zakharov added a comment - Since my last action was criticized by the community I uncommented testInitialize_circularRedundancy and put the whole PersistenceDelegateTest class to the exclude list (r472934).
          Hide
          Alexei Fedotov added a comment -

          The test passes for me. Probably HARMONY-2018 fixed this as well.

          Show
          Alexei Fedotov added a comment - The test passes for me. Probably HARMONY-2018 fixed this as well.
          Hide
          Alexei Zakharov added a comment -

          Yep. Now PersistenceDelegateTest and DefaultPersistenceDelegateTest pass on DRLVM without any problems as well. My congratulations! I will remove them from the exclude list.

          Show
          Alexei Zakharov added a comment - Yep. Now PersistenceDelegateTest and DefaultPersistenceDelegateTest pass on DRLVM without any problems as well. My congratulations! I will remove them from the exclude list.
          Hide
          Alexei Fedotov added a comment -

          I believe we need to close this bug as duplicate

          Show
          Alexei Fedotov added a comment - I believe we need to close this bug as duplicate
          Hide
          Alexei Zakharov added a comment -

          closed as duplicate

          Show
          Alexei Zakharov added a comment - closed as duplicate

            People

            • Assignee:
              Alexei Zakharov
              Reporter:
              Alexei Fedotov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development