xref: /aosp_15_r20/external/cronet/build/sanitizers/lsan_suppressions.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2015 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // This file contains the default suppressions for LeakSanitizer.
6 // You can also pass additional suppressions via LSAN_OPTIONS:
7 // LSAN_OPTIONS=suppressions=/path/to/suppressions. Please refer to
8 // http://dev.chromium.org/developers/testing/leaksanitizer for more info.
9 
10 #include "build/build_config.h"
11 
12 #if defined(LEAK_SANITIZER)
13 
14 // Please make sure the code below declares a single string variable
15 // kLSanDefaultSuppressions which contains LSan suppressions delimited by
16 // newlines. See http://dev.chromium.org/developers/testing/leaksanitizer
17 // for the instructions on writing suppressions.
18 char kLSanDefaultSuppressions[] =
19     // Intentional leak used as sanity test for Valgrind/memcheck.
20     "leak:base::ToolsSanityTest_MemoryLeak_Test::TestBody\n"
21 
22     // ================ Leaks in third-party code ================
23 
24     // False positives in libfontconfig. http://crbug.com/39050
25     "leak:libfontconfig\n"
26     "leak:libthird_party_fontconfig\n"
27     // eglibc-2.19/string/strdup.c creates false positive leak errors because of
28     // the same reason as crbug.com/39050. The leak error stack trace, when
29     // unwind on malloc, includes a call to libfontconfig. But the default stack
30     // trace is too short in leak sanitizer bot to make the libfontconfig
31     // suppression works. http://crbug.com/605286
32     "leak:__strdup\n"
33 
34     // Leaks in GL and Vulkan drivers and system libraries on Linux NVIDIA
35     "leak:libGL.so\n"
36     "leak:libGLX_nvidia.so\n"
37     "leak:libnvidia-cbl.so\n"
38     "leak:libnvidia-fatbinaryloader.so\n"
39     "leak:libnvidia-glcore.so\n"
40     "leak:libnvidia-rtcore.so\n"
41     "leak:nvidia0\n"
42     "leak:nvidiactl\n"
43     "leak:libdbus-1.so\n"
44 
45     // XRandR has several one time leaks.
46     "leak:libxrandr\n"
47 
48     // xrandr leak. http://crbug.com/119677
49     "leak:XRRFindDisplay\n"
50 
51     // http://crbug.com/431213, http://crbug.com/416665
52     "leak:gin/object_template_builder.h\n"
53     "leak:gin/function_template.h\n"
54 
55     // Leaks in swrast_dri.so. http://crbug.com/540042
56     "leak:swrast_dri.so\n"
57 
58     // Leak in glibc's gconv caused by fopen(..., "r,ccs=UNICODE")
59     "leak:__gconv_lookup_cache\n"
60 
61     // Leak in libnssutil. crbug.com/1290634
62     "leak:libnssutil3\n"
63 
64     // Suppress leaks from unknown third party modules. http://anglebug.com/6937
65     "leak:<unknown module>\n"
66 
67     // Suppress leaks from temporary files. http://crbug.com/1433299
68     "leak:(deleted)\n"
69 
70     // ================ Leaks in Chromium code ================
71     // PLEASE DO NOT ADD SUPPRESSIONS FOR NEW LEAKS.
72     // Instead, commits that introduce memory leaks should be reverted.
73     // Suppressing the leak is acceptable in some cases when reverting is
74     // impossible, i.e. when enabling leak detection for the first time for a
75     // test target with pre-existing leaks.
76 
77     // v8 leaks caused by weak ref not call
78     "leak:blink::DOMWrapperWorld::Create\n"
79     "leak:blink::ScriptState::Create\n"
80 
81     // Crash keys are intentionally leaked.
82     "leak:crash_reporter::(anonymous "
83     "namespace)::CrashKeyBaseSupport::Allocate\n"
84 
85     // Suppress leaks in CreateCdmInstance. https://crbug.com/961062
86     "leak:media::CdmAdapter::CreateCdmInstance\n"
87 
88 #if BUILDFLAG(IS_CHROMEOS)
89     // Suppress leak in FileStream. crbug.com/1263374
90     "leak:chromeos::PipeReader::StartIO\n"
91     // Supppress AnimationObserverToHideView leak. crbug.com/1261464
92     "leak:ash::ShelfNavigationWidget::UpdateButtonVisibility\n"
93     // Suppress AnimationSequence leak. crbug.com/1265031
94     "leak:ash::LockStateController::StartPostLockAnimation\n"
95     // Suppress leak in SurfaceDrawContext. crbug.com/1265033
96     "leak:skgpu::v1::SurfaceDrawContext::drawGlyphRunList\n"
97     // Suppress leak in BluetoothServerSocket. crbug.com/1278970
98     "leak:nearby::chrome::BluetoothServerSocket::"
99     "BluetoothServerSocket\n"
100     // Suppress leak in NearbyConnectionBrokerImpl. crbug.com/1279578
101     "leak:ash::secure_channel::NearbyConnectionBrokerImpl\n"
102     // Suppress leak in NearbyEndpointFinderImpl. crbug.com/1288577
103     "leak:ash::secure_channel::NearbyEndpointFinderImpl::~"
104     "NearbyEndpointFinderImpl\n"
105     // Suppress leak in DelayedCallbackGroup test. crbug.com/1279563
106     "leak:DelayedCallbackGroup_TimeoutAndRun_Test\n"
107 #endif
108 #if BUILDFLAG(IS_MAC)
109     // These are caused by the system, but not yet clear if they are false
110     // positives or bugs in the Mac LSAN runtime. Suppress while investigating.
111     // TODO(https://crbug.com/1320449): Remove these if/when fixed in macOS
112     // or the runtime.
113     "leak:_ensureAuxServiceAwareOfHostApp\n"
114     "leak:cssmErrorString\n"
115 #endif
116 
117     // PLEASE READ ABOVE BEFORE ADDING NEW SUPPRESSIONS.
118 
119     // End of suppressions.
120     ;  // Please keep this semicolon.
121 
122 #endif  // LEAK_SANITIZER
123