Commit 6a380975 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Do not install allocator shim on iOS 13.4 due to high crash volume

This CL workarounds the crash by not installing allocator shim only on
iOS 13.4. The root cause of the crash is unknown, but the crash volume
is too big to ignore the problem.

Bug: 1108219
Change-Id: I44ce06d216c6dc51f66ab1ba7b047e4d1a48394a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335030
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Auto-Submit: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795245}
parent 6aa477da
......@@ -8,6 +8,7 @@
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/ios/ios_util.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/user_metrics.h"
#include "base/path_service.h"
......@@ -75,6 +76,16 @@
#error "This file requires ARC support."
#endif
namespace {
// Do not install allocator shim on iOS 13.4 due to high crash volume on this
// particular version of OS. TODO(crbug.com/1108219): Remove this workaround
// when/if the bug gets fixed.
bool ShouldInstallAllocatorShim() {
return !base::ios::IsRunningOnOrLater(13, 4, 0) ||
base::ios::IsRunningOnOrLater(13, 5, 0);
}
} // namespace
IOSChromeMainParts::IOSChromeMainParts(
const base::CommandLine& parsed_command_line)
: parsed_command_line_(parsed_command_line), local_state_(nullptr) {
......@@ -88,7 +99,9 @@ IOSChromeMainParts::~IOSChromeMainParts() {}
void IOSChromeMainParts::PreEarlyInitialization() {
#if BUILDFLAG(USE_ALLOCATOR_SHIM)
if (ShouldInstallAllocatorShim()) {
base::allocator::InitializeAllocatorShim();
}
#endif
}
......@@ -154,6 +167,10 @@ void IOSChromeMainParts::PreCreateThreads() {
SetupFieldTrials();
#if BUILDFLAG(USE_ALLOCATOR_SHIM)
// Do not install allocator shim on iOS 13.4 due to high crash volume on this
// particular version of OS. TODO(crbug.com/1108219): Remove this workaround
// when/if the bug gets fixed.
if (ShouldInstallAllocatorShim()) {
// Start heap profiling as early as possible so it can start recording
// memory allocations. Requires the allocator shim to be enabled.
heap_profiler_controller_ = std::make_unique<HeapProfilerController>();
......@@ -161,6 +178,7 @@ void IOSChromeMainParts::PreCreateThreads() {
base::BindRepeating(
&metrics::CallStackProfileMetricsProvider::ReceiveProfile));
heap_profiler_controller_->Start();
}
#endif
variations::InitCrashKeys();
......
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