summaryrefslogtreecommitdiff
path: root/runtime/entrypoints_order_test.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2022-09-14 22:45:40 +0000
committer Hans Boehm <hboehm@google.com> 2022-10-12 22:41:25 +0000
commitfd20a745227aa7cae7a08728bb29e5bfce64ea87 (patch)
tree3a39bacc9c52bfd68abb4976b083359636d8fc78 /runtime/entrypoints_order_test.cc
parent40bc9dc50978a7e8a7d41f551adef02ad2546254 (diff)
Revert^2 "Thread suspension cleanup and deadlock fix"
This reverts commit 7c8835df16147b9096dd4c9380ab4b5f700ea17d. PS1 is identical to aosp/2171862 . PS2 makes the following significant changes: 1) Avoid inflating locks from the thread dumping checkpoint Run() method. This violates the repeatedly stated claim that checkpoint Run() methods don't suspend threads. This requires that we print object addresses in thread dumps in some cases in which we were previously able to give hashcodes instead. 2) For debug builds, check that we do not acquire a higher level lock in checkpoint Run() methods, thus enforcing that previously stated property. (Lokesh suggested this, and I think it's a great idea. But it requires changes 4-6 below.) 3) Add a bit more justification that RunCheckpoint cannot result in circular suspend requests. 4) For now, allow an explicit override of (2) for ddms code in which it would otherwise fail. This should be fixed later. 5) Raise the level of monitor locks, to correctly reflect the fact that they may be held while much of the runtime is executed. 6) (5) was in conflict with monitor deflation acquiring a monitor lock after acquiring the monitor list lock. But this failure is spurious, both because it is a TryLock acquisition that can't possibly contributed to a deadlock, and secondly because it conflates all monitor locks, and an actual deadlock is probably not possible anyway. Leverage the former and add a facility to avoid checking for safe TryLock calls. (1) Should fix the one failure I managed to debug after the last submission attempt. Hopefully it also accounts for the others. PS3, PS5, PS6: Trivial corrections and cleanups PS4, PS7, PS8: Rebase Test: Build and boot AOSP, Treehugger Bug: 240742796 Bug: 203363895 Bug: 238032384 Change-Id: I80d441ebe21bb30b586131f7d22b7f2797f2c45f
Diffstat (limited to 'runtime/entrypoints_order_test.cc')
-rw-r--r--runtime/entrypoints_order_test.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/runtime/entrypoints_order_test.cc b/runtime/entrypoints_order_test.cc
index e969652c7a..bccfa52f92 100644
--- a/runtime/entrypoints_order_test.cc
+++ b/runtime/entrypoints_order_test.cc
@@ -111,13 +111,15 @@ class EntrypointsOrderTest : public CommonRuntimeTest {
sizeof(void*));
EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, last_no_thread_suspension_cause, checkpoint_function,
sizeof(void*));
- EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, checkpoint_function, active_suspend_barriers,
+ EXPECT_OFFSET_DIFFP(Thread, tlsPtr_, checkpoint_function, 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_, 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_, 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, jni_entrypoints, sizeof(size_t));