diff options
author | 2023-08-24 18:35:50 +0000 | |
---|---|---|
committer | 2023-09-09 18:03:51 +0000 | |
commit | f9fdd3ce0180972dc8d4f0c8410ea7702828a703 (patch) | |
tree | 903b17909ac50aeb4c7e5f307e5524210c699fc4 /runtime/entrypoints_order_test.cc | |
parent | 2237607aca5e75d0b608500f8d140a0ed6c7a698 (diff) |
Revert^14 "Thread suspension cleanup and deadlock fix"
This reverts commit 2a52e8a50c3bc9011713a085f058130bb13fd6a6.
PS1 is identical to aosp/2710354.
PS2 fixes a serious bug in the ThreadExitFlag list handling code.
This didn't show up in presubmit because the list rarely contains
more than a single element. Added an explicit gtest, and a bunch
of DCHECKS around this.
PS3 Rebase and fix oat version. Once more.
PS4 Weaken CheckEmptyCheckpointFromWeakRefAccess check to allow
weak reference access in a checkpoint.
This happens via DumpLavaStack -> ... -> MonitorObjectsStackVisitor
-> ... -> FindResolvedMethod -> ... -> IsDexFileRegistered. I haven't
yet been able to convince myself that this is inherently broken,
though it is trickier than I would like.
PS5 Move cp_placeholder_mutex_ declaration higher in thread.h.
Test: m test-art-host-gtest
Change-Id: I66342ef1de27bfa0272702b5e1d3063ef8da7394
Diffstat (limited to 'runtime/entrypoints_order_test.cc')
-rw-r--r-- | runtime/entrypoints_order_test.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/entrypoints_order_test.cc b/runtime/entrypoints_order_test.cc index 9b4af663a0..a2d5a436d0 100644 --- a/runtime/entrypoints_order_test.cc +++ b/runtime/entrypoints_order_test.cc @@ -70,7 +70,6 @@ class EntrypointsOrderTest : public CommonArtTest { EXPECT_OFFSET_DIFFP(Thread, tls32_, daemon, throwing_OutOfMemoryError, 4); EXPECT_OFFSET_DIFFP(Thread, tls32_, throwing_OutOfMemoryError, no_thread_suspension, 4); EXPECT_OFFSET_DIFFP(Thread, tls32_, no_thread_suspension, thread_exit_check_count, 4); - EXPECT_OFFSET_DIFFP(Thread, tls32_, thread_exit_check_count, is_transitioning_to_runnable, 4); // TODO: Better connection. Take alignment into account. EXPECT_OFFSET_DIFF_GT3(Thread, tls32_.thread_exit_check_count, tls64_.trace_clock_base, 4, @@ -108,13 +107,14 @@ class EntrypointsOrderTest : public CommonArtTest { EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, name, pthread_self, sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, pthread_self, last_no_thread_suspension_cause, sizeof(void*)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, last_no_thread_suspension_cause, active_suspend_barriers, - sizeof(void*)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspend_barriers, thread_local_start, - sizeof(Thread::tls_ptr_sized_values::active_suspend_barriers)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_start, thread_local_pos, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, last_no_thread_suspension_cause, + active_suspendall_barrier, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspendall_barrier, + active_suspend1_barriers, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, active_suspend1_barriers, thread_local_pos, sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_pos, thread_local_end, sizeof(void*)); - EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_end, thread_local_limit, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_end, thread_local_start, sizeof(void*)); + EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_start, thread_local_limit, sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_limit, thread_local_objects, sizeof(void*)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, thread_local_objects, checkpoint_function, sizeof(size_t)); EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, checkpoint_function, jni_entrypoints, @@ -137,11 +137,12 @@ class EntrypointsOrderTest : public CommonArtTest { Thread, tlsPtr_, top_reflective_handle_scope, method_trace_buffer, sizeof(void*)); EXPECT_OFFSET_DIFFP( Thread, tlsPtr_, method_trace_buffer, method_trace_buffer_index, sizeof(void*)); + EXPECT_OFFSET_DIFFP( + Thread, tlsPtr_, method_trace_buffer_index, thread_exit_flags, sizeof(void*)); // The first field after tlsPtr_ is forced to a 16 byte alignment so it might have some space. auto offset_tlsptr_end = OFFSETOF_MEMBER(Thread, tlsPtr_) + sizeof(decltype(reinterpret_cast<Thread*>(16)->tlsPtr_)); - CHECKED(offset_tlsptr_end - OFFSETOF_MEMBER(Thread, tlsPtr_.method_trace_buffer_index) == - sizeof(void*), + CHECKED(offset_tlsptr_end - OFFSETOF_MEMBER(Thread, tlsPtr_.thread_exit_flags) == sizeof(void*), "async_exception last field"); } |