Merge "Fix oatdumpd."
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 53b07f9..2a0d826 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -808,6 +808,10 @@
     {
       WriterMutexLock mu(self, *Locks::heap_bitmap_lock_);
       heap->FlushAllocStack();
+      // Since FlushAllocStack() above resets the (active) allocation
+      // stack. Need to revoke the thread-local allocation stacks that
+      // point into it.
+      heap->RevokeAllThreadLocalAllocationStacks(self);
     }
     {
       std::ostream* saved_os = os_;
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 9b763cb..21a2365 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -476,6 +476,9 @@
   void FlushAllocStack()
       EXCLUSIVE_LOCKS_REQUIRED(Locks::heap_bitmap_lock_);
 
+  // Revoke all the thread-local allocation stacks.
+  void RevokeAllThreadLocalAllocationStacks(Thread* self);
+
   // Mark all the objects in the allocation stack in the specified bitmap.
   void MarkAllocStack(accounting::SpaceBitmap* bitmap1, accounting::SpaceBitmap* bitmap2,
                       accounting::ObjectSet* large_objects, accounting::ObjectStack* stack)
@@ -672,9 +675,6 @@
   // Swap the allocation stack with the live stack.
   void SwapStacks(Thread* self);
 
-  // Revoke all the thread-local allocation stacks.
-  void RevokeAllThreadLocalAllocationStacks(Thread* self);
-
   // Clear cards and update the mod union table.
   void ProcessCards(TimingLogger& timings);