Skip to content

Commit 1643244

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Set detect_leaks=1 in various places where we do ASAN builds in CI. (#20246)
1 parent f4388e9 commit 1643244

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

.github/workflows/build.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ jobs:
377377
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
378378
- name: Setup Build, Run Build and Run Tests
379379
timeout-minutes: 120
380+
# We can't enable leak checking here in LSAN_OPTIONS, because on
381+
# Darwin that's only supported with a new endough clang, and we're
382+
# not building with the pigweed clang here.
380383
run: |
381384
for BUILD_TYPE in default python_lib; do
382385
case $BUILD_TYPE in

.github/workflows/darwin-tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
build_variant: [no-ble-asan]
3636
env:
3737
BUILD_VARIANT: ${{matrix.build_variant}}
38+
LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
3839

3940
if: github.actor != 'restyled-io[bot]'
4041
runs-on: macos-latest

.github/workflows/tests.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
BUILD_VARIANT: ${{matrix.build_variant}}
3939
CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
4040
TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt"
41+
LSAN_OPTIONS: detect_leaks=1
4142

4243
if: github.actor != 'restyled-io[bot]'
4344
runs-on: ubuntu-latest
@@ -132,6 +133,7 @@ jobs:
132133
BUILD_VARIANT: ${{matrix.build_variant}}
133134
CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
134135
TSAN_OPTIONS: "halt_on_error=1"
136+
LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
135137

136138
if: github.actor != 'restyled-io[bot]'
137139
runs-on: macos-latest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Looks like some Objective C class bits are leaked, which is probably OK since
2+
# those are singletons.
3+
leak:realizeClassWithoutSwift
4+
leak:objc_initializeClassPair_internal
5+
6+
# TODO: Under [NSManagedObjectContext executeFetchRequest] there are managed object bits that seem to be leaky.
7+
leak:class_addMethod
8+
leak:class_addIvar
9+
10+
# TODO: Leaks of blocks from dispatch source handlers that need to be investigated.
11+
leak:_Block_copy
12+
13+
# TODO: OpenSSL random byte generation creates some sort of pools that we seem to never clean up. This seems to be happening a _lot_.
14+
leak:drbg_ctr_init
15+
leak:rand_pool_new
16+
leak:RAND_priv_bytes
17+
leak:drbg_bytes
18+
19+
# TODO: OpenSSL ERR_get_state seems to leak.
20+
leak:ERR_get_state

0 commit comments

Comments
 (0)