diff options
author | 2019-11-27 15:47:02 -0800 | |
---|---|---|
committer | 2019-12-02 18:22:10 +0000 | |
commit | c6ca1170904c9f5bbdf0ee5b12d6d4cb093739fc (patch) | |
tree | b87de8f1391ed8ff0763f9d02f110edd032d7a91 /runtime/thread.cc | |
parent | be52a17c0f6af1c7563d8b9736ac4ace9b7ae0f0 (diff) |
Assert mutator doesn't get mark-stack assigned once destroyed
Write a non-null value to thread-local mark-stack pointer when
a mutator revokes the previously assigned thread-local mark-stack
so that we can catch the mutator if it ever invokes the read-barrier
or executes the flip function, both of which may assign mark-stack
to the mutator.
Test: art/test/testrunner/testrunner.py
Bug:140119552
Change-Id: I82f43c8a3aab6dacb0f6bd35471fc2cdd969b154
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r-- | runtime/thread.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index 59a38e161d..6f0776b6b5 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -2466,7 +2466,9 @@ Thread::~Thread() { Runtime::Current()->GetHeap()->ConcurrentCopyingCollector() ->AssertNoThreadMarkStackMapping(this); gc::accounting::AtomicStack<mirror::Object>* tl_mark_stack = GetThreadLocalMarkStack(); - CHECK(tl_mark_stack == nullptr) << "mark-stack: " << tl_mark_stack; + CHECK(tl_mark_stack == nullptr + || tl_mark_stack == reinterpret_cast<gc::accounting::AtomicStack<mirror::Object>*>(0x1)) + << "mark-stack: " << tl_mark_stack; } // Make sure we processed all deoptimization requests. CHECK(tlsPtr_.deoptimization_context_stack == nullptr) << "Missed deoptimization"; |