Commit 193e9210 authored by Brett Wilson's avatar Brett Wilson Committed by Commit Bot

Initialize stack dumping in OOP memlog.

Failing to explicitly initialize stack dumping before adding a malloc hook that
uses it can cause problems. In particular, on Linux calling backtrace() can
load a library which calls malloc, meaning the hook will be recursive.

Bug: 764522
Change-Id: If602902aa4238903541ca52f765927369dbf6e71
Reviewed-on: https://chromium-review.googlesource.com/664301Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501644}
parent 4d42f56b
......@@ -185,8 +185,10 @@ void HookPartitionFree(void* address) {
} // namespace
void InitAllocatorShim(MemlogSenderPipe* sender_pipe) {
g_send_buffers = new SendBuffer[kNumSendBuffers];
// Must be done before hooking any functions that make stack traces.
base::debug::EnableInProcessStackDumping();
g_send_buffers = new SendBuffer[kNumSendBuffers];
g_sender_pipe = sender_pipe;
#if BUILDFLAG(USE_ALLOCATOR_SHIM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment