mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
tests: don't change malloc for tests
system_malloc is causing test flakes. The issue with tcmalloc is it isn't fork-safe and any allocations in forked sub-processes can stuck. PiperOrigin-RevId: 581372831
This commit is contained in:
@@ -4649,6 +4649,8 @@ cc_binary(
|
||||
testonly = 1,
|
||||
srcs = ["process_vm_read_write.cc"],
|
||||
linkstatic = 1,
|
||||
# tcmalloc isn't fork-safe.
|
||||
tcmalloc = False,
|
||||
deps = [
|
||||
gtest,
|
||||
"//test/util:logging",
|
||||
|
||||
@@ -26,12 +26,13 @@ cc_flags_supplier = rule(
|
||||
def cc_grpc_library(name, **kwargs):
|
||||
_cc_grpc_library(name = name, grpc_only = True, **kwargs)
|
||||
|
||||
def cc_binary(name, static = False, **kwargs):
|
||||
def cc_binary(name, static = False, tcmalloc = False, **kwargs):
|
||||
"""Run cc_binary.
|
||||
|
||||
Args:
|
||||
name: name of the target.
|
||||
static: make a static binary if True
|
||||
tcmalloc: use TCMalloc if True (not implemented)
|
||||
**kwargs: the rest of the args.
|
||||
"""
|
||||
if static:
|
||||
@@ -46,6 +47,10 @@ def cc_binary(name, static = False, **kwargs):
|
||||
"-lpthread",
|
||||
"-Wl,--no-whole-archive",
|
||||
]
|
||||
if tcmalloc:
|
||||
# buildifier: disable=print
|
||||
print("Warning: tcmalloc can't be enabled")
|
||||
|
||||
_cc_binary(
|
||||
name = name,
|
||||
**kwargs
|
||||
|
||||
Reference in New Issue
Block a user