diff options
Diffstat (limited to 'test')
38 files changed, 524 insertions, 333 deletions
diff --git a/test/1917-get-stack-frame/expected.txt b/test/1917-get-stack-frame/expected.txt index 4c9efcf157..06f5873d76 100644 --- a/test/1917-get-stack-frame/expected.txt +++ b/test/1917-get-stack-frame/expected.txt @@ -1,6 +1,6 @@ Recurring 5 times 'private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread)' line: -1 -'public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread)' line: 60 +'public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread)' line: 61 'public void art.Test1917$StackTraceGenerator.run()' line: 82 'public void art.Test1917$RecurCount.doRecur(int)' line: 104 'public void art.Test1917$RecurCount.doRecur(int)' line: 102 @@ -12,7 +12,7 @@ Recurring 5 times 'public static void art.Test1917.run() throws java.lang.Exception' line: 133 Recurring 5 times on another thread 'private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread)' line: -1 -'public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread)' line: 60 +'public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread)' line: 61 'public void art.Test1917$StackTraceGenerator.run()' line: 82 'public void art.Test1917$RecurCount.doRecur(int)' line: 104 'public void art.Test1917$RecurCount.doRecur(int)' line: 102 diff --git a/test/1917-get-stack-frame/src/art/StackTrace.java b/test/1917-get-stack-frame/src/art/StackTrace.java index b12c3df66b..2ea2f201e8 100644 --- a/test/1917-get-stack-frame/src/art/StackTrace.java +++ b/test/1917-get-stack-frame/src/art/StackTrace.java @@ -53,7 +53,8 @@ public class StackTrace { // consistent we will suspend for the RI. boolean suspend_thread = !System.getProperty("java.vm.name").equals("Dalvik") && - !thr.equals(Thread.currentThread()); + !thr.equals(Thread.currentThread()) && + !Suspension.isSuspended(thr); if (suspend_thread) { Suspension.suspend(thr); } diff --git a/test/1927-exception-event/expected.txt b/test/1927-exception-event/expected.txt index be8f39c29a..fcdd814977 100644 --- a/test/1927-exception-event/expected.txt +++ b/test/1927-exception-event/expected.txt @@ -3,7 +3,7 @@ Running test_J main: public static void art.Test1927.test_J() @ line = 110 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.test_J() @ line = 110 @@ -12,7 +12,7 @@ main: public static void art.Test1927.test_J() @ line = 110 throws class art.Tes main: public static void art.Test1927.test_J() @ line = 111 caught class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 43 public static void art.Test1927.test_J() @ line = 111 @@ -24,7 +24,7 @@ Running test_J_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -34,7 +34,7 @@ main: public static void art.Test1927.terminal_J() @ line = 103 throws class art main: public static void art.Test1927.test_J_J() @ line = 122 caught class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 43 public static void art.Test1927.test_J_J() @ line = 122 @@ -44,7 +44,7 @@ Running test_J_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 @@ -54,7 +54,7 @@ main: public static native void art.Test1927.terminal_N() @ line = -1 throws cla main: public static void art.Test1927.test_J_N() @ line = 130 caught class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 43 public static void art.Test1927.test_J_N() @ line = 130 @@ -64,7 +64,7 @@ Running test_N_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -76,7 +76,7 @@ Running test_N_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 @@ -88,7 +88,7 @@ Running test_J_J_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -99,7 +99,7 @@ main: public static void art.Test1927.terminal_J() @ line = 103 throws class art main: public static void art.Test1927.test_J_J_J() @ line = 146 caught class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 43 public static void art.Test1927.test_J_J_J() @ line = 146 @@ -109,7 +109,7 @@ Running test_J_J_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 @@ -120,7 +120,7 @@ main: public static native void art.Test1927.terminal_N() @ line = -1 throws cla main: public static void art.Test1927.test_J_J_N() @ line = 154 caught class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 43 public static void art.Test1927.test_J_J_N() @ line = 154 @@ -130,7 +130,7 @@ Running test_J_N_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -141,7 +141,7 @@ main: public static void art.Test1927.terminal_J() @ line = 103 throws class art main: public static void art.Test1927.test_J_N_J() @ line = 162 caught class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 43 public static void art.Test1927.test_J_N_J() @ line = 162 @@ -151,7 +151,7 @@ Running test_J_N_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 @@ -162,7 +162,7 @@ main: public static native void art.Test1927.terminal_N() @ line = -1 throws cla main: public static void art.Test1927.test_J_N_N() @ line = 170 caught class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 43 public static void art.Test1927.test_J_N_N() @ line = 170 @@ -172,7 +172,7 @@ Running test_N_J_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -185,7 +185,7 @@ Running test_N_J_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 @@ -198,7 +198,7 @@ Running test_N_N_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -211,7 +211,7 @@ Running test_N_N_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 @@ -224,7 +224,7 @@ Running test_extra_N_J_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -238,7 +238,7 @@ Running test_extra_N_J_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 @@ -252,7 +252,7 @@ Running test_extra_N_N_J() main: public static void art.Test1927.terminal_J() @ line = 103 throws class art.Test1927$TestException: from java Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static void art.Test1927.terminal_J() @ line = 103 @@ -266,7 +266,7 @@ Running test_extra_N_N_N() main: public static native void art.Test1927.terminal_N() @ line = -1 throws class art.Test1927$TestException: from native Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1927.PrintStack() @ line = 28 public static void art.Test1927.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 66 public static native void art.Test1927.terminal_N() @ line = -1 diff --git a/test/1927-exception-event/src/art/StackTrace.java b/test/1927-exception-event/src/art/StackTrace.java index b12c3df66b..2ea2f201e8 100644 --- a/test/1927-exception-event/src/art/StackTrace.java +++ b/test/1927-exception-event/src/art/StackTrace.java @@ -53,7 +53,8 @@ public class StackTrace { // consistent we will suspend for the RI. boolean suspend_thread = !System.getProperty("java.vm.name").equals("Dalvik") && - !thr.equals(Thread.currentThread()); + !thr.equals(Thread.currentThread()) && + !Suspension.isSuspended(thr); if (suspend_thread) { Suspension.suspend(thr); } diff --git a/test/1928-exception-event-exception/expected.txt b/test/1928-exception-event-exception/expected.txt index 1692d042e4..73c69727aa 100644 --- a/test/1928-exception-event-exception/expected.txt +++ b/test/1928-exception-event-exception/expected.txt @@ -2,235 +2,119 @@ Test "art.Test1928$DoThrowClass": Running with handler "art.Test1928$DoNothingHa main: public static void art.Test1928.doThrow() @ line = 110 throws class art.Test1928$TestException: doThrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.doThrow() @ line = 110 public void art.Test1928$DoThrowClass.run() @ line = 114 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.run() throws java.lang.Exception @ line = 199 -exception is: art.Test1928$TestException: doThrow - at art.Test1928.doThrow(Test1928.java:110) - at art.Test1928$DoThrowClass.run(Test1928.java:114) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Doing nothing! Test "art.Test1928$DoThrowClass": Caught error art.Test1928$TestException:"doThrow" with handler "art.Test1928$DoNothingHandler" -art.Test1928$TestException: doThrow - at art.Test1928.doThrow(Test1928.java:110) - at art.Test1928$DoThrowClass.run(Test1928.java:114) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowClass": Finished running with handler "art.Test1928$DoNothingHandler" Test "art.Test1928$DoThrowCatchBaseTestException": Running with handler "art.Test1928$DoNothingHandler" main: public static void art.Test1928.throwCatchBaseTestException() @ line = 119 throws class art.Test1928$TestException: throwCatchBaseTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.throwCatchBaseTestException() @ line = 119 public void art.Test1928$DoThrowCatchBaseTestException.run() @ line = 129 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.throwCatchBaseTestException() @ line = 120 -exception is: art.Test1928$TestException: throwCatchBaseTestException - at art.Test1928.throwCatchBaseTestException(Test1928.java:119) - at art.Test1928$DoThrowCatchBaseTestException.run(Test1928.java:129) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Doing nothing! Caught art.Test1928$TestException: "throwCatchBaseTestException" -art.Test1928$TestException: throwCatchBaseTestException - at art.Test1928.throwCatchBaseTestException(Test1928.java:119) - at art.Test1928$DoThrowCatchBaseTestException.run(Test1928.java:129) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowCatchBaseTestException": No error caught with handler "art.Test1928$DoNothingHandler" Test "art.Test1928$DoThrowCatchBaseTestException": Finished running with handler "art.Test1928$DoNothingHandler" Test "art.Test1928$DoThrowCatchTestException": Running with handler "art.Test1928$DoNothingHandler" main: public static void art.Test1928.throwCatchTestException() @ line = 134 throws class art.Test1928$TestException: throwCatchTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.throwCatchTestException() @ line = 134 public void art.Test1928$DoThrowCatchTestException.run() @ line = 144 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.throwCatchTestException() @ line = 135 -exception is: art.Test1928$TestException: throwCatchTestException - at art.Test1928.throwCatchTestException(Test1928.java:134) - at art.Test1928$DoThrowCatchTestException.run(Test1928.java:144) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Doing nothing! Caught art.Test1928$TestException: "throwCatchTestException" -art.Test1928$TestException: throwCatchTestException - at art.Test1928.throwCatchTestException(Test1928.java:134) - at art.Test1928$DoThrowCatchTestException.run(Test1928.java:144) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowCatchTestException": No error caught with handler "art.Test1928$DoNothingHandler" Test "art.Test1928$DoThrowCatchTestException": Finished running with handler "art.Test1928$DoNothingHandler" Test "art.Test1928$DoThrowCatchTestExceptionNoRethrow": Running with handler "art.Test1928$DoNothingHandler" main: public static void art.Test1928.throwCatchTestExceptionNoRethrow() @ line = 149 throws class art.Test1928$TestException: throwCatchTestExceptionNoRethrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.throwCatchTestExceptionNoRethrow() @ line = 149 public void art.Test1928$DoThrowCatchTestExceptionNoRethrow.run() @ line = 159 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.run() throws java.lang.Exception @ line = 199 -exception is: art.Test1928$TestException: throwCatchTestExceptionNoRethrow - at art.Test1928.throwCatchTestExceptionNoRethrow(Test1928.java:149) - at art.Test1928$DoThrowCatchTestExceptionNoRethrow.run(Test1928.java:159) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Doing nothing! Test "art.Test1928$DoThrowCatchTestExceptionNoRethrow": Caught error art.Test1928$TestException:"throwCatchTestExceptionNoRethrow" with handler "art.Test1928$DoNothingHandler" -art.Test1928$TestException: throwCatchTestExceptionNoRethrow - at art.Test1928.throwCatchTestExceptionNoRethrow(Test1928.java:149) - at art.Test1928$DoThrowCatchTestExceptionNoRethrow.run(Test1928.java:159) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowCatchTestExceptionNoRethrow": Finished running with handler "art.Test1928$DoNothingHandler" Test "art.Test1928$DoThrowClass": Running with handler "art.Test1928$ThrowCatchBase" main: public static void art.Test1928.doThrow() @ line = 110 throws class art.Test1928$TestException: doThrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.doThrow() @ line = 110 public void art.Test1928$DoThrowClass.run() @ line = 114 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.run() throws java.lang.Exception @ line = 199 -exception is: art.Test1928$TestException: doThrow - at art.Test1928.doThrow(Test1928.java:110) - at art.Test1928$DoThrowClass.run(Test1928.java:114) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Throwing BaseTestException and catching it! Caught art.Test1928$BaseTestException: "ThrowBaseHandler during throw from public static void art.Test1928.doThrow() @ line = 110" -art.Test1928$BaseTestException: ThrowBaseHandler during throw from public static void art.Test1928.doThrow() @ line = 110 - at art.Test1928$ThrowCatchBase.exceptionOccurred(Test1928.java:99) - at art.Test1928.ExceptionEvent(Test1928.java:66) - at art.Test1928.doThrow(Test1928.java:110) - at art.Test1928$DoThrowClass.run(Test1928.java:114) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) -Caused by: art.Test1928$TestException: doThrow - ... 4 more Test "art.Test1928$DoThrowClass": Caught error art.Test1928$TestException:"doThrow" with handler "art.Test1928$ThrowCatchBase" -art.Test1928$TestException: doThrow - at art.Test1928.doThrow(Test1928.java:110) - at art.Test1928$DoThrowClass.run(Test1928.java:114) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowClass": Finished running with handler "art.Test1928$ThrowCatchBase" Test "art.Test1928$DoThrowCatchBaseTestException": Running with handler "art.Test1928$ThrowCatchBase" main: public static void art.Test1928.throwCatchBaseTestException() @ line = 119 throws class art.Test1928$TestException: throwCatchBaseTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.throwCatchBaseTestException() @ line = 119 public void art.Test1928$DoThrowCatchBaseTestException.run() @ line = 129 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.throwCatchBaseTestException() @ line = 120 -exception is: art.Test1928$TestException: throwCatchBaseTestException - at art.Test1928.throwCatchBaseTestException(Test1928.java:119) - at art.Test1928$DoThrowCatchBaseTestException.run(Test1928.java:129) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Throwing BaseTestException and catching it! Caught art.Test1928$BaseTestException: "ThrowBaseHandler during throw from public static void art.Test1928.throwCatchBaseTestException() @ line = 119" -art.Test1928$BaseTestException: ThrowBaseHandler during throw from public static void art.Test1928.throwCatchBaseTestException() @ line = 119 - at art.Test1928$ThrowCatchBase.exceptionOccurred(Test1928.java:99) - at art.Test1928.ExceptionEvent(Test1928.java:66) - at art.Test1928.throwCatchBaseTestException(Test1928.java:119) - at art.Test1928$DoThrowCatchBaseTestException.run(Test1928.java:129) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) -Caused by: art.Test1928$TestException: throwCatchBaseTestException - ... 4 more Caught art.Test1928$TestException: "throwCatchBaseTestException" -art.Test1928$TestException: throwCatchBaseTestException - at art.Test1928.throwCatchBaseTestException(Test1928.java:119) - at art.Test1928$DoThrowCatchBaseTestException.run(Test1928.java:129) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowCatchBaseTestException": No error caught with handler "art.Test1928$ThrowCatchBase" Test "art.Test1928$DoThrowCatchBaseTestException": Finished running with handler "art.Test1928$ThrowCatchBase" Test "art.Test1928$DoThrowCatchTestException": Running with handler "art.Test1928$ThrowCatchBase" main: public static void art.Test1928.throwCatchTestException() @ line = 134 throws class art.Test1928$TestException: throwCatchTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.throwCatchTestException() @ line = 134 public void art.Test1928$DoThrowCatchTestException.run() @ line = 144 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.throwCatchTestException() @ line = 135 -exception is: art.Test1928$TestException: throwCatchTestException - at art.Test1928.throwCatchTestException(Test1928.java:134) - at art.Test1928$DoThrowCatchTestException.run(Test1928.java:144) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Throwing BaseTestException and catching it! Caught art.Test1928$BaseTestException: "ThrowBaseHandler during throw from public static void art.Test1928.throwCatchTestException() @ line = 134" -art.Test1928$BaseTestException: ThrowBaseHandler during throw from public static void art.Test1928.throwCatchTestException() @ line = 134 - at art.Test1928$ThrowCatchBase.exceptionOccurred(Test1928.java:99) - at art.Test1928.ExceptionEvent(Test1928.java:66) - at art.Test1928.throwCatchTestException(Test1928.java:134) - at art.Test1928$DoThrowCatchTestException.run(Test1928.java:144) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) -Caused by: art.Test1928$TestException: throwCatchTestException - ... 4 more Caught art.Test1928$TestException: "throwCatchTestException" -art.Test1928$TestException: throwCatchTestException - at art.Test1928.throwCatchTestException(Test1928.java:134) - at art.Test1928$DoThrowCatchTestException.run(Test1928.java:144) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowCatchTestException": No error caught with handler "art.Test1928$ThrowCatchBase" Test "art.Test1928$DoThrowCatchTestException": Finished running with handler "art.Test1928$ThrowCatchBase" Test "art.Test1928$DoThrowCatchTestExceptionNoRethrow": Running with handler "art.Test1928$ThrowCatchBase" main: public static void art.Test1928.throwCatchTestExceptionNoRethrow() @ line = 149 throws class art.Test1928$TestException: throwCatchTestExceptionNoRethrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1928.PrintStack() @ line = 35 public static void art.Test1928.ExceptionEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable,java.lang.reflect.Executable,long) @ line = 59 public static void art.Test1928.throwCatchTestExceptionNoRethrow() @ line = 149 public void art.Test1928$DoThrowCatchTestExceptionNoRethrow.run() @ line = 159 public static void art.Test1928.run() throws java.lang.Exception @ line = 196 Will be caught by: public static void art.Test1928.run() throws java.lang.Exception @ line = 199 -exception is: art.Test1928$TestException: throwCatchTestExceptionNoRethrow - at art.Test1928.throwCatchTestExceptionNoRethrow(Test1928.java:149) - at art.Test1928$DoThrowCatchTestExceptionNoRethrow.run(Test1928.java:159) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Throwing BaseTestException and catching it! Caught art.Test1928$BaseTestException: "ThrowBaseHandler during throw from public static void art.Test1928.throwCatchTestExceptionNoRethrow() @ line = 149" -art.Test1928$BaseTestException: ThrowBaseHandler during throw from public static void art.Test1928.throwCatchTestExceptionNoRethrow() @ line = 149 - at art.Test1928$ThrowCatchBase.exceptionOccurred(Test1928.java:99) - at art.Test1928.ExceptionEvent(Test1928.java:66) - at art.Test1928.throwCatchTestExceptionNoRethrow(Test1928.java:149) - at art.Test1928$DoThrowCatchTestExceptionNoRethrow.run(Test1928.java:159) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) -Caused by: art.Test1928$TestException: throwCatchTestExceptionNoRethrow - ... 4 more Test "art.Test1928$DoThrowCatchTestExceptionNoRethrow": Caught error art.Test1928$TestException:"throwCatchTestExceptionNoRethrow" with handler "art.Test1928$ThrowCatchBase" -art.Test1928$TestException: throwCatchTestExceptionNoRethrow - at art.Test1928.throwCatchTestExceptionNoRethrow(Test1928.java:149) - at art.Test1928$DoThrowCatchTestExceptionNoRethrow.run(Test1928.java:159) - at art.Test1928.run(Test1928.java:196) - at Main.main(Main.java:19) Test "art.Test1928$DoThrowCatchTestExceptionNoRethrow": Finished running with handler "art.Test1928$ThrowCatchBase" diff --git a/test/1928-exception-event-exception/src/art/StackTrace.java b/test/1928-exception-event-exception/src/art/StackTrace.java index b12c3df66b..2ea2f201e8 100644 --- a/test/1928-exception-event-exception/src/art/StackTrace.java +++ b/test/1928-exception-event-exception/src/art/StackTrace.java @@ -53,7 +53,8 @@ public class StackTrace { // consistent we will suspend for the RI. boolean suspend_thread = !System.getProperty("java.vm.name").equals("Dalvik") && - !thr.equals(Thread.currentThread()); + !thr.equals(Thread.currentThread()) && + !Suspension.isSuspended(thr); if (suspend_thread) { Suspension.suspend(thr); } diff --git a/test/1928-exception-event-exception/src/art/Test1928.java b/test/1928-exception-event-exception/src/art/Test1928.java index aec88a4079..864de8ea4d 100644 --- a/test/1928-exception-event-exception/src/art/Test1928.java +++ b/test/1928-exception-event-exception/src/art/Test1928.java @@ -22,7 +22,7 @@ import java.lang.reflect.Executable; import java.lang.reflect.Method; public class Test1928 { - public static boolean PRINT_FULL_EXCEPTION = true; + public static boolean PRINT_FULL_EXCEPTION = false; public static ExceptionHandler HANDLER = null; public static interface ExceptionHandler { diff --git a/test/1929-exception-catch-exception/expected.txt b/test/1929-exception-catch-exception/expected.txt index 7c23a31439..bc5608ac4e 100644 --- a/test/1929-exception-catch-exception/expected.txt +++ b/test/1929-exception-catch-exception/expected.txt @@ -2,7 +2,7 @@ Test "art.Test1929$DoThrowClass": Running breakpoint with handler "art.Test1929$ main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: doThrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 @@ -12,7 +12,7 @@ Test "art.Test1929$DoThrowCatchBaseTestException": Running breakpoint with handl main: public static void art.Test1929.throwCatchBaseTestException() @ line = 140 caught class art.Test1929$TestException: throwCatchBaseTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchBaseTestException() @ line = 140 @@ -26,7 +26,7 @@ Test "art.Test1929$DoThrowCatchBaseTestExceptionTwice": Running breakpoint with main: public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 caught class art.Test1929$TestException: throwCatchBaseTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 @@ -40,7 +40,7 @@ Test "art.Test1929$DoThrowCatchTestException": Running breakpoint with handler " main: public static void art.Test1929.throwCatchTestException() @ line = 207 caught class art.Test1929$TestException: throwCatchTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchTestException() @ line = 207 @@ -54,7 +54,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionTwice": Running breakpoint with hand main: public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 caught class art.Test1929$TestException: throwCatchTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 @@ -68,7 +68,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionNoRethrow": Running breakpoint with main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: throwCatchTestExceptionNoRethrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 @@ -78,7 +78,7 @@ Test "art.Test1929$DoThrowClass": Running breakpoint with handler "art.Test1929$ main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: doThrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 @@ -88,7 +88,7 @@ Test "art.Test1929$DoThrowCatchBaseTestException": Running breakpoint with handl main: public static void art.Test1929.throwCatchBaseTestException() @ line = 140 caught class art.Test1929$TestException: throwCatchBaseTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchBaseTestException() @ line = 140 @@ -103,7 +103,7 @@ Test "art.Test1929$DoThrowCatchBaseTestExceptionTwice": Running breakpoint with main: public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 caught class art.Test1929$TestException: throwCatchBaseTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 @@ -117,7 +117,7 @@ Test "art.Test1929$DoThrowCatchTestException": Running breakpoint with handler " main: public static void art.Test1929.throwCatchTestException() @ line = 207 caught class art.Test1929$TestException: throwCatchTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchTestException() @ line = 207 @@ -132,7 +132,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionTwice": Running breakpoint with hand main: public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 caught class art.Test1929$TestException: throwCatchTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 @@ -146,7 +146,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionNoRethrow": Running breakpoint with main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: throwCatchTestExceptionNoRethrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 @@ -156,7 +156,7 @@ Test "art.Test1929$DoThrowClass": Running breakpoint with handler "art.Test1929$ main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: doThrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 @@ -166,7 +166,7 @@ Test "art.Test1929$DoThrowCatchBaseTestException": Running breakpoint with handl main: public static void art.Test1929.throwCatchBaseTestException() @ line = 140 caught class art.Test1929$TestException: throwCatchBaseTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchBaseTestException() @ line = 140 @@ -179,7 +179,7 @@ Test "art.Test1929$DoThrowCatchBaseTestExceptionTwice": Running breakpoint with main: public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 caught class art.Test1929$TestException: throwCatchBaseTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 @@ -193,7 +193,7 @@ Test "art.Test1929$DoThrowCatchTestException": Running breakpoint with handler " main: public static void art.Test1929.throwCatchTestException() @ line = 207 caught class art.Test1929$TestException: throwCatchTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchTestException() @ line = 207 @@ -206,7 +206,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionTwice": Running breakpoint with hand main: public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 caught class art.Test1929$TestException: throwCatchTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 @@ -220,7 +220,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionNoRethrow": Running breakpoint with main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: throwCatchTestExceptionNoRethrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 @@ -230,7 +230,7 @@ Test "art.Test1929$DoThrowClass": Running breakpoint with handler "art.Test1929$ main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: doThrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 @@ -240,7 +240,7 @@ Test "art.Test1929$DoThrowCatchBaseTestException": Running breakpoint with handl main: public static void art.Test1929.throwCatchBaseTestException() @ line = 140 caught class art.Test1929$TestException: throwCatchBaseTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchBaseTestException() @ line = 140 @@ -253,7 +253,7 @@ Test "art.Test1929$DoThrowCatchBaseTestExceptionTwice": Running breakpoint with main: public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 caught class art.Test1929$TestException: throwCatchBaseTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchBaseTestExceptionTwiceImpl() @ line = 161 @@ -267,7 +267,7 @@ Test "art.Test1929$DoThrowCatchTestException": Running breakpoint with handler " main: public static void art.Test1929.throwCatchTestException() @ line = 207 caught class art.Test1929$TestException: throwCatchTestException Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.throwCatchTestException() @ line = 207 @@ -280,7 +280,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionTwice": Running breakpoint with hand main: public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 caught class art.Test1929$TestException: throwCatchTestExceptionTwice Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929$Impl.throwCatchTestExceptionTwiceImpl() @ line = 179 @@ -294,7 +294,7 @@ Test "art.Test1929$DoThrowCatchTestExceptionNoRethrow": Running breakpoint with main: public static void art.Test1929.run() throws java.lang.Exception @ line = 283 caught class art.Test1929$TestException: throwCatchTestExceptionNoRethrow Current Stack: private static native art.StackTrace$StackFrameData[] art.StackTrace.nativeGetStackTrace(java.lang.Thread) @ line = -1 - public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 60 + public static art.StackTrace$StackFrameData[] art.StackTrace.GetStackTrace(java.lang.Thread) @ line = 61 private static void art.Test1929.PrintStack() @ line = 52 public static void art.Test1929.ExceptionCatchEvent(java.lang.Thread,java.lang.reflect.Executable,long,java.lang.Throwable) @ line = 65 public static void art.Test1929.run() throws java.lang.Exception @ line = 283 diff --git a/test/1929-exception-catch-exception/src/art/StackTrace.java b/test/1929-exception-catch-exception/src/art/StackTrace.java index b12c3df66b..2ea2f201e8 100644 --- a/test/1929-exception-catch-exception/src/art/StackTrace.java +++ b/test/1929-exception-catch-exception/src/art/StackTrace.java @@ -53,7 +53,8 @@ public class StackTrace { // consistent we will suspend for the RI. boolean suspend_thread = !System.getProperty("java.vm.name").equals("Dalvik") && - !thr.equals(Thread.currentThread()); + !thr.equals(Thread.currentThread()) && + !Suspension.isSuspended(thr); if (suspend_thread) { Suspension.suspend(thr); } diff --git a/test/1937-transform-soft-fail/check b/test/1937-transform-soft-fail/check deleted file mode 100755 index 7cee530291..0000000000 --- a/test/1937-transform-soft-fail/check +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2017 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -sed -e 's/:.*$//' "$2" > "$2.tmp" - -./default-check "$1" "$2.tmp" diff --git a/test/1937-transform-soft-fail/src/art/Test1937.java b/test/1937-transform-soft-fail/src/art/Test1937.java index 7255a5ef96..19fa24e3f8 100644 --- a/test/1937-transform-soft-fail/src/art/Test1937.java +++ b/test/1937-transform-soft-fail/src/art/Test1937.java @@ -19,6 +19,8 @@ package art; import java.util.Base64; public class Test1937 { + private static final boolean PRINT_MESSAGE = false; + static class Transform { public void sayHi() { // Use lower 'h' to make sure the string will have a different string id @@ -83,7 +85,10 @@ public class Test1937 { try { t.sayHi(); } catch (Throwable e) { - System.out.println("Caught exception " + e.getClass().getName() + ": " + e.getMessage()); + System.out.println("Caught exception " + e.getClass().getName()); + if (PRINT_MESSAGE) { + System.out.println("Message: " + e.getMessage()); + } } } } diff --git a/test/1939-proxy-frames/expected.txt b/test/1939-proxy-frames/expected.txt index a4c97c9bbe..3aafd16a08 100644 --- a/test/1939-proxy-frames/expected.txt +++ b/test/1939-proxy-frames/expected.txt @@ -5,4 +5,4 @@ Running public abstract void art.Test1939$Foo.InterfaceProxyMethod(java.lang.Run Running public abstract void art.Test1939$Foo.InterfaceProxyMethod(java.lang.Runnable) with "GetProxyFrameLocation" on remote thread. "GetProxyFrameLocation" on public abstract void art.Test1939$Foo.InterfaceProxyMethod(java.lang.Runnable) got value: -1 Running public abstract void art.Test1939$Foo.InterfaceProxyMethod(java.lang.Runnable) with "GetProxyFrameMethod" on remote thread. -"GetProxyFrameMethod" on public abstract void art.Test1939$Foo.InterfaceProxyMethod(java.lang.Runnable) got value: public final void $Proxy0.InterfaceProxyMethod(java.lang.Runnable) +"GetProxyFrameMethod" on public abstract void art.Test1939$Foo.InterfaceProxyMethod(java.lang.Runnable) got value: public final void $__PROXY__.InterfaceProxyMethod(java.lang.Runnable) diff --git a/test/1939-proxy-frames/src/art/Test1939.java b/test/1939-proxy-frames/src/art/Test1939.java index 83d0d2ca4b..5e86e54c0d 100644 --- a/test/1939-proxy-frames/src/art/Test1939.java +++ b/test/1939-proxy-frames/src/art/Test1939.java @@ -44,12 +44,22 @@ public class Test1939 { public Object GetVar(Thread t, int depth); } + public static String SafeToString(Object o) { + if (o instanceof Method && Proxy.isProxyClass(((Method)o).getDeclaringClass())) { + // TODO This currently only really works on ART. It would be good if we could make it work for + // the RI as well. + return o.toString().replaceFirst("Proxy[0-9]+", "__PROXY__"); + } else { + return o.toString(); + } + } + public static SafepointFunction NamedGet(final String type, final GetterFunction get) { return new SafepointFunction() { public void invoke(Thread t, Method method, int depth) { try { Object res = get.GetVar(t, depth); - System.out.println(this + " on " + method + " got value: " + res); + System.out.println(this + " on " + method + " got value: " + SafeToString(res)); } catch (Exception e) { System.out.println(this + " on " + method + " failed due to " + e.getMessage()); } diff --git a/test/670-bitstring-type-check/build b/test/670-bitstring-type-check/build new file mode 100644 index 0000000000..38307f2c0f --- /dev/null +++ b/test/670-bitstring-type-check/build @@ -0,0 +1,216 @@ +#!/bin/bash +# +# Copyright (C) 2018 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Stop if something fails. +set -e + +# Write out the source file. + +mkdir src +cat >src/Main.java <<EOF +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +EOF + +for i in {0..8192}; do echo "class Level1Class$i { }" >>src/Main.java; done +for i in {0..1024}; do echo "class Level2Class$i extends Level1Class0 { }" >>src/Main.java; done + +cat >>src/Main.java <<EOF +class Level3Class0 extends Level2Class0 { } +class Level4Class0 extends Level3Class0 { } +class Level5Class0 extends Level4Class0 { } +class Level6Class0 extends Level5Class0 { } +class Level7Class0 extends Level6Class0 { } +class Level8Class0 extends Level7Class0 { } +class Level9Class0 extends Level8Class0 { } + +public class Main { + public static void main(String[] args) throws Exception { + // 8193 classes at level 1 make sure we shall have an overflow if there are 13 or + // less bits for the level 1 character. 1025 classes at level 2 similarly guarantees + // an overflow if the number of bits for level 2 character is 10 or less. To test + // type checks also for the depth overflow, we provide a hierarchy 9 levels deep. + + // Make sure the bitstrings are initialized. + for (int i = 0; i <= 8192; ++i) { + Class.forName("Level1Class" + i).newInstance(); + } + for (int i = 0; i <= 1024; ++i) { + Class.forName("Level2Class" + i).newInstance(); + } + + // Note: Using a different class for tests so that verification of Main.main() does + // not try to resolve classes used by the tests. This guarantees uninitialized type + // check bitstrings when we enter Main.main() and start initializing them above. + Helper.testInstanceOf(); + Helper.testCheckCast(); + } +} + +class Helper { + public static void testInstanceOf() throws Exception { + for (int i = 1; i <= 9; ++i) { + Object o = createInstance("Level" + i + "Class0"); + assertTrue(o instanceof Level1Class0); + if (o instanceof Level2Class0) { + assertFalse(i < 2); + } else { + assertTrue(i < 2); + } + if (o instanceof Level3Class0) { + assertFalse(i < 3); + } else { + assertTrue(i < 3); + } + if (o instanceof Level4Class0) { + assertFalse(i < 4); + } else { + assertTrue(i < 4); + } + if (o instanceof Level5Class0) { + assertFalse(i < 5); + } else { + assertTrue(i < 5); + } + if (o instanceof Level6Class0) { + assertFalse(i < 6); + } else { + assertTrue(i < 6); + } + if (o instanceof Level7Class0) { + assertFalse(i < 7); + } else { + assertTrue(i < 7); + } + if (o instanceof Level8Class0) { + assertFalse(i < 8); + } else { + assertTrue(i < 8); + } + if (o instanceof Level9Class0) { + assertFalse(i < 9); + } else { + assertTrue(i < 9); + } + } + + assertTrue(createInstance("Level1Class8192") instanceof Level1Class8192); + assertFalse(createInstance("Level1Class8192") instanceof Level1Class0); + assertTrue(createInstance("Level2Class1024") instanceof Level2Class1024); + assertTrue(createInstance("Level2Class1024") instanceof Level1Class0); + assertFalse(createInstance("Level2Class1024") instanceof Level2Class0); + } + + public static void testCheckCast() throws Exception { + for (int i = 1; i <= 9; ++i) { + Object o = createInstance("Level" + i + "Class0"); + Level1Class0 l1c0 = (Level1Class0) o; + try { + Level2Class0 l2c0 = (Level2Class0) o; + assertFalse(i < 2); + } catch (ClassCastException cce) { + assertTrue(i < 2); + } + try { + Level3Class0 l3c0 = (Level3Class0) o; + assertFalse(i < 3); + } catch (ClassCastException cce) { + assertTrue(i < 3); + } + try { + Level4Class0 l4c0 = (Level4Class0) o; + assertFalse(i < 4); + } catch (ClassCastException cce) { + assertTrue(i < 4); + } + try { + Level5Class0 l5c0 = (Level5Class0) o; + assertFalse(i < 5); + } catch (ClassCastException cce) { + assertTrue(i < 5); + } + try { + Level6Class0 l6c0 = (Level6Class0) o; + assertFalse(i < 6); + } catch (ClassCastException cce) { + assertTrue(i < 6); + } + try { + Level7Class0 l7c0 = (Level7Class0) o; + assertFalse(i < 7); + } catch (ClassCastException cce) { + assertTrue(i < 7); + } + try { + Level8Class0 l8c0 = (Level8Class0) o; + assertFalse(i < 8); + } catch (ClassCastException cce) { + assertTrue(i < 8); + } + try { + Level9Class0 l9c0 = (Level9Class0) o; + assertFalse(i < 9); + } catch (ClassCastException cce) { + assertTrue(i < 9); + } + } + + Level1Class8192 l1c8192 = (Level1Class8192) createInstance("Level1Class8192"); + try { + Level1Class0 l1c0 = (Level1Class0) createInstance("Level1Class8192"); + throw new AssertionError("Unexpected"); + } catch (ClassCastException expected) {} + Level2Class1024 l2c1024 = (Level2Class1024) createInstance("Level2Class1024"); + Level1Class0 l1c0 = (Level1Class0) createInstance("Level2Class1024"); + try { + Level2Class0 l2c0 = (Level2Class0) createInstance("Level2Class1024"); + throw new AssertionError("Unexpected"); + } catch (ClassCastException expected) {} + } + + public static Object createInstance(String className) throws Exception { + return Class.forName(className).newInstance(); + } + + public static void assertTrue(boolean value) throws Exception { + if (!value) { + throw new AssertionError(); + } + } + + public static void assertFalse(boolean value) throws Exception { + if (value) { + throw new AssertionError(); + } + } +} +EOF + +./default-build "$@" diff --git a/test/670-bitstring-type-check/expected.txt b/test/670-bitstring-type-check/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/670-bitstring-type-check/expected.txt diff --git a/test/670-bitstring-type-check/info.txt b/test/670-bitstring-type-check/info.txt new file mode 100644 index 0000000000..a34ba86171 --- /dev/null +++ b/test/670-bitstring-type-check/info.txt @@ -0,0 +1 @@ +Tests for the bitstring type checks. diff --git a/test/988-TooDeepClassInstanceOf/expected.txt b/test/805-TooDeepClassInstanceOf/expected.txt index b0aad4deb5..b0aad4deb5 100644 --- a/test/988-TooDeepClassInstanceOf/expected.txt +++ b/test/805-TooDeepClassInstanceOf/expected.txt diff --git a/test/988-TooDeepClassInstanceOf/info.txt b/test/805-TooDeepClassInstanceOf/info.txt index 390b00d122..390b00d122 100644 --- a/test/988-TooDeepClassInstanceOf/info.txt +++ b/test/805-TooDeepClassInstanceOf/info.txt diff --git a/test/988-TooDeepClassInstanceOf/src/Main.java b/test/805-TooDeepClassInstanceOf/src/Main.java index 93a41e565b..93a41e565b 100644 --- a/test/988-TooDeepClassInstanceOf/src/Main.java +++ b/test/805-TooDeepClassInstanceOf/src/Main.java diff --git a/test/988-TooWideClassInstanceOf/expected.txt b/test/806-TooWideClassInstanceOf/expected.txt index b0aad4deb5..b0aad4deb5 100644 --- a/test/988-TooWideClassInstanceOf/expected.txt +++ b/test/806-TooWideClassInstanceOf/expected.txt diff --git a/test/988-TooWideClassInstanceOf/info.txt b/test/806-TooWideClassInstanceOf/info.txt index 30546fe076..30546fe076 100644 --- a/test/988-TooWideClassInstanceOf/info.txt +++ b/test/806-TooWideClassInstanceOf/info.txt diff --git a/test/988-TooWideClassInstanceOf/src/Main.java b/test/806-TooWideClassInstanceOf/src/Main.java index 332569c104..332569c104 100644 --- a/test/988-TooWideClassInstanceOf/src/Main.java +++ b/test/806-TooWideClassInstanceOf/src/Main.java diff --git a/test/990-method-handle-and-mr/build b/test/807-method-handle-and-mr/build index 12a8e18d0b..12a8e18d0b 100755 --- a/test/990-method-handle-and-mr/build +++ b/test/807-method-handle-and-mr/build diff --git a/test/990-method-handle-and-mr/expected.txt b/test/807-method-handle-and-mr/expected.txt index 8483fb5045..8483fb5045 100644 --- a/test/990-method-handle-and-mr/expected.txt +++ b/test/807-method-handle-and-mr/expected.txt diff --git a/test/990-method-handle-and-mr/info.txt b/test/807-method-handle-and-mr/info.txt index 85a957ceea..85a957ceea 100644 --- a/test/990-method-handle-and-mr/info.txt +++ b/test/807-method-handle-and-mr/info.txt diff --git a/test/990-method-handle-and-mr/src/Main.java b/test/807-method-handle-and-mr/src/Main.java index 739b8eb551..739b8eb551 100644 --- a/test/990-method-handle-and-mr/src/Main.java +++ b/test/807-method-handle-and-mr/src/Main.java diff --git a/test/912-classes/src-art/art/Test912.java b/test/912-classes/src-art/art/Test912.java index ddfadf3626..1a60185f49 100644 --- a/test/912-classes/src-art/art/Test912.java +++ b/test/912-classes/src-art/art/Test912.java @@ -398,6 +398,7 @@ public class Test912 { public static double dummy = Math.random(); // So it can't be compile-time initialized. } + @SuppressWarnings("RandomCast") private static class TestForInitFail { public static int dummy = ((int)Math.random())/0; // So it throws when initializing. } diff --git a/test/983-source-transform-verify/source_transform.cc b/test/983-source-transform-verify/source_transform.cc index dfefce207b..9e65a9964c 100644 --- a/test/983-source-transform-verify/source_transform.cc +++ b/test/983-source-transform-verify/source_transform.cc @@ -14,30 +14,13 @@ * limitations under the License. */ -#include <inttypes.h> +#include "source_transform.h" -#include <cstdio> -#include <cstring> -#include <iostream> -#include <vector> +#include "jni.h" #include "android-base/stringprintf.h" -#include "jni.h" #include "jvmti.h" - -#include "base/macros.h" -#include "bytecode_utils.h" -#include "dex/code_item_accessors-inl.h" -#include "dex/art_dex_file_loader.h" -#include "dex/dex_file.h" -#include "dex/dex_file_loader.h" -#include "dex/dex_instruction.h" -#include "jit/jit.h" -#include "native_stack_dump.h" -#include "runtime.h" -#include "scoped_thread_state_change-inl.h" -#include "thread-current-inl.h" -#include "thread_list.h" +#include "scoped_local_ref.h" // Test infrastructure #include "jvmti_helper.h" @@ -48,9 +31,18 @@ namespace Test983SourceTransformVerify { constexpr bool kSkipInitialLoad = true; +static void Println(JNIEnv* env, const char* msg) { + ScopedLocalRef<jclass> test_klass(env, env->FindClass("art/Test983")); + jmethodID println_method = env->GetStaticMethodID(test_klass.get(), + "doPrintln", + "(Ljava/lang/String;)V"); + ScopedLocalRef<jstring> data(env, env->NewStringUTF(msg)); + env->CallStaticVoidMethod(test_klass.get(), println_method, data.get()); +} + // The hook we are using. void JNICALL CheckDexFileHook(jvmtiEnv* jvmti_env ATTRIBUTE_UNUSED, - JNIEnv* jni_env ATTRIBUTE_UNUSED, + JNIEnv* env, jclass class_being_redefined, jobject loader ATTRIBUTE_UNUSED, const char* name, @@ -60,78 +52,24 @@ void JNICALL CheckDexFileHook(jvmtiEnv* jvmti_env ATTRIBUTE_UNUSED, jint* new_class_data_len ATTRIBUTE_UNUSED, unsigned char** new_class_data ATTRIBUTE_UNUSED) { if (kSkipInitialLoad && class_being_redefined == nullptr) { - // Something got loaded concurrently. Just ignore it for now. + // Something got loaded concurrently. Just ignore it for now. To make sure the test is + // repeatable we only care about things that come from RetransformClasses. return; } - std::cout << "Dex file hook for " << name << std::endl; + Println(env, android::base::StringPrintf("Dex file hook for %s", name).c_str()); if (IsJVM()) { return; } - // Due to b/72402467 the class_data_len might just be an estimate. - CHECK_GE(static_cast<size_t>(class_data_len), sizeof(DexFile::Header)); - const DexFile::Header* header = reinterpret_cast<const DexFile::Header*>(class_data); - uint32_t header_file_size = header->file_size_; - CHECK_LE(static_cast<jint>(header_file_size), class_data_len); - class_data_len = static_cast<jint>(header_file_size); - - const ArtDexFileLoader dex_file_loader; - std::string error; - std::unique_ptr<const DexFile> dex(dex_file_loader.Open(class_data, - class_data_len, - "fake_location.dex", - /*location_checksum*/ 0, - /*oat_dex_file*/ nullptr, - /*verify*/ true, - /*verify_checksum*/ true, - &error)); - if (dex.get() == nullptr) { - std::cout << "Failed to verify dex file for " << name << " because " << error << std::endl; - return; - } - for (uint32_t i = 0; i < dex->NumClassDefs(); i++) { - const DexFile::ClassDef& def = dex->GetClassDef(i); - const uint8_t* data_item = dex->GetClassData(def); - if (data_item == nullptr) { - continue; - } - for (ClassDataItemIterator it(*dex, data_item); it.HasNext(); it.Next()) { - if (!it.IsAtMethod() || it.GetMethodCodeItem() == nullptr) { - continue; - } - for (const DexInstructionPcPair& pair : - art::CodeItemInstructionAccessor(*dex, it.GetMethodCodeItem())) { - const Instruction& inst = pair.Inst(); - int forbiden_flags = (Instruction::kVerifyError | Instruction::kVerifyRuntimeOnly); - if (inst.Opcode() == Instruction::RETURN_VOID_NO_BARRIER || - (inst.GetVerifyExtraFlags() & forbiden_flags) != 0) { - std::cout << "Unexpected instruction found in " << dex->PrettyMethod(it.GetMemberIndex()) - << " [Dex PC: 0x" << std::hex << pair.DexPc() << std::dec << "] : " - << inst.DumpString(dex.get()) << std::endl; - continue; - } - } - } - } + VerifyClassData(class_data_len, class_data); } // Get all capabilities except those related to retransformation. -jint OnLoad(JavaVM* vm, - char* options ATTRIBUTE_UNUSED, - void* reserved ATTRIBUTE_UNUSED) { - if (vm->GetEnv(reinterpret_cast<void**>(&jvmti_env), JVMTI_VERSION_1_0)) { - printf("Unable to get jvmti env!\n"); - return 1; - } - SetStandardCapabilities(jvmti_env); +extern "C" JNIEXPORT void JNICALL Java_art_Test983_setupLoadHook(JNIEnv* env, jclass) { jvmtiEventCallbacks cb; memset(&cb, 0, sizeof(cb)); cb.ClassFileLoadHook = CheckDexFileHook; - if (jvmti_env->SetEventCallbacks(&cb, sizeof(cb)) != JVMTI_ERROR_NONE) { - printf("Unable to set class file load hook cb!\n"); - return 1; - } - return 0; + JvmtiErrorToException(env, jvmti_env, jvmti_env->SetEventCallbacks(&cb, sizeof(cb))); } } // namespace Test983SourceTransformVerify diff --git a/test/983-source-transform-verify/source_transform.h b/test/983-source-transform-verify/source_transform.h index db9415aec1..2206498cc3 100644 --- a/test/983-source-transform-verify/source_transform.h +++ b/test/983-source-transform-verify/source_transform.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 The Android Open Source Project + * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ namespace art { namespace Test983SourceTransformVerify { -jint OnLoad(JavaVM* vm, char* options, void* reserved); +void VerifyClassData(jint class_data_len, const unsigned char* class_data); } // namespace Test983SourceTransformVerify } // namespace art diff --git a/test/983-source-transform-verify/source_transform_art.cc b/test/983-source-transform-verify/source_transform_art.cc new file mode 100644 index 0000000000..5353370ac6 --- /dev/null +++ b/test/983-source-transform-verify/source_transform_art.cc @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "source_transform.h" + +#include <inttypes.h> + +#include <memory> + +#include <android-base/logging.h> + +#include "dex/code_item_accessors-inl.h" +#include "dex/art_dex_file_loader.h" +#include "dex/dex_file.h" +#include "dex/dex_file_loader.h" +#include "dex/dex_instruction.h" + +namespace art { +namespace Test983SourceTransformVerify { + +// The hook we are using. +void VerifyClassData(jint class_data_len, const unsigned char* class_data) { + // Due to b/72402467 the class_data_len might just be an estimate. + CHECK_GE(static_cast<size_t>(class_data_len), sizeof(DexFile::Header)); + const DexFile::Header* header = reinterpret_cast<const DexFile::Header*>(class_data); + uint32_t header_file_size = header->file_size_; + CHECK_LE(static_cast<jint>(header_file_size), class_data_len); + class_data_len = static_cast<jint>(header_file_size); + + const ArtDexFileLoader dex_file_loader; + std::string error; + std::unique_ptr<const DexFile> dex(dex_file_loader.Open(class_data, + class_data_len, + "fake_location.dex", + /*location_checksum*/ 0, + /*oat_dex_file*/ nullptr, + /*verify*/ true, + /*verify_checksum*/ true, + &error)); + CHECK(dex.get() != nullptr) << "Failed to verify dex: " << error; + for (uint32_t i = 0; i < dex->NumClassDefs(); i++) { + const DexFile::ClassDef& def = dex->GetClassDef(i); + const uint8_t* data_item = dex->GetClassData(def); + if (data_item == nullptr) { + continue; + } + for (ClassDataItemIterator it(*dex, data_item); it.HasNext(); it.Next()) { + if (!it.IsAtMethod() || it.GetMethodCodeItem() == nullptr) { + continue; + } + for (const DexInstructionPcPair& pair : + art::CodeItemInstructionAccessor(*dex, it.GetMethodCodeItem())) { + const Instruction& inst = pair.Inst(); + int forbidden_flags = (Instruction::kVerifyError | Instruction::kVerifyRuntimeOnly); + if (inst.Opcode() == Instruction::RETURN_VOID_NO_BARRIER || + (inst.GetVerifyExtraFlags() & forbidden_flags) != 0) { + LOG(FATAL) << "Unexpected instruction found in " << dex->PrettyMethod(it.GetMemberIndex()) + << " [Dex PC: 0x" << std::hex << pair.DexPc() << std::dec << "] : " + << inst.DumpString(dex.get()) << std::endl; + } + } + } + } +} + +} // namespace Test983SourceTransformVerify +} // namespace art diff --git a/test/983-source-transform-verify/source_transform_slicer.cc b/test/983-source-transform-verify/source_transform_slicer.cc new file mode 100644 index 0000000000..abf32e752e --- /dev/null +++ b/test/983-source-transform-verify/source_transform_slicer.cc @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "source_transform.h" + +#pragma clang diagnostic push +// slicer defines its own CHECK. b/65422458 +#pragma push_macro("CHECK") +#undef CHECK + +// Slicer's headers have code that triggers these warnings. b/65298177 +#pragma clang diagnostic ignored "-Wsign-compare" +#include "reader.h" + +#pragma pop_macro("CHECK") +#pragma clang diagnostic pop + +namespace art { +namespace Test983SourceTransformVerify { + +// The hook we are using. +void VerifyClassData(jint class_data_len, const unsigned char* class_data) { + dex::Reader reader(class_data, class_data_len); + reader.CreateFullIr(); // This will verify all bytecode. +} + +} // namespace Test983SourceTransformVerify +} // namespace art diff --git a/test/983-source-transform-verify/src/art/Test983.java b/test/983-source-transform-verify/src/art/Test983.java index faae96aef6..7dc47ab06a 100644 --- a/test/983-source-transform-verify/src/art/Test983.java +++ b/test/983-source-transform-verify/src/art/Test983.java @@ -27,7 +27,15 @@ public class Test983 { doTest(); } + private native static void setupLoadHook(); + + /* called from JNI */ + public static void doPrintln(String str) { + System.out.println(str); + } + public static void doTest() { + setupLoadHook(); Redefinition.enableCommonRetransformation(true); Redefinition.doCommonClassRetransformation(Transform.class); Redefinition.doCommonClassRetransformation(Object.class); diff --git a/test/993-breakpoints/src/art/Breakpoint.java b/test/993-breakpoints/src/art/Breakpoint.java index 2a370ebd40..bbb89f707f 100644 --- a/test/993-breakpoints/src/art/Breakpoint.java +++ b/test/993-breakpoints/src/art/Breakpoint.java @@ -117,7 +117,7 @@ public class Breakpoint { Thread thr); public static native void stopBreakpointWatch(Thread thr); - public static final class LineNumber { + public static final class LineNumber implements Comparable<LineNumber> { public final long location; public final int line; diff --git a/test/Android.bp b/test/Android.bp index d2eeee481f..902f4edf8f 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -62,7 +62,7 @@ art_cc_defaults { "libvixld-arm", "libvixld-arm64", "libart-gtest", - "libdexfile", + "libdexfiled", "libbase", "libicuuc", @@ -114,7 +114,7 @@ art_cc_defaults { shared_libs: [ "libartd", "libartd-compiler", - "libdexfile", + "libdexfiled", ], static_libs: [ "libgtest", @@ -151,7 +151,7 @@ art_cc_library { shared_libs: [ "libartd", "libartd-compiler", - "libdexfile", + "libdexfiled", "libbase", "libbacktrace", ], @@ -238,6 +238,7 @@ art_cc_defaults { "931-agent-thread/agent_thread.cc", "933-misc-events/misc_events.cc", "945-obsolete-native/obsolete_native.cc", + "983-source-transform-verify/source_transform.cc", "984-obsolete-invoke/obsolete_invoke.cc", "986-native-method-bind/native_bind.cc", "987-agent-bind/agent_bind.cc", @@ -288,20 +289,22 @@ art_cc_defaults { "909-attach-agent/attach.cc", "912-classes/classes_art.cc", "936-search-onload/search_onload.cc", - "983-source-transform-verify/source_transform.cc", + "983-source-transform-verify/source_transform_art.cc", "1940-ddms-ext/ddm_ext.cc", "1944-sudden-exit/sudden_exit.cc", ], shared_libs: [ "libbase", - "libdexfile", ], } art_cc_test_library { name: "libtiagent", defaults: ["libtiagent-defaults"], - shared_libs: ["libart"], + shared_libs: [ + "libart", + "libdexfile", + ], } art_cc_test_library { @@ -310,24 +313,32 @@ art_cc_test_library { "art_debug_defaults", "libtiagent-defaults", ], - shared_libs: ["libartd"], + shared_libs: [ + "libartd", + "libdexfiled", + ], } -art_cc_test_library { +cc_library_static { name: "libctstiagent", defaults: ["libtiagent-base-defaults"], + host_supported: false, + srcs: [ + "983-source-transform-verify/source_transform_slicer.cc", + ], whole_static_libs: [ - "libdexfile", - "libz", - "libziparchive", + "slicer", + "libz", // for slicer (using adler32). ], static_libs: [ "libbase", - "libcutils", - "libutils", ], - shared_libs: [ - "liblog", + header_libs: [ + // This is needed to resolve the base/ header file in libdexfile. Unfortunately there are + // many problems with how we export headers that are making doing this the 'right' way + // difficult. + // TODO: move those headers to art/ rather than under runtime. + "libart_runtime_headers", ], export_include_dirs: ["ti-agent"], } @@ -414,7 +425,6 @@ cc_defaults { "common/stack_inspect.cc", ], shared_libs: [ - "libdexfile", "libbacktrace", "libbase", "libnativehelper", @@ -424,7 +434,10 @@ cc_defaults { art_cc_test_library { name: "libarttest", defaults: ["libarttest-defaults"], - shared_libs: ["libart"], + shared_libs: [ + "libart", + "libdexfile", + ], } art_cc_test_library { @@ -433,7 +446,10 @@ art_cc_test_library { "art_debug_defaults", "libarttest-defaults", ], - shared_libs: ["libartd"], + shared_libs: [ + "libartd", + "libdexfiled", + ], } art_cc_test_library { diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index bb6ace1b06..b8427f491b 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -850,7 +850,7 @@ if [ "$HOST" = "n" ]; then fi # System libraries needed by libarttestd.so - PUBLIC_LIBS=libart.so:libartd.so:libc++.so:libbacktrace.so:libdexfile.so:libbase.so:libnativehelper.so + PUBLIC_LIBS=libart.so:libartd.so:libc++.so:libbacktrace.so:libdexfile.so:libdexfiled.so:libbase.so:libnativehelper.so # Create a script with the command. The command can get longer than the longest # allowed adb command and there is no way to get the exit status from a adb shell diff --git a/test/knownfailures.json b/test/knownfailures.json index 8b5c63425c..ddf9098c64 100644 --- a/test/knownfailures.json +++ b/test/knownfailures.json @@ -377,12 +377,6 @@ "variant": "jvmti-stress & jit | redefine-stress & jit" }, { - "test_patterns": ["674-hiddenapi"], - "description": ["hiddenapi test is failing with redefine stress cdex"], - "bug": "http://b/72610009", - "variant": "redefine-stress & cdex-fast" - }, - { "test_patterns": ["616-cha"], "description": ["The test assumes a boot image exists."], "bug": "http://b/34193647", @@ -423,21 +417,13 @@ "variant": "redefine-stress & speed-profile | jvmti-stress & speed-profile" }, { - "tests": [ - "714-invoke-custom-lambda-metafactory", - "950-redefine-intrinsic", - "951-threaded-obsolete", - "952-invoke-custom", - "952-invoke-custom-kinds", - "953-invoke-polymorphic-compiler", - "954-invoke-polymorphic-verifier", - "955-methodhandles-smali", - "956-methodhandles", - "957-methodhandle-transforms", - "958-methodhandle-stackframe", - "959-invoke-polymorphic-accessors", - "979-const-method-handle", - "990-method-handle-and-mr" + "test_patterns": [ + ".*invoke-custom.*", + ".*invoke-polymorphic.*", + ".*methodhandle.*", + ".*method-handle.*", + ".*varhandle.*", + ".*var-handle.*" ], "description": [ "Tests that use invoke-polymorphic/invoke-custom which is not yet supported by", @@ -460,9 +446,22 @@ }, { "tests": [ + "132-daemon-locks-shutdown", + "607-daemon-stress", + "602-deoptimizeable", + "121-simple-suspend-check", + "083-compiler-regressions" + ], + "description": ["Tests that have failed on redefine stress for unknown reasons"], + "bug": "b/73177368", + "variant": "redefine-stress" + }, + { + "tests": [ "097-duplicate-method", "138-duplicate-classes-check2", "159-app-image-fields", + "674-hiddenapi", "649-vdex-duplicate-method", "804-class-extends-itself", "921-hello-failure" @@ -481,6 +480,7 @@ "626-const-class-linking", "629-vdex-speed", "647-jni-get-field-id", + "674-hiddenapi", "944-transform-classloaders" ], "description": [ @@ -494,7 +494,7 @@ "004-ThreadStress" ], "description": "The thread stress test just takes too long with field-stress", - "variant": "jvmti-stress | field-stress | step-stress" + "variant": "jvmti-stress | field-stress | step-stress | redefine-stress" }, { "tests": [ @@ -653,11 +653,6 @@ "description": ["Test is designed to only check --compiler-filter=speed"] }, { - "test_patterns": [".*"], - "description": ["Tests are timing out for weeks now, disable to fix."], - "variant": "cdex-fast & redefine-stress" - }, - { "tests": "674-HelloWorld-Dm", "variant": "target", "description": ["Requires zip, which isn't available on device"] @@ -667,5 +662,11 @@ "variant": "speed-profile & debug & gcstress & target", "bug": "b/73275005", "description": ["Time out"] + }, + { + "tests": ["130-hprof"], + "env_vars": {"SANITIZE_HOST": "address"}, + "bug": "b/73060923", + "description": ["ASAN issue"] } ] diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py index 3d173f5571..4329ad4863 100755 --- a/test/testrunner/testrunner.py +++ b/test/testrunner/testrunner.py @@ -110,6 +110,7 @@ test_count = 0 total_test_count = 0 verbose = False dry_run = False +ignore_skips = False build = False gdb = False gdb_arg = '' @@ -710,6 +711,8 @@ def is_test_disabled(test, variant_set): return True if test in env.EXTRA_DISABLED_TESTS: return True + if ignore_skips: + return False variants_list = DISABLED_TEST_CONTAINER.get(test, {}) for variants in variants_list: variants_present = True @@ -878,6 +881,7 @@ def get_default_threads(target): def parse_option(): global verbose global dry_run + global ignore_skips global n_thread global build global gdb @@ -897,6 +901,8 @@ def parse_option(): parser.add_argument('--dry-run', action='store_true', dest='dry_run') parser.add_argument("--skip", action="append", dest="skips", default=[], help="Skip the given test in all circumstances.") + parser.add_argument("--no-skips", dest="ignore_skips", action="store_true", default=False, + help="Don't skip any run-test configurations listed in knownfailures.json.") parser.add_argument('--no-build-dependencies', action='store_false', dest='build', help="Don't build dependencies under any circumstances. This is the " + @@ -935,6 +941,7 @@ def parse_option(): verbose = True if options['n_thread']: n_thread = max(1, options['n_thread']) + ignore_skips = options['ignore_skips'] if options['dry_run']: dry_run = True verbose = True diff --git a/test/ti-agent/common_load.cc b/test/ti-agent/common_load.cc index 9a7352e479..bfd165db10 100644 --- a/test/ti-agent/common_load.cc +++ b/test/ti-agent/common_load.cc @@ -28,7 +28,6 @@ #include "901-hello-ti-agent/basics.h" #include "909-attach-agent/attach.h" #include "936-search-onload/search_onload.h" -#include "983-source-transform-verify/source_transform.h" #include "1919-vminit-thread-start-timing/vminit.h" namespace art { @@ -83,7 +82,6 @@ static AgentLib agents[] = { { "939-hello-transformation-bcp", common_redefine::OnLoad, nullptr }, { "941-recursive-obsolete-jit", common_redefine::OnLoad, nullptr }, { "943-private-recursive-jit", common_redefine::OnLoad, nullptr }, - { "983-source-transform-verify", Test983SourceTransformVerify::OnLoad, nullptr }, { "1919-vminit-thread-start-timing", Test1919VMInitThreadStart::OnLoad, nullptr }, }; |