Make sure iterateConservativeRoots scans callee saved registers.
commit98d2e52a78dad512e145f612dafe39e14ddf3b0b
authorAlexey Toptygin <alexeyt@fb.com>
Tue, 8 May 2018 16:19:16 +0000 (8 09:19 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 8 May 2018 16:23:30 +0000 (8 09:23 -0700)
treec282e4f0a6ebc47eed4b975a119030170688186a
parentfaab68f3e96dfa3d75ff3e0838dbbfacd21a5277
Make sure iterateConservativeRoots scans callee saved registers.

Summary:
While looking at the heap curruption in T28927858, I noticed that rsp in iterateConservativeRoots was below the range of addresses that was being conservatively scanned as the C++ stack (from stack_top_ptr() to s_stackLimit + s_stackSize). This is because stack_top_ptr() is inline and returns the address of the caller's frame. This is problematic, since we spill callee saved registers into iterateConservativeRoots' frame and we need to scan them.
Make a NEVER_INLINE version of stack_top_ptr that always creates a new frame before getting the frame address and use it in iterateConservativeRoots to make sure we're scanning the callee saved registers we just spilled.

Reviewed By: markw65

Differential Revision: D7907668

fbshipit-source-id: a8110647644db937c863077c934fc6c6dbf991f7
hphp/runtime/base/heap-scan.h
hphp/runtime/base/thread-info.cpp
hphp/runtime/base/thread-info.h