Add checkPointers() pass to checkHeap(), and add gc_check_heap()
commit10d417f7109802b4fd6dfde04df8be42d29894e3
authorEdwin Smith <smith@fb.com>
Mon, 26 Oct 2015 23:48:17 +0000 (26 16:48 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Mon, 26 Oct 2015 23:54:44 +0000 (26 16:54 -0700)
tree048968c7261bd2aac7d82991fef8cd11d97ec466
parentd0d8fd9b13b567da734e0cdc53662e9fd8e5bb37
Add checkPointers() pass to checkHeap(), and add gc_check_heap()

Summary: gc_check_heap() makes it possible for PHP to invoke heap integrity checks
for debugging. no arguments and no return values, for now.

checkPointers() allows us to find bugs where the number of traced pointers
disagrees with an object's reference count. This can happen either from
incomplete tracing (gc bug) or missing inc/decref (refcounting bug). If the
count is too low, we have dangling pointers and potential crashes. If the
count is too high, we have missing pointers and potential leaks.

Reviewed By: markw65

Differential Revision: D2416471

fb-gh-sync-id: 24c28c47988773ca4c8fea0b2293c00ececf8870
19 files changed:
hphp/hack/hhi/stdlib/builtins_options.hhi
hphp/runtime/base/execution-context.h
hphp/runtime/base/heap-collect.cpp
hphp/runtime/base/heap-graph.cpp
hphp/runtime/base/heap-graph.h
hphp/runtime/base/heap-report.cpp
hphp/runtime/base/heap-scan.h
hphp/runtime/base/memory-manager-defs.h
hphp/runtime/base/memory-manager-inl.h
hphp/runtime/base/memory-manager.cpp
hphp/runtime/base/memory-manager.h
hphp/runtime/base/program-functions.cpp
hphp/runtime/ext/objprof/ext_heapgraph.cpp
hphp/runtime/ext/std/ext_std_gc.cpp
hphp/runtime/ext/std/ext_std_gc.php
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/globals-array.cpp
hphp/runtime/vm/name-value-table.cpp
hphp/runtime/vm/name-value-table.h