diff options
86 files changed, 696 insertions, 374 deletions
diff --git a/Android.mk b/Android.mk index 361ceecc2f..0281b0bbd4 100644 --- a/Android.mk +++ b/Android.mk @@ -25,18 +25,6 @@ art_path := $(LOCAL_PATH) include $(art_path)/build/Android.common_path.mk include $(art_path)/build/Android.oat.mk -# Following the example of build's dont_bother for clean targets. -art_dont_bother := false -ifneq (,$(filter clean-oat%,$(MAKECMDGOALS))) - art_dont_bother := true -endif - -# Don't bother with tests unless there is a test-art*, build-art*, or related target. -art_test_bother := false -ifneq (,$(filter tests test-art% valgrind-test-art% build-art% checkbuild,$(MAKECMDGOALS))) - art_test_bother := true -endif - .PHONY: clean-oat clean-oat: clean-oat-host clean-oat-target @@ -66,8 +54,6 @@ ifdef TARGET_2ND_ARCH endif adb shell rm -rf data/run-test/test-*/dalvik-cache/* -ifneq ($(art_dont_bother),true) - ######################################################################## # cpplint rules to style check art source files @@ -103,8 +89,6 @@ endif ######################################################################## # test rules -ifeq ($(art_test_bother),true) - # All the dependencies that must be built ahead of sync-ing them onto the target device. TEST_ART_TARGET_SYNC_DEPS := @@ -348,7 +332,6 @@ valgrind-test-art-target32: valgrind-test-art-target-gtest32 valgrind-test-art-target64: valgrind-test-art-target-gtest64 $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) -endif # art_test_bother ####################### # Fake packages for ART @@ -603,11 +586,7 @@ use-art-verify-none: ######################################################################## -endif # !art_dont_bother - # Clear locally used variables. -art_dont_bother := -art_test_bother := TEST_ART_TARGET_SYNC_DEPS := # Helper target that depends on boot image creation. diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc index a0c99663b4..06ded26a2d 100644 --- a/adbconnection/adbconnection.cc +++ b/adbconnection/adbconnection.cc @@ -488,7 +488,6 @@ android::base::unique_fd AdbConnectionState::ReadFdFromAdb() { bool AdbConnectionState::SetupAdbConnection() { int sleep_ms = 500; const int sleep_max_ms = 2*1000; - char buff[sizeof(pid_t) + 1]; android::base::unique_fd sock(socket(AF_UNIX, SOCK_SEQPACKET, 0)); if (sock < 0) { @@ -499,8 +498,7 @@ bool AdbConnectionState::SetupAdbConnection() { timeout.tv_sec = kControlSockSendTimeout; timeout.tv_usec = 0; setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); - snprintf(buff, sizeof(buff), "%04x", getpid()); - buff[sizeof(pid_t)] = 0; + int32_t pid = getpid(); while (!shutting_down_) { // If adbd isn't running, because USB debugging was disabled or @@ -529,9 +527,9 @@ bool AdbConnectionState::SetupAdbConnection() { return false; } /* now try to send our pid to the ADB daemon */ - ret = TEMP_FAILURE_RETRY(send(sock, buff, sizeof(pid_t), 0)); - if (ret == sizeof(pid_t)) { - VLOG(jdwp) << "PID " << getpid() << " send to adb"; + ret = TEMP_FAILURE_RETRY(send(sock, &pid, sizeof(pid), 0)); + if (ret == sizeof(pid)) { + VLOG(jdwp) << "PID " << pid << " sent to adb"; control_sock_ = std::move(sock); return true; } else { @@ -539,7 +537,9 @@ bool AdbConnectionState::SetupAdbConnection() { return false; } } else { - PLOG(ERROR) << "Can't connect to ADB control socket. Will retry."; + if (VLOG_IS_ON(jdwp)) { + PLOG(ERROR) << "Can't connect to ADB control socket. Will retry."; + } usleep(sleep_ms * 1000); diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk index d6c87b6bf4..8ba48be403 100644 --- a/build/Android.gtest.mk +++ b/build/Android.gtest.mk @@ -375,19 +375,29 @@ ifneq ($(ART_TEST_ANDROID_ROOT),) ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT) endif -ART_VALGRIND_TARGET_DEPENDENCIES := \ +ART_VALGRIND_TARGET_DEPENDENCIES := + +# Has to match list in external/valgrind/Android.build_one.mk +ART_VALGRIND_SUPPORTED_ARCH := arm arm64 x86_64 + +# Valgrind is not supported for x86 +ifneq (,$(filter $(ART_VALGRIND_SUPPORTED_ARCH),$(TARGET_ARCH))) +ART_VALGRIND_TARGET_DEPENDENCIES += \ $(TARGET_OUT_EXECUTABLES)/valgrind \ $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_ARCH)-linux \ $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_ARCH)-linux.so \ $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_ARCH)-linux.so \ $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/default.supp +endif ifdef TARGET_2ND_ARCH +ifneq (,$(filter $(ART_VALGRIND_SUPPORTED_ARCH),$(TARGET_2ND_ARCH))) ART_VALGRIND_TARGET_DEPENDENCIES += \ $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_2ND_ARCH)-linux \ $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_2ND_ARCH)-linux.so \ $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_2ND_ARCH)-linux.so endif +endif include $(CLEAR_VARS) LOCAL_MODULE := valgrind-target-suppressions.txt diff --git a/compiler/utils/x86/assembler_x86.cc b/compiler/utils/x86/assembler_x86.cc index 8640e2db0e..ea160c8993 100644 --- a/compiler/utils/x86/assembler_x86.cc +++ b/compiler/utils/x86/assembler_x86.cc @@ -1914,7 +1914,7 @@ void X86Assembler::cmpb(const Address& address, const Immediate& imm) { void X86Assembler::cmpw(const Address& address, const Immediate& imm) { AssemblerBuffer::EnsureCapacity ensured(&buffer_); EmitUint8(0x66); - EmitComplex(7, address, imm); + EmitComplex(7, address, imm, /* is_16_op */ true); } diff --git a/compiler/utils/x86/assembler_x86_test.cc b/compiler/utils/x86/assembler_x86_test.cc index 937dd80c4e..2fd1b27182 100644 --- a/compiler/utils/x86/assembler_x86_test.cc +++ b/compiler/utils/x86/assembler_x86_test.cc @@ -921,9 +921,7 @@ TEST_F(AssemblerX86Test, Cmpb) { } TEST_F(AssemblerX86Test, Cmpw) { - DriverStr(RepeatAI(&x86::X86Assembler::cmpw, - /*imm_bytes*/ 1U, - "cmpw ${imm}, {mem}"), "cmpw"); // TODO: only imm8? + DriverStr(RepeatAI(&x86::X86Assembler::cmpw, /*imm_bytes*/ 2U, "cmpw ${imm}, {mem}"), "cmpw"); } } // namespace art diff --git a/compiler/utils/x86_64/assembler_x86_64.cc b/compiler/utils/x86_64/assembler_x86_64.cc index feabf260af..ff5a357c5e 100644 --- a/compiler/utils/x86_64/assembler_x86_64.cc +++ b/compiler/utils/x86_64/assembler_x86_64.cc @@ -2199,7 +2199,7 @@ void X86_64Assembler::cmpw(const Address& address, const Immediate& imm) { CHECK(imm.is_int32()); EmitOperandSizeOverride(); EmitOptionalRex32(address); - EmitComplex(7, address, imm); + EmitComplex(7, address, imm, /* is_16_op */ true); } diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc index 5e6c83396a..6b1e53c35a 100644 --- a/compiler/utils/x86_64/assembler_x86_64_test.cc +++ b/compiler/utils/x86_64/assembler_x86_64_test.cc @@ -967,9 +967,8 @@ TEST_F(AssemblerX86_64Test, MovbStore) { } TEST_F(AssemblerX86_64Test, Cmpw) { - DriverStr(RepeatAI(&x86_64::X86_64Assembler::cmpw, - /*imm_bytes*/ 1U, - "cmpw ${imm}, {mem}"), "cmpw"); // TODO: only imm8? + DriverStr( + RepeatAI(&x86_64::X86_64Assembler::cmpw, /*imm_bytes*/ 2U, "cmpw ${imm}, {mem}"), "cmpw"); } TEST_F(AssemblerX86_64Test, MovqAddrImm) { diff --git a/openjdkjvmti/OpenjdkJvmTi.cc b/openjdkjvmti/OpenjdkJvmTi.cc index a0c7f40b6f..ef5151990c 100644 --- a/openjdkjvmti/OpenjdkJvmTi.cc +++ b/openjdkjvmti/OpenjdkJvmTi.cc @@ -73,8 +73,10 @@ namespace openjdkjvmti { -EventHandler gEventHandler; -DeoptManager gDeoptManager; +// NB These are heap allocated to avoid the static destructors being run if an agent calls exit(3). +// These should never be null. +EventHandler* gEventHandler; +DeoptManager* gDeoptManager; #define ENSURE_NON_NULL(n) \ do { \ @@ -776,7 +778,7 @@ class JvmtiFunctions { ENSURE_HAS_CAP(env, can_retransform_classes); std::string error_msg; jvmtiError res = Transformer::RetransformClasses(ArtJvmTiEnv::AsArtJvmTiEnv(env), - &gEventHandler, + gEventHandler, art::Runtime::Current(), art::Thread::Current(), class_count, @@ -795,7 +797,7 @@ class JvmtiFunctions { ENSURE_HAS_CAP(env, can_redefine_classes); std::string error_msg; jvmtiError res = Redefiner::RedefineClasses(ArtJvmTiEnv::AsArtJvmTiEnv(env), - &gEventHandler, + gEventHandler, art::Runtime::Current(), art::Thread::Current(), class_count, @@ -1061,7 +1063,10 @@ class JvmtiFunctions { } ArtJvmTiEnv* art_env = ArtJvmTiEnv::AsArtJvmTiEnv(env); - return gEventHandler.SetEvent(art_env, art_thread, GetArtJvmtiEvent(art_env, event_type), mode); + return gEventHandler->SetEvent(art_env, + art_thread, + GetArtJvmtiEvent(art_env, event_type), + mode); } static jvmtiError GenerateEvents(jvmtiEnv* env, @@ -1095,7 +1100,7 @@ class JvmtiFunctions { return ExtensionUtil::SetExtensionEventCallback(env, extension_event_index, callback, - &gEventHandler); + gEventHandler); } #define FOR_ALL_CAPABILITIES(FUN) \ @@ -1186,9 +1191,9 @@ class JvmtiFunctions { FOR_ALL_CAPABILITIES(ADD_CAPABILITY); #undef ADD_CAPABILITY - gEventHandler.HandleChangedCapabilities(ArtJvmTiEnv::AsArtJvmTiEnv(env), - changed, - /*added*/true); + gEventHandler->HandleChangedCapabilities(ArtJvmTiEnv::AsArtJvmTiEnv(env), + changed, + /*added*/true); return ret; } @@ -1210,9 +1215,9 @@ class JvmtiFunctions { FOR_ALL_CAPABILITIES(DEL_CAPABILITY); #undef DEL_CAPABILITY - gEventHandler.HandleChangedCapabilities(ArtJvmTiEnv::AsArtJvmTiEnv(env), - changed, - /*added*/false); + gEventHandler->HandleChangedCapabilities(ArtJvmTiEnv::AsArtJvmTiEnv(env), + changed, + /*added*/false); return OK; } @@ -1302,7 +1307,7 @@ class JvmtiFunctions { static jvmtiError DisposeEnvironment(jvmtiEnv* env) { ENSURE_VALID_ENV(env); ArtJvmTiEnv* tienv = ArtJvmTiEnv::AsArtJvmTiEnv(env); - gEventHandler.RemoveArtJvmTiEnv(tienv); + gEventHandler->RemoveArtJvmTiEnv(tienv); art::Runtime::Current()->RemoveSystemWeakHolder(tienv->object_tag_table.get()); ThreadUtil::RemoveEnvironment(tienv); delete tienv; @@ -1490,10 +1495,10 @@ ArtJvmTiEnv::ArtJvmTiEnv(art::JavaVMExt* runtime, EventHandler* event_handler, j // Creates a jvmtiEnv and returns it with the art::ti::Env that is associated with it. new_art_ti // is a pointer to the uninitialized memory for an art::ti::Env. static void CreateArtJvmTiEnv(art::JavaVMExt* vm, jint version, /*out*/void** new_jvmtiEnv) { - struct ArtJvmTiEnv* env = new ArtJvmTiEnv(vm, &gEventHandler, version); + struct ArtJvmTiEnv* env = new ArtJvmTiEnv(vm, gEventHandler, version); *new_jvmtiEnv = env; - gEventHandler.RegisterArtJvmTiEnv(env); + gEventHandler->RegisterArtJvmTiEnv(env); art::Runtime::Current()->AddSystemWeakHolder( ArtJvmTiEnv::AsArtJvmTiEnv(env)->object_tag_table.get()); @@ -1522,17 +1527,20 @@ static jint GetEnvHandler(art::JavaVMExt* vm, /*out*/void** env, jint version) { extern "C" bool ArtPlugin_Initialize() { art::Runtime* runtime = art::Runtime::Current(); - gDeoptManager.Setup(); + gDeoptManager = new DeoptManager; + gEventHandler = new EventHandler; + + gDeoptManager->Setup(); if (runtime->IsStarted()) { PhaseUtil::SetToLive(); } else { PhaseUtil::SetToOnLoad(); } - PhaseUtil::Register(&gEventHandler); - ThreadUtil::Register(&gEventHandler); - ClassUtil::Register(&gEventHandler); - DumpUtil::Register(&gEventHandler); - MethodUtil::Register(&gEventHandler); + PhaseUtil::Register(gEventHandler); + ThreadUtil::Register(gEventHandler); + ClassUtil::Register(gEventHandler); + DumpUtil::Register(gEventHandler); + MethodUtil::Register(gEventHandler); SearchUtil::Register(); HeapUtil::Register(); Transformer::Setup(); @@ -1540,7 +1548,7 @@ extern "C" bool ArtPlugin_Initialize() { { // Make sure we can deopt anything we need to. art::ScopedObjectAccess soa(art::Thread::Current()); - gDeoptManager.FinishSetup(); + gDeoptManager->FinishSetup(); } runtime->GetJavaVM()->AddEnvironmentHook(GetEnvHandler); @@ -1549,8 +1557,8 @@ extern "C" bool ArtPlugin_Initialize() { } extern "C" bool ArtPlugin_Deinitialize() { - gEventHandler.Shutdown(); - gDeoptManager.Shutdown(); + gEventHandler->Shutdown(); + gDeoptManager->Shutdown(); PhaseUtil::Unregister(); ThreadUtil::Unregister(); ClassUtil::Unregister(); @@ -1559,6 +1567,11 @@ extern "C" bool ArtPlugin_Deinitialize() { SearchUtil::Unregister(); HeapUtil::Unregister(); + // TODO It would be good to delete the gEventHandler and gDeoptManager here but we cannot since + // daemon threads might be suspended and we want to make sure that even if they wake up briefly + // they won't hit deallocated memory. By this point none of the functions will do anything since + // they have already shutdown. + return true; } diff --git a/openjdkjvmti/deopt_manager.cc b/openjdkjvmti/deopt_manager.cc index 9f5db7eade..6d84ffa53f 100644 --- a/openjdkjvmti/deopt_manager.cc +++ b/openjdkjvmti/deopt_manager.cc @@ -343,9 +343,9 @@ void DeoptManager::DeoptimizeThread(art::Thread* target) { art::Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(target); } -extern DeoptManager gDeoptManager; +extern DeoptManager* gDeoptManager; DeoptManager* DeoptManager::Get() { - return &gDeoptManager; + return gDeoptManager; } } // namespace openjdkjvmti diff --git a/openjdkjvmti/events.cc b/openjdkjvmti/events.cc index 62b73c08c0..8b40a7e072 100644 --- a/openjdkjvmti/events.cc +++ b/openjdkjvmti/events.cc @@ -1186,8 +1186,9 @@ void EventHandler::Shutdown() { art::Runtime::Current()->GetInstrumentation()->RemoveListener(method_trace_listener_.get(), ~0); } -EventHandler::EventHandler() : envs_lock_("JVMTI Environment List Lock", - art::LockLevel::kTopLockLevel) { +EventHandler::EventHandler() + : envs_lock_("JVMTI Environment List Lock", art::LockLevel::kTopLockLevel), + frame_pop_enabled(false) { alloc_listener_.reset(new JvmtiAllocationListener(this)); ddm_listener_.reset(new JvmtiDdmChunkListener(this)); gc_pause_listener_.reset(new JvmtiGcPauseListener(this)); diff --git a/openjdkjvmti/transform.cc b/openjdkjvmti/transform.cc index dc9f69a96a..43b8fe94f4 100644 --- a/openjdkjvmti/transform.cc +++ b/openjdkjvmti/transform.cc @@ -124,7 +124,7 @@ class TransformationFaultHandler FINAL : public art::FaultHandler { return std::find_if(initialized_class_definitions_.begin(), initialized_class_definitions_.end(), [&](const auto op) { return op->ContainsAddress(ptr); }) != - uninitialized_class_definitions_.end(); + initialized_class_definitions_.end(); } } diff --git a/runtime/arch/memcmp16_test.cc b/runtime/arch/memcmp16_test.cc index 2f3639c4b1..37aad21a40 100644 --- a/runtime/arch/memcmp16_test.cc +++ b/runtime/arch/memcmp16_test.cc @@ -100,7 +100,7 @@ static void CheckSeparate(size_t max_length, size_t min_length) { } size_t min = count1 < count2 ? count1 : count2; - bool fill_same = r.next() % 1 == 1; + bool fill_same = r.next() % 2 == 1; if (fill_same) { for (size_t i = 0; i < min; ++i) { diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc index 9d8e5d23eb..6d426c2dd0 100644 --- a/runtime/gc/heap_test.cc +++ b/runtime/gc/heap_test.cc @@ -81,7 +81,6 @@ class ZygoteHeapTest : public CommonRuntimeTest { void SetUpRuntimeOptions(RuntimeOptions* options) { CommonRuntimeTest::SetUpRuntimeOptions(options); options->push_back(std::make_pair("-Xzygote", nullptr)); - options->push_back(std::make_pair("-Xno-hidden-api-checks", nullptr)); } }; diff --git a/runtime/hidden_api.h b/runtime/hidden_api.h index 05e68e66dd..d7e5e18b9e 100644 --- a/runtime/hidden_api.h +++ b/runtime/hidden_api.h @@ -31,6 +31,23 @@ enum Action { kDeny }; +enum AccessMethod { + kReflection, + kJNI +}; + +inline std::ostream& operator<<(std::ostream& os, AccessMethod value) { + switch (value) { + case kReflection: + os << "reflection"; + break; + case kJNI: + os << "JNI"; + break; + } + return os; +} + inline Action GetMemberAction(uint32_t access_flags) { switch (HiddenApiAccessFlags::DecodeFromRuntime(access_flags)) { case HiddenApiAccessFlags::kWhitelist: @@ -45,19 +62,25 @@ inline Action GetMemberAction(uint32_t access_flags) { } // Issue a warning about field access. -inline void WarnAboutMemberAccess(ArtField* field) REQUIRES_SHARED(Locks::mutator_lock_) { +inline void WarnAboutMemberAccess(ArtField* field, AccessMethod access_method) + REQUIRES_SHARED(Locks::mutator_lock_) { std::string tmp; LOG(WARNING) << "Accessing hidden field " << field->GetDeclaringClass()->GetDescriptor(&tmp) << "->" - << field->GetName() << ":" << field->GetTypeDescriptor(); + << field->GetName() << ":" << field->GetTypeDescriptor() + << " (" << HiddenApiAccessFlags::DecodeFromRuntime(field->GetAccessFlags()) + << ", " << access_method << ")"; } // Issue a warning about method access. -inline void WarnAboutMemberAccess(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) { +inline void WarnAboutMemberAccess(ArtMethod* method, AccessMethod access_method) + REQUIRES_SHARED(Locks::mutator_lock_) { std::string tmp; LOG(WARNING) << "Accessing hidden method " << method->GetDeclaringClass()->GetDescriptor(&tmp) << "->" - << method->GetName() << method->GetSignature().ToString(); + << method->GetName() << method->GetSignature().ToString() + << " (" << HiddenApiAccessFlags::DecodeFromRuntime(method->GetAccessFlags()) + << ", " << access_method << ")"; } // Returns true if access to `member` should be denied to the caller of the @@ -69,7 +92,8 @@ inline void WarnAboutMemberAccess(ArtMethod* method) REQUIRES_SHARED(Locks::muta template<typename T> inline bool ShouldBlockAccessToMember(T* member, Thread* self, - std::function<bool(Thread*)> fn_caller_in_boot) + std::function<bool(Thread*)> fn_caller_in_boot, + AccessMethod access_method) REQUIRES_SHARED(Locks::mutator_lock_) { DCHECK(member != nullptr); Runtime* runtime = Runtime::Current(); @@ -92,25 +116,33 @@ inline bool ShouldBlockAccessToMember(T* member, return false; } - // Member is hidden and we are not in the boot class path. Act accordingly. + // Member is hidden and we are not in the boot class path. + + // Print a log message with information about this class member access. + // We do this regardless of whether we block the access or not. + WarnAboutMemberAccess(member, access_method); + + // Block access if on blacklist. if (action == kDeny) { return true; - } else { - DCHECK(action == kAllowButWarn || action == kAllowButWarnAndToast); - - // Allow access to this member but print a warning. Depending on a runtime - // flag, we might move the member into whitelist and skip the warning the - // next time the member is used. - if (runtime->ShouldDedupeHiddenApiWarnings()) { - member->SetAccessFlags(HiddenApiAccessFlags::EncodeForRuntime( - member->GetAccessFlags(), HiddenApiAccessFlags::kWhitelist)); - } - WarnAboutMemberAccess(member); - if (action == kAllowButWarnAndToast || runtime->ShouldAlwaysSetHiddenApiWarningFlag()) { - Runtime::Current()->SetPendingHiddenApiWarning(true); - } - return false; } + + // Allow access to this member but print a warning. + DCHECK(action == kAllowButWarn || action == kAllowButWarnAndToast); + + // Depending on a runtime flag, we might move the member into whitelist and + // skip the warning the next time the member is accessed. + if (runtime->ShouldDedupeHiddenApiWarnings()) { + member->SetAccessFlags(HiddenApiAccessFlags::EncodeForRuntime( + member->GetAccessFlags(), HiddenApiAccessFlags::kWhitelist)); + } + + // If this action requires a UI warning, set the appropriate flag. + if (action == kAllowButWarnAndToast || runtime->ShouldAlwaysSetHiddenApiWarningFlag()) { + Runtime::Current()->SetPendingHiddenApiWarning(true); + } + + return false; } // Returns true if access to member with `access_flags` should be denied to `caller`. diff --git a/runtime/hidden_api_access_flags.h b/runtime/hidden_api_access_flags.h index c328f965d2..6a88c12be5 100644 --- a/runtime/hidden_api_access_flags.h +++ b/runtime/hidden_api_access_flags.h @@ -146,6 +146,24 @@ class HiddenApiAccessFlags { }; }; +inline std::ostream& operator<<(std::ostream& os, HiddenApiAccessFlags::ApiList value) { + switch (value) { + case HiddenApiAccessFlags::kWhitelist: + os << "whitelist"; + break; + case HiddenApiAccessFlags::kLightGreylist: + os << "light greylist"; + break; + case HiddenApiAccessFlags::kDarkGreylist: + os << "dark greylist"; + break; + case HiddenApiAccessFlags::kBlacklist: + os << "blacklist"; + break; + } + return os; +} + } // namespace art diff --git a/runtime/interpreter/mterp/arm/entry.S b/runtime/interpreter/mterp/arm/entry.S index df4bcc66f3..7c7c527ef4 100644 --- a/runtime/interpreter/mterp/arm/entry.S +++ b/runtime/interpreter/mterp/arm/entry.S @@ -56,7 +56,7 @@ ENTRY ExecuteMterpImpl VREG_INDEX_TO_ADDR rREFS, r0 @ point to reference array in shadow frame ldr r0, [r2, #SHADOWFRAME_DEX_PC_OFFSET] @ Get starting dex_pc. add rPC, r1, r0, lsl #1 @ Create direct pointer to 1st dex opcode - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/arm/header.S b/runtime/interpreter/mterp/arm/header.S index 64ab9efa19..1f15f870ea 100644 --- a/runtime/interpreter/mterp/arm/header.S +++ b/runtime/interpreter/mterp/arm/header.S @@ -93,6 +93,8 @@ unspecified registers or condition codes. /* During bringup, we'll use the shadow frame model instead of rFP */ /* single-purpose registers, given names for clarity */ #define rPC r4 +#define CFI_DEX 4 // DWARF register number of the register holding dex-pc (xPC). +#define CFI_TMP 0 // DWARF register number of the first argument register (r0). #define rFP r5 #define rSELF r6 #define rINST r7 diff --git a/runtime/interpreter/mterp/arm64/entry.S b/runtime/interpreter/mterp/arm64/entry.S index 8d61210be8..cf38a2992d 100644 --- a/runtime/interpreter/mterp/arm64/entry.S +++ b/runtime/interpreter/mterp/arm64/entry.S @@ -46,7 +46,7 @@ ENTRY ExecuteMterpImpl add xREFS, xFP, w0, lsl #2 // point to reference array in shadow frame ldr w0, [x2, #SHADOWFRAME_DEX_PC_OFFSET] // Get starting dex_pc. add xPC, x1, w0, lsl #1 // Create direct pointer to 1st dex opcode - .cfi_register DPC_PSEUDO_REG, xPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/arm64/header.S b/runtime/interpreter/mterp/arm64/header.S index 9261b770d6..f0bf8ca34e 100644 --- a/runtime/interpreter/mterp/arm64/header.S +++ b/runtime/interpreter/mterp/arm64/header.S @@ -95,6 +95,8 @@ codes. /* During bringup, we'll use the shadow frame model instead of xFP */ /* single-purpose registers, given names for clarity */ #define xPC x20 +#define CFI_DEX 20 // DWARF register number of the register holding dex-pc (xPC). +#define CFI_TMP 0 // DWARF register number of the first argument register (r0). #define xFP x21 #define xSELF x22 #define xINST x23 diff --git a/runtime/interpreter/mterp/cfi_asm_support.h b/runtime/interpreter/mterp/cfi_asm_support.h index a97e153993..0df4eb4f81 100644 --- a/runtime/interpreter/mterp/cfi_asm_support.h +++ b/runtime/interpreter/mterp/cfi_asm_support.h @@ -18,14 +18,30 @@ #define ART_RUNTIME_INTERPRETER_MTERP_CFI_ASM_SUPPORT_H_ /* - * To keep track of the Dalvik PC, give assign it a magic register number that - * won't be confused with a pysical register. Then, standard .cfi directives - * will track the location of it so that it may be extracted during a stack - * unwind. + * Define the DEX PC (memory address of the currently interpreted bytecode) + * within the CFI stream of the current function (stored in .eh_frame). + * This allows libunwind to detect that the frame is in the interpreter, + * and to resolve the memory address into human readable Java method name. + * The CFI instruction is recognised by the magic bytes in the expression + * (we push magic "DEX1" constant on the DWARF stack and drop it again). * - * The Dalvik PC will be in either a physical registor, or the frame. - * Encoded from the ASCII string " DEX" -> 0x20 0x44 0x45 0x58 + * As with any other CFI opcode, the expression needs to be associated with + * a register. Any caller-save register will do as those are unused in CFI. + * Better solution would be to store the expression in Android-specific + * DWARF register (CFI registers don't have to correspond to real hardware + * registers), however, gdb handles any unknown registers very poorly. + * Similarly, we could also use some of the user-defined opcodes defined + * in the DWARF specification, but gdb doesn't support those either. + * + * The DEX PC is generally advanced in the middle of the bytecode handler, + * which will result in the reported DEX PC to be off by an instruction. + * Therefore the macro allows adding/subtracting an offset to compensate. + * TODO: Add the offsets to handlers to get line-accurate DEX PC reporting. */ -#define DPC_PSEUDO_REG 0x20444558 +#define CFI_DEFINE_DEX_PC_WITH_OFFSET(tmpReg, dexReg, dexOffset) .cfi_escape \ + 0x16 /* DW_CFA_val_expression */, tmpReg, 0x09 /* size */, \ + 0x0c /* DW_OP_const4u */, 0x44, 0x45, 0x58, 0x31, /* magic = "DEX1" */ \ + 0x13 /* DW_OP_drop */, \ + 0x92 /* DW_OP_bregx */, dexReg, (dexOffset & 0x7F) /* 1-byte SLEB128 */ #endif // ART_RUNTIME_INTERPRETER_MTERP_CFI_ASM_SUPPORT_H_ diff --git a/runtime/interpreter/mterp/gen_mterp.py b/runtime/interpreter/mterp/gen_mterp.py index 1c9af30d0a..40d99df037 100755 --- a/runtime/interpreter/mterp/gen_mterp.py +++ b/runtime/interpreter/mterp/gen_mterp.py @@ -22,7 +22,7 @@ import sys, string, re, time from string import Template -interp_defs_file = "../../dex_instruction_list.h" # need opcode list +interp_defs_file = "../../dex/dex_instruction_list.h" # need opcode list kNumPackedOpcodes = 256 splitops = False diff --git a/runtime/interpreter/mterp/mips/entry.S b/runtime/interpreter/mterp/mips/entry.S index 41b5d5650d..d342354969 100644 --- a/runtime/interpreter/mterp/mips/entry.S +++ b/runtime/interpreter/mterp/mips/entry.S @@ -54,7 +54,7 @@ ExecuteMterpImpl: EAS2(rREFS, rFP, a0) # point to reference array in shadow frame lw a0, SHADOWFRAME_DEX_PC_OFFSET(a2) # Get starting dex_pc EAS1(rPC, a1, a0) # Create direct pointer to 1st dex opcode - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC() diff --git a/runtime/interpreter/mterp/mips/header.S b/runtime/interpreter/mterp/mips/header.S index 0f7a6f1116..014628f415 100644 --- a/runtime/interpreter/mterp/mips/header.S +++ b/runtime/interpreter/mterp/mips/header.S @@ -61,6 +61,8 @@ /* single-purpose registers, given names for clarity */ #define rPC s0 +#define CFI_DEX 16 // DWARF register number of the register holding dex-pc (s0). +#define CFI_TMP 4 // DWARF register number of the first argument register (a0). #define rFP s1 #define rSELF s2 #define rIBASE s3 diff --git a/runtime/interpreter/mterp/mips64/entry.S b/runtime/interpreter/mterp/mips64/entry.S index 841a817569..ed965aa201 100644 --- a/runtime/interpreter/mterp/mips64/entry.S +++ b/runtime/interpreter/mterp/mips64/entry.S @@ -73,7 +73,7 @@ ExecuteMterpImpl: dlsa rREFS, v0, rFP, 2 lw v0, SHADOWFRAME_DEX_PC_OFFSET(a2) dlsa rPC, v0, a1, 1 - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/mips64/header.S b/runtime/interpreter/mterp/mips64/header.S index 2b550cb533..4947aff38e 100644 --- a/runtime/interpreter/mterp/mips64/header.S +++ b/runtime/interpreter/mterp/mips64/header.S @@ -90,6 +90,8 @@ The following registers have fixed assignments: /* During bringup, we'll use the shadow frame model instead of rFP */ /* single-purpose registers, given names for clarity */ #define rPC s0 +#define CFI_DEX 16 // DWARF register number of the register holding dex-pc (s0). +#define CFI_TMP 4 // DWARF register number of the first argument register (a0). #define rFP s1 #define rSELF s2 #define rINST s3 diff --git a/runtime/interpreter/mterp/out/mterp_arm.S b/runtime/interpreter/mterp/out/mterp_arm.S index f3c1124ec4..5c1a13b9d6 100644 --- a/runtime/interpreter/mterp/out/mterp_arm.S +++ b/runtime/interpreter/mterp/out/mterp_arm.S @@ -100,6 +100,8 @@ unspecified registers or condition codes. /* During bringup, we'll use the shadow frame model instead of rFP */ /* single-purpose registers, given names for clarity */ #define rPC r4 +#define CFI_DEX 4 // DWARF register number of the register holding dex-pc (xPC). +#define CFI_TMP 0 // DWARF register number of the first argument register (r0). #define rFP r5 #define rSELF r6 #define rINST r7 @@ -375,7 +377,7 @@ ENTRY ExecuteMterpImpl VREG_INDEX_TO_ADDR rREFS, r0 @ point to reference array in shadow frame ldr r0, [r2, #SHADOWFRAME_DEX_PC_OFFSET] @ Get starting dex_pc. add rPC, r1, r0, lsl #1 @ Create direct pointer to 1st dex opcode - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/out/mterp_arm64.S b/runtime/interpreter/mterp/out/mterp_arm64.S index 347d54f705..72446ba082 100644 --- a/runtime/interpreter/mterp/out/mterp_arm64.S +++ b/runtime/interpreter/mterp/out/mterp_arm64.S @@ -102,6 +102,8 @@ codes. /* During bringup, we'll use the shadow frame model instead of xFP */ /* single-purpose registers, given names for clarity */ #define xPC x20 +#define CFI_DEX 20 // DWARF register number of the register holding dex-pc (xPC). +#define CFI_TMP 0 // DWARF register number of the first argument register (r0). #define xFP x21 #define xSELF x22 #define xINST x23 @@ -405,7 +407,7 @@ ENTRY ExecuteMterpImpl add xREFS, xFP, w0, lsl #2 // point to reference array in shadow frame ldr w0, [x2, #SHADOWFRAME_DEX_PC_OFFSET] // Get starting dex_pc. add xPC, x1, w0, lsl #1 // Create direct pointer to 1st dex opcode - .cfi_register DPC_PSEUDO_REG, xPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/out/mterp_mips.S b/runtime/interpreter/mterp/out/mterp_mips.S index 1687afa58a..d5861b28a7 100644 --- a/runtime/interpreter/mterp/out/mterp_mips.S +++ b/runtime/interpreter/mterp/out/mterp_mips.S @@ -68,6 +68,8 @@ /* single-purpose registers, given names for clarity */ #define rPC s0 +#define CFI_DEX 16 // DWARF register number of the register holding dex-pc (s0). +#define CFI_TMP 4 // DWARF register number of the first argument register (a0). #define rFP s1 #define rSELF s2 #define rIBASE s3 @@ -788,7 +790,7 @@ ExecuteMterpImpl: EAS2(rREFS, rFP, a0) # point to reference array in shadow frame lw a0, SHADOWFRAME_DEX_PC_OFFSET(a2) # Get starting dex_pc EAS1(rPC, a1, a0) # Create direct pointer to 1st dex opcode - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC() diff --git a/runtime/interpreter/mterp/out/mterp_mips64.S b/runtime/interpreter/mterp/out/mterp_mips64.S index 559c72bb0c..5224df92be 100644 --- a/runtime/interpreter/mterp/out/mterp_mips64.S +++ b/runtime/interpreter/mterp/out/mterp_mips64.S @@ -97,6 +97,8 @@ The following registers have fixed assignments: /* During bringup, we'll use the shadow frame model instead of rFP */ /* single-purpose registers, given names for clarity */ #define rPC s0 +#define CFI_DEX 16 // DWARF register number of the register holding dex-pc (s0). +#define CFI_TMP 4 // DWARF register number of the first argument register (a0). #define rFP s1 #define rSELF s2 #define rINST s3 @@ -408,7 +410,7 @@ ExecuteMterpImpl: dlsa rREFS, v0, rFP, 2 lw v0, SHADOWFRAME_DEX_PC_OFFSET(a2) dlsa rPC, v0, a1, 1 - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/out/mterp_x86.S b/runtime/interpreter/mterp/out/mterp_x86.S index 0613c9d12e..f98fa5b74f 100644 --- a/runtime/interpreter/mterp/out/mterp_x86.S +++ b/runtime/interpreter/mterp/out/mterp_x86.S @@ -164,6 +164,8 @@ unspecified registers or condition codes. /* single-purpose registers, given names for clarity */ #define rSELF IN_ARG0(%esp) #define rPC %esi +#define CFI_DEX 6 // DWARF register number of the register holding dex-pc (esi). +#define CFI_TMP 0 // DWARF register number of the first argument register (eax). #define rFP %edi #define rINST %ebx #define rINSTw %bx @@ -380,7 +382,7 @@ SYMBOL(ExecuteMterpImpl): leal (rFP, %eax, 4), rREFS movl SHADOWFRAME_DEX_PC_OFFSET(%edx), %eax lea (%ecx, %eax, 2), rPC - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Set up for backwards branches & osr profiling */ diff --git a/runtime/interpreter/mterp/out/mterp_x86_64.S b/runtime/interpreter/mterp/out/mterp_x86_64.S index aa91db3b61..d82a2d2eb0 100644 --- a/runtime/interpreter/mterp/out/mterp_x86_64.S +++ b/runtime/interpreter/mterp/out/mterp_x86_64.S @@ -164,6 +164,8 @@ unspecified registers or condition codes. /* single-purpose registers, given names for clarity */ #define rSELF SELF_SPILL(%rsp) #define rPC %r12 +#define CFI_DEX 12 // DWARF register number of the register holding dex-pc (rPC). +#define CFI_TMP 5 // DWARF register number of the first argument register (rdi). #define rFP %r13 #define rINST %ebx #define rINSTq %rbx @@ -363,7 +365,7 @@ SYMBOL(ExecuteMterpImpl): leaq (rFP, %rax, 4), rREFS movl SHADOWFRAME_DEX_PC_OFFSET(IN_ARG2), %eax leaq (IN_ARG1, %rax, 2), rPC - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/x86/entry.S b/runtime/interpreter/mterp/x86/entry.S index 10ca8366de..324637bf9a 100644 --- a/runtime/interpreter/mterp/x86/entry.S +++ b/runtime/interpreter/mterp/x86/entry.S @@ -61,7 +61,7 @@ SYMBOL(ExecuteMterpImpl): leal (rFP, %eax, 4), rREFS movl SHADOWFRAME_DEX_PC_OFFSET(%edx), %eax lea (%ecx, %eax, 2), rPC - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Set up for backwards branches & osr profiling */ diff --git a/runtime/interpreter/mterp/x86/header.S b/runtime/interpreter/mterp/x86/header.S index 0e585e86f0..2e3bbdf6f7 100644 --- a/runtime/interpreter/mterp/x86/header.S +++ b/runtime/interpreter/mterp/x86/header.S @@ -157,6 +157,8 @@ unspecified registers or condition codes. /* single-purpose registers, given names for clarity */ #define rSELF IN_ARG0(%esp) #define rPC %esi +#define CFI_DEX 6 // DWARF register number of the register holding dex-pc (esi). +#define CFI_TMP 0 // DWARF register number of the first argument register (eax). #define rFP %edi #define rINST %ebx #define rINSTw %bx diff --git a/runtime/interpreter/mterp/x86_64/entry.S b/runtime/interpreter/mterp/x86_64/entry.S index d85ef7fe24..2f69226206 100644 --- a/runtime/interpreter/mterp/x86_64/entry.S +++ b/runtime/interpreter/mterp/x86_64/entry.S @@ -58,7 +58,7 @@ SYMBOL(ExecuteMterpImpl): leaq (rFP, %rax, 4), rREFS movl SHADOWFRAME_DEX_PC_OFFSET(IN_ARG2), %eax leaq (IN_ARG1, %rax, 2), rPC - .cfi_register DPC_PSEUDO_REG, rPC + CFI_DEFINE_DEX_PC_WITH_OFFSET(CFI_TMP, CFI_DEX, 0) EXPORT_PC /* Starting ibase */ diff --git a/runtime/interpreter/mterp/x86_64/header.S b/runtime/interpreter/mterp/x86_64/header.S index a3ef8953ca..eabaade4e7 100644 --- a/runtime/interpreter/mterp/x86_64/header.S +++ b/runtime/interpreter/mterp/x86_64/header.S @@ -157,6 +157,8 @@ unspecified registers or condition codes. /* single-purpose registers, given names for clarity */ #define rSELF SELF_SPILL(%rsp) #define rPC %r12 +#define CFI_DEX 12 // DWARF register number of the register holding dex-pc (rPC). +#define CFI_TMP 5 // DWARF register number of the first argument register (rdi). #define rFP %r13 #define rINST %ebx #define rINSTq %rbx diff --git a/runtime/jdwp/jdwp_adb.cc b/runtime/jdwp/jdwp_adb.cc index d68430f3ac..481aff91f8 100644 --- a/runtime/jdwp/jdwp_adb.cc +++ b/runtime/jdwp/jdwp_adb.cc @@ -38,8 +38,7 @@ * domain stream socket (@jdwp-control) that is opened by the * ADB daemon. * - * 2/ it then sends the current process PID as a string of 4 hexadecimal - * chars (no terminating zero) + * 2/ it then sends the current process PID as an int32_t. * * 3/ then, it uses recvmsg to receive file descriptors from the * daemon. each incoming file descriptor is a pass-through to @@ -225,7 +224,6 @@ bool JdwpAdbState::Accept() { if (ControlSock() == -1) { int sleep_ms = 500; const int sleep_max_ms = 2*1000; - char buff[5]; int sock = socket(AF_UNIX, SOCK_SEQPACKET, 0); if (sock < 0) { @@ -247,8 +245,7 @@ bool JdwpAdbState::Accept() { } } - snprintf(buff, sizeof(buff), "%04x", getpid()); - buff[4] = 0; + int32_t pid = getpid(); for (;;) { /* @@ -277,9 +274,9 @@ bool JdwpAdbState::Accept() { #endif /* now try to send our pid to the ADB daemon */ - ret = TEMP_FAILURE_RETRY(send(control_sock, buff, 4, 0)); - if (ret == 4) { - VLOG(jdwp) << StringPrintf("PID sent as '%.*s' to ADB", 4, buff); + ret = TEMP_FAILURE_RETRY(send(control_sock, &pid, sizeof(pid), 0)); + if (ret == sizeof(pid)) { + VLOG(jdwp) << "PID " << pid << " sent to ADB"; break; } diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc index 666fb98354..cd4d9543be 100644 --- a/runtime/jni_internal.cc +++ b/runtime/jni_internal.cc @@ -90,7 +90,8 @@ static bool IsCallerInBootClassPath(Thread* self) REQUIRES_SHARED(Locks::mutator template<typename T> ALWAYS_INLINE static bool ShouldBlockAccessToMember(T* member, Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { - return hiddenapi::ShouldBlockAccessToMember(member, self, IsCallerInBootClassPath); + return hiddenapi::ShouldBlockAccessToMember( + member, self, IsCallerInBootClassPath, hiddenapi::kJNI); } // Helpers to call instrumentation functions for fields. These take jobjects so we don't need to set diff --git a/runtime/native/dalvik_system_ZygoteHooks.cc b/runtime/native/dalvik_system_ZygoteHooks.cc index 648a464b6e..12400e26ea 100644 --- a/runtime/native/dalvik_system_ZygoteHooks.cc +++ b/runtime/native/dalvik_system_ZygoteHooks.cc @@ -173,7 +173,7 @@ enum { DEBUG_JAVA_DEBUGGABLE = 1 << 8, DISABLE_VERIFIER = 1 << 9, ONLY_USE_SYSTEM_OAT_FILES = 1 << 10, - DISABLE_HIDDEN_API_CHECKS = 1 << 11, + ENABLE_HIDDEN_API_CHECKS = 1 << 11, DEBUG_GENERATE_MINI_DEBUG_INFO = 1 << 12, }; @@ -282,7 +282,7 @@ static void ZygoteHooks_nativePostForkChild(JNIEnv* env, // Our system thread ID, etc, has changed so reset Thread state. thread->InitAfterFork(); runtime_flags = EnableDebugFeatures(runtime_flags); - bool do_hidden_api_checks = true; + bool do_hidden_api_checks = false; if ((runtime_flags & DISABLE_VERIFIER) != 0) { Runtime::Current()->DisableVerifier(); @@ -294,9 +294,9 @@ static void ZygoteHooks_nativePostForkChild(JNIEnv* env, runtime_flags &= ~ONLY_USE_SYSTEM_OAT_FILES; } - if ((runtime_flags & DISABLE_HIDDEN_API_CHECKS) != 0) { - do_hidden_api_checks = false; - runtime_flags &= ~DISABLE_HIDDEN_API_CHECKS; + if ((runtime_flags & ENABLE_HIDDEN_API_CHECKS) != 0) { + do_hidden_api_checks = true; + runtime_flags &= ~ENABLE_HIDDEN_API_CHECKS; } if (runtime_flags != 0) { diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc index 2091a27ffd..4597f68f54 100644 --- a/runtime/native/java_lang_Class.cc +++ b/runtime/native/java_lang_Class.cc @@ -97,7 +97,8 @@ ALWAYS_INLINE static bool ShouldEnforceHiddenApi(Thread* self) template<typename T> ALWAYS_INLINE static bool ShouldBlockAccessToMember(T* member, Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) { - return hiddenapi::ShouldBlockAccessToMember(member, self, IsCallerInBootClassPath); + return hiddenapi::ShouldBlockAccessToMember( + member, self, IsCallerInBootClassPath, hiddenapi::kReflection); } // Returns true if a class member should be discoverable with reflection given diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index 72346cc1c1..c7f73d14db 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -330,8 +330,8 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize .Define("-Xtarget-sdk-version:_") .WithType<int>() .IntoKey(M::TargetSdkVersion) - .Define("-Xno-hidden-api-checks") - .IntoKey(M::NoHiddenApiChecks) + .Define("-Xhidden-api-checks") + .IntoKey(M::HiddenApiChecks) .Define("-Xuse-stderr-logger") .IntoKey(M::UseStderrLogger) .Ignore({ diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 33298ad69a..7aca12e56b 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -266,7 +266,7 @@ Runtime::Runtime() oat_file_manager_(nullptr), is_low_memory_mode_(false), safe_mode_(false), - do_hidden_api_checks_(true), + do_hidden_api_checks_(false), pending_hidden_api_warning_(false), dedupe_hidden_api_warnings_(true), always_set_hidden_api_warning_flag_(false), @@ -1182,14 +1182,7 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) { // by default and we only enable them if: // (a) runtime was started with a flag that enables the checks, or // (b) Zygote forked a new process that is not exempt (see ZygoteHooks). - // TODO(dbrazdil): Turn the NoHiddenApiChecks negative flag into a positive one - // to clean up this logic. - if (kIsTargetBuild && IsAotCompiler() && !runtime_options.Exists(Opt::NoHiddenApiChecks)) { - // dex2oat on target without -Xno-hidden-api-checks. - do_hidden_api_checks_ = !IsCompilingBootImage(); - } else { - do_hidden_api_checks_ = false; - } + do_hidden_api_checks_ = runtime_options.Exists(Opt::HiddenApiChecks); DCHECK(!is_zygote_ || !do_hidden_api_checks_) << "Zygote should not be started with hidden API checks"; diff --git a/runtime/runtime_options.def b/runtime/runtime_options.def index 4831d7dec3..dba648e785 100644 --- a/runtime/runtime_options.def +++ b/runtime/runtime_options.def @@ -119,7 +119,7 @@ RUNTIME_OPTIONS_KEY (std::vector<std::string>, \ RUNTIME_OPTIONS_KEY (verifier::VerifyMode, \ Verify, verifier::VerifyMode::kEnable) RUNTIME_OPTIONS_KEY (int, TargetSdkVersion, Runtime::kUnsetSdkVersion) -RUNTIME_OPTIONS_KEY (Unit, NoHiddenApiChecks) +RUNTIME_OPTIONS_KEY (Unit, HiddenApiChecks) RUNTIME_OPTIONS_KEY (std::string, NativeBridge) RUNTIME_OPTIONS_KEY (unsigned int, ZygoteMaxFailedBoots, 10) RUNTIME_OPTIONS_KEY (Unit, NoDexFileFallback) diff --git a/runtime/well_known_classes.cc b/runtime/well_known_classes.cc index 902c3b84b5..67ea64be74 100644 --- a/runtime/well_known_classes.cc +++ b/runtime/well_known_classes.cc @@ -283,7 +283,27 @@ uint32_t WellKnownClasses::StringInitToEntryPoint(ArtMethod* string_init) { } #undef STRING_INIT_LIST +class ScopedHiddenApiExemption { + public: + explicit ScopedHiddenApiExemption(Runtime* runtime) + : runtime_(runtime), + initially_enabled_(runtime_->AreHiddenApiChecksEnabled()) { + runtime_->SetHiddenApiChecksEnabled(false); + } + + ~ScopedHiddenApiExemption() { + runtime_->SetHiddenApiChecksEnabled(initially_enabled_); + } + + private: + Runtime* runtime_; + const bool initially_enabled_; + DISALLOW_COPY_AND_ASSIGN(ScopedHiddenApiExemption); +}; + void WellKnownClasses::Init(JNIEnv* env) { + ScopedHiddenApiExemption hiddenapi_exemption(Runtime::Current()); + dalvik_annotation_optimization_CriticalNative = CacheClass(env, "dalvik/annotation/optimization/CriticalNative"); dalvik_annotation_optimization_FastNative = CacheClass(env, "dalvik/annotation/optimization/FastNative"); diff --git a/test/030-bad-finalizer/expected.txt b/test/030-bad-finalizer/expected.txt index 74e208c3f9..0aca6f2e93 100644 --- a/test/030-bad-finalizer/expected.txt +++ b/test/030-bad-finalizer/expected.txt @@ -2,3 +2,4 @@ About to null reference. Finalizer started and spinning... Finalizer done spinning. Finalizer sleeping forever now. +exit status: 2 diff --git a/test/1937-transform-soft-fail/check b/test/030-bad-finalizer/run index 7cee530291..7a0d0d05ab 100755 --- a/test/1937-transform-soft-fail/check +++ b/test/030-bad-finalizer/run @@ -1,12 +1,12 @@ #!/bin/bash # -# Copyright (C) 2017 The Android Open Source Project +# Copyright 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 +# 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, @@ -14,6 +14,6 @@ # 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" +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/034-call-null/expected.txt b/test/034-call-null/expected.txt index 4e0281e556..11aefde417 100644 --- a/test/034-call-null/expected.txt +++ b/test/034-call-null/expected.txt @@ -1,2 +1,3 @@ Exception in thread "main" java.lang.NullPointerException: Attempt to invoke direct method 'void Main.doStuff(int, int[][], java.lang.String, java.lang.String[][])' on a null object reference at Main.main(Main.java:26) +exit status: 1 diff --git a/test/034-call-null/run b/test/034-call-null/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/034-call-null/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/038-inner-null/expected.txt b/test/038-inner-null/expected.txt index 2e925644e3..d148eff407 100644 --- a/test/038-inner-null/expected.txt +++ b/test/038-inner-null/expected.txt @@ -2,3 +2,4 @@ new Special() Exception in thread "main" java.lang.NullPointerException: Attempt to invoke virtual method 'void Main$Blort.repaint()' on a null object reference at Main$Special.callInner(Main.java:31) at Main.main(Main.java:20) +exit status: 1 diff --git a/test/038-inner-null/run b/test/038-inner-null/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/038-inner-null/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/054-uncaught/expected.txt b/test/054-uncaught/expected.txt index 7d7f03c3a7..878260a07d 100644 --- a/test/054-uncaught/expected.txt +++ b/test/054-uncaught/expected.txt @@ -18,3 +18,4 @@ Uncaught exception DEFAULT! java.lang.NullPointerException: Hi diddly-ho, neighborino. at Main.catchTheUncaught(Main.java:63) at Main.main(Main.java:26) +exit status: 1 diff --git a/test/054-uncaught/run b/test/054-uncaught/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/054-uncaught/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? diff --git a/test/134-nodex2oat-nofallback/run b/test/134-nodex2oat-nofallback/run index 38b4adb183..33265ac471 100755 --- a/test/134-nodex2oat-nofallback/run +++ b/test/134-nodex2oat-nofallback/run @@ -18,3 +18,5 @@ flags="${@}" # Make sure we cannot run without an oat file without fallback. ${RUN} ${flags} --runtime-option -Xnodex2oat --runtime-option -Xno-dex-file-fallback +# Suppress the exit value. This isn't expected to be successful. +echo "Exit status:" $? 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/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/1944-sudden-exit/check b/test/1944-sudden-exit/check new file mode 100755 index 0000000000..591fbb87ee --- /dev/null +++ b/test/1944-sudden-exit/check @@ -0,0 +1,25 @@ +#!/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. + +# The number of paused background threads (and therefore InterruptedExceptions) +# can change so we will just delete their lines from the log. + +# Pure virtual function can be printed because sudden exits are not really +# supported. It is an error message but the test is to make sure that we exit +# with the right exit code. +cat "$2" \ + | sed "/Pure virtual function called!/d" \ + | diff --strip-trailing-cr -q "$1" - >/dev/null diff --git a/test/1944-sudden-exit/expected.txt b/test/1944-sudden-exit/expected.txt new file mode 100644 index 0000000000..4c6eb47fa7 --- /dev/null +++ b/test/1944-sudden-exit/expected.txt @@ -0,0 +1,3 @@ +All threads started +Exiting suddenly +exit status: 12 diff --git a/test/1944-sudden-exit/info.txt b/test/1944-sudden-exit/info.txt new file mode 100644 index 0000000000..d575ce5864 --- /dev/null +++ b/test/1944-sudden-exit/info.txt @@ -0,0 +1,5 @@ +Test to make sure the runtime will not crash if an agent calls exit(3) while +other threads are performing operations. + +In this case we have multiple threads all performing single stepping when we +call exit(3). diff --git a/test/1944-sudden-exit/run b/test/1944-sudden-exit/run new file mode 100755 index 0000000000..eb601fd348 --- /dev/null +++ b/test/1944-sudden-exit/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 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. + +# Ask for stack traces to be dumped to a file rather than to stdout. +./default-run "$@" --jvmti +echo "exit status: " $? diff --git a/test/1944-sudden-exit/src/Main.java b/test/1944-sudden-exit/src/Main.java new file mode 100644 index 0000000000..1644c6ef0c --- /dev/null +++ b/test/1944-sudden-exit/src/Main.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +public class Main { + public static void main(String[] args) throws Exception { + art.Test1944.run(); + } +} diff --git a/test/1944-sudden-exit/src/art/Test1944.java b/test/1944-sudden-exit/src/art/Test1944.java new file mode 100644 index 0000000000..36cbb2b390 --- /dev/null +++ b/test/1944-sudden-exit/src/art/Test1944.java @@ -0,0 +1,69 @@ +/* + * 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. + */ + +package art; + +import java.util.Arrays; +import java.lang.reflect.Executable; +import java.lang.reflect.Method; +import java.util.concurrent.Semaphore; + +public class Test1944 { + // Just calculate fib forever. + public static void fib(Semaphore started) { + started.release(); + long a = 1; + long b = 1; + while (true) { + long c = a + b; + a = b; + b = c; + } + } + + // Don't bother actually doing anything. + public static void notifySingleStep(Thread thr, Executable e, long loc) { } + + public static native void exitNow(); + + private static int num_threads = 10; + + public static void run() throws Exception { + final Semaphore started = new Semaphore(-(num_threads - 1)); + + Trace.enableSingleStepTracing(Test1944.class, + Test1944.class.getDeclaredMethod( + "notifySingleStep", Thread.class, Executable.class, Long.TYPE), + null); + + Thread[] threads = new Thread[num_threads]; + for (int i = 0; i < num_threads; i++) { + threads[i] = new Thread(() -> { fib(started); }); + // Make half daemons. + threads[i].setDaemon(i % 2 == 0); + threads[i].start(); + } + // Wait for all threads to start. + started.acquire(); + System.out.println("All threads started"); + // sleep a little + Thread.sleep(10); + // Die. + System.out.println("Exiting suddenly"); + exitNow(); + System.out.println("FAILED: Should not reach here!"); + } +} diff --git a/test/1944-sudden-exit/src/art/Trace.java b/test/1944-sudden-exit/src/art/Trace.java new file mode 100644 index 0000000000..8999bb1368 --- /dev/null +++ b/test/1944-sudden-exit/src/art/Trace.java @@ -0,0 +1,68 @@ +/* + * 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. + */ + +package art; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +public class Trace { + public static native void enableTracing(Class<?> methodClass, + Method entryMethod, + Method exitMethod, + Method fieldAccess, + Method fieldModify, + Method singleStep, + Thread thr); + public static native void disableTracing(Thread thr); + + public static void enableFieldTracing(Class<?> methodClass, + Method fieldAccess, + Method fieldModify, + Thread thr) { + enableTracing(methodClass, null, null, fieldAccess, fieldModify, null, thr); + } + + public static void enableMethodTracing(Class<?> methodClass, + Method entryMethod, + Method exitMethod, + Thread thr) { + enableTracing(methodClass, entryMethod, exitMethod, null, null, null, thr); + } + + public static void enableSingleStepTracing(Class<?> methodClass, + Method singleStep, + Thread thr) { + enableTracing(methodClass, null, null, null, null, singleStep, thr); + } + + public static native void watchFieldAccess(Field f); + public static native void watchFieldModification(Field f); + public static native void watchAllFieldAccesses(); + public static native void watchAllFieldModifications(); + + // the names, arguments, and even line numbers of these functions are embedded in the tests so we + // need to add to the bottom and not modify old ones to maintain compat. + public static native void enableTracing2(Class<?> methodClass, + Method entryMethod, + Method exitMethod, + Method fieldAccess, + Method fieldModify, + Method singleStep, + Method ThreadStart, + Method ThreadEnd, + Thread thr); +} diff --git a/test/1944-sudden-exit/sudden_exit.cc b/test/1944-sudden-exit/sudden_exit.cc new file mode 100644 index 0000000000..e0a076efac --- /dev/null +++ b/test/1944-sudden-exit/sudden_exit.cc @@ -0,0 +1,32 @@ +/* + * 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. + */ + +#include <stdlib.h> +#include "jni.h" + +namespace art { +namespace Test1944SuddenExit { + +extern "C" JNIEXPORT void JNICALL Java_art_Test1944_exitNow(JNIEnv*, jclass) + __attribute__((noreturn)); + +extern "C" JNIEXPORT void JNICALL Java_art_Test1944_exitNow(JNIEnv*, jclass) { + exit(12); +} + +} // namespace Test1944SuddenExit +} // namespace art + diff --git a/test/714-invoke-custom-lambda-metafactory/expected.txt b/test/714-invoke-custom-lambda-metafactory/expected.txt index cbe98404c5..54b6c24798 100644 --- a/test/714-invoke-custom-lambda-metafactory/expected.txt +++ b/test/714-invoke-custom-lambda-metafactory/expected.txt @@ -2,3 +2,4 @@ Exception in thread "main" java.lang.BootstrapMethodError: Exception from call s at Main.main(Main.java:25) Caused by: java.lang.NullPointerException: Bootstrap method returned null ... 1 more +exit status: 1 diff --git a/test/714-invoke-custom-lambda-metafactory/run b/test/714-invoke-custom-lambda-metafactory/run new file mode 100755 index 0000000000..7a0d0d05ab --- /dev/null +++ b/test/714-invoke-custom-lambda-metafactory/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright 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. + +# Squash the exit status and put it in expected +./default-run "$@" +echo "exit status:" $? 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/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 72e8eee95a..5f39ffefa9 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -267,12 +267,8 @@ art_cc_defaults { "1942-suspend-raw-monitor-exit/native_suspend_monitor.cc", "1943-suspend-raw-monitor-wait/native_suspend_monitor.cc", ], - shared_libs: [ - "libdexfile", - "libbase", - ], header_libs: [ - "libnativehelper_header_only", + "jni_headers", "libopenjdkjvmti_headers", ], include_dirs: ["art/test/ti-agent"], @@ -294,6 +290,11 @@ art_cc_defaults { "936-search-onload/search_onload.cc", "983-source-transform-verify/source_transform.cc", "1940-ddms-ext/ddm_ext.cc", + "1944-sudden-exit/sudden_exit.cc", + ], + shared_libs: [ + "libbase", + "libdexfile", ], } @@ -312,6 +313,25 @@ art_cc_test_library { shared_libs: ["libartd"], } +art_cc_test_library { + name: "libctstiagent", + defaults: ["libtiagent-base-defaults"], + whole_static_libs: [ + "libdexfile", + "libz", + "libziparchive", + ], + static_libs: [ + "libbase", + "libcutils", + "libutils", + ], + shared_libs: [ + "liblog", + ], + export_include_dirs: ["ti-agent"], +} + art_cc_defaults { name: "libtistress-defaults", defaults: ["libartagent-defaults"], @@ -340,12 +360,6 @@ art_cc_test_library { shared_libs: ["libartd"], } -art_cc_test_library { - name: "libctstiagent", - defaults: ["libtiagent-base-defaults"], - export_include_dirs: ["ti-agent"], -} - cc_defaults { name: "libarttest-defaults", defaults: [ diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 89efd7c507..bb6ace1b06 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -887,11 +887,14 @@ if [ "$HOST" = "n" ]; then adb push $cmdfile $DEX_LOCATION/cmdline.sh > /dev/null 2>&1 fi + exit_status=0 if [ "$DRY_RUN" != "y" ]; then adb shell sh $DEX_LOCATION/cmdline.sh + exit_status=$? fi rm -f $cmdfile + exit $exit_status else # Host run. export ANDROID_PRINTF_LOG=brief @@ -997,10 +1000,12 @@ else trap 'kill -INT -$pid' INT $cmdline "$@" 2>&1 & pid=$! wait $pid + exit_value=$? # Add extra detail if time out is enabled. - if [ ${PIPESTATUS[0]} = 124 ] && [ "$TIME_OUT" = "timeout" ]; then + if [ $exit_value = 124 ] && [ "$TIME_OUT" = "timeout" ]; then echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 fi + exit $exit_value else # With a thread dump that uses gdb if a timeout. trap 'kill -INT -$pid' INT @@ -1023,6 +1028,7 @@ else # The test timed out. echo -e "\e[91mTEST TIMED OUT!\e[0m" >&2 fi + exit $test_exit_status fi fi fi diff --git a/test/knownfailures.json b/test/knownfailures.json index 980d605c7c..8b5c63425c 100644 --- a/test/knownfailures.json +++ b/test/knownfailures.json @@ -653,8 +653,19 @@ "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"] + }, + { + "tests": "712-varhandle-invocations", + "variant": "speed-profile & debug & gcstress & target", + "bug": "b/73275005", + "description": ["Time out"] } ] diff --git a/tools/external_oj_libjdwp_art_failures.txt b/tools/external_oj_libjdwp_art_failures.txt index 828c0aac0f..6c2206fe46 100644 --- a/tools/external_oj_libjdwp_art_failures.txt +++ b/tools/external_oj_libjdwp_art_failures.txt @@ -53,25 +53,6 @@ "org.apache.harmony.jpda.tests.jdwp.VirtualMachine.CapabilitiesNewTest#testCapabilitiesNew001" ] }, { - description: "Test is flaky", - result: EXEC_FAILED, - bug: 69121056, - name: "org.apache.harmony.jpda.tests.jdwp.ObjectReference.IsCollectedTest#testIsCollected001" -}, -{ - description: "Test is flaky", - result: EXEC_FAILED, - bug: 70958370, - names: [ "org.apache.harmony.jpda.tests.jdwp.ObjectReference.EnableCollectionTest#testEnableCollection001", - "org.apache.harmony.jpda.tests.jdwp.MultiSession.EnableCollectionTest#testEnableCollection001" ] -}, -{ - description: "Test crashes", - result: EXEC_FAILED, - bug: 69591477, - name: "org.apache.harmony.jpda.tests.jdwp.VirtualMachine.ExitTest#testExit001" -}, -{ description: "Test times out on fugu-debug", result: EXEC_FAILED, bug: 70459916, diff --git a/tools/prebuilt_libjdwp_art_failures.txt b/tools/prebuilt_libjdwp_art_failures.txt index a9d268de0a..2664560455 100644 --- a/tools/prebuilt_libjdwp_art_failures.txt +++ b/tools/prebuilt_libjdwp_art_failures.txt @@ -102,28 +102,9 @@ "org.apache.harmony.jpda.tests.jdwp.VirtualMachine.CapabilitiesNewTest#testCapabilitiesNew001" ] }, { - description: "Test is flaky", - result: EXEC_FAILED, - bug: 69121056, - name: "org.apache.harmony.jpda.tests.jdwp.ObjectReference.IsCollectedTest#testIsCollected001" -}, -{ description: "Test for ddms extensions that are not implemented for prebuilt-libjdwp", result: EXEC_FAILED, bug: 69169846, name: "org.apache.harmony.jpda.tests.jdwp.DDM.DDMTest#testChunk001" }, -{ - description: "Test is flakey", - result: EXEC_FAILED, - bug: 70958370, - names: [ "org.apache.harmony.jpda.tests.jdwp.ObjectReference.EnableCollectionTest#testEnableCollection001", - "org.apache.harmony.jpda.tests.jdwp.MultiSession.EnableCollectionTest#testEnableCollection001" ] -}, -{ - description: "Test crashes", - result: EXEC_FAILED, - bug: 69591477, - name: "org.apache.harmony.jpda.tests.jdwp.VirtualMachine.ExitTest#testExit001" -} ] |