Commit 336a5ae9 authored by Rob Hueber's avatar Rob Hueber Committed by Commit Bot

Disable tcmalloc for audio cast devices

In cast audio devices there are a number of libraries that statically
link in libbase, resulting in each library having its own copy of
tcmalloc. During static initialization of a library, the tcmalloc in
that library is called directly, and tcmalloc can call sbrk() which is
not thread safe. By disabling tcmalloc, we avoid the possibility of
multiple calls to sbrk() causing crashes on cast audio devices.

Bug: 1002281
Test: Build and run cast_shell and chrome
Change-Id: Ib5707d0132596ea73cc8dd9ef68fac049334e17c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795754
Commit-Queue: Rob Hueber <rhueber@google.com>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695336}
parent f62fb016
......@@ -2,11 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
import("//build/config/sanitizers/sanitizers.gni")
# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors.
if (is_android || is_mac || is_ios || is_asan || is_lsan || is_tsan ||
is_msan || is_win || is_fuchsia || (is_linux && target_cpu == "arm64")) {
is_msan || is_win || is_fuchsia || (is_linux && target_cpu == "arm64") ||
(is_cast_audio_only && target_cpu == "arm")) {
_default_allocator = "none"
} else {
_default_allocator = "tcmalloc"
......
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