// Ensure that abort works with ThreadList locks held.
TEST_F(RuntimeTest, AbortWithThreadListLockHeld) { // This assumes the test is run single-threaded: do not start the runtime to avoid daemon threads.
constexpr constchar* kDeathRegex = "Skipping all-threads dump as locks are held";
ASSERT_DEATH({ // The regex only works if we can ensure output goes to stderr.
android::base::SetLogger(android::base::StderrLogger);
MutexLock mu(Thread::Current(), *Locks::thread_list_lock_);
Runtime::Abort("Attempt to abort");
}, kDeathRegex);
}
TEST_F(RuntimeTest, AbortWithThreadSuspendCountLockHeld) { // This assumes the test is run single-threaded: do not start the runtime to avoid daemon threads.
constexpr constchar* kDeathRegex = "Skipping all-threads dump as locks are held";
ASSERT_DEATH({ // The regex only works if we can ensure output goes to stderr.
android::base::SetLogger(android::base::StderrLogger);
MutexLock mu(Thread::Current(), *Locks::thread_suspend_count_lock_);
Runtime::Abort("Attempt to abort");
}, kDeathRegex);
}
TEST_F(RuntimeTest, AbortFromUnattachedThread) { // This assumes the test is run single-threaded: do not start the runtime to avoid daemon threads.
constexpr constchar* kDeathRegex = "Going down";
ASSERT_EXIT({ // The regex only works if we can ensure output goes to stderr.
android::base::SetLogger(android::base::StderrLogger);
// It is possible to run tests that validate an existing deployed on-device ART APEX ('standalone' // tests). If these tests expect to load ELF files with a particular alignment, but those ELF files // were created with a different alignment, there will be many difficult-to-debug failures. This // test aims to identify this mismatch, related to whether or not the runtimes were built to be // page-size agnostic.
TEST_F(RuntimeTest, ElfAlignmentMismatch) { #ifdef ART_TARGET_ANDROID bool platform_pga = android::base::GetBoolProperty("ro.product.build.no_bionic_page_size_macro", false); if (kPageSizeAgnostic != platform_pga) {
LOG(WARNING) << "Test configured with kPageSizeAgnostic=" << kPageSizeAgnostic << ", but "
<< "platform ro.product.build.no_bionic_page_size_macro=" << platform_pga << ".";
} #endif // Determine the alignment of the ART APEX by reading the alignment of boot.oat.
std::string core_oat_location = GetSystemImageFilename(GetCoreOatLocation().c_str(),
kRuntimeQuickCodeISA);
std::unique_ptr<File> core_oat_file(OS::OpenFileForReading(core_oat_location.c_str()));
ASSERT_TRUE(core_oat_file.get() != nullptr) << core_oat_location;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.