[PATCH] D153081: [lsan] Remove use_tls=0 from a few tests

Leonard Grey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 15:39:19 PDT 2023


lgrey created this revision.
lgrey added a reviewer: vitalybuka.
Herald added a subscriber: Enna1.
Herald added a project: All.
lgrey requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

The Objective-C runtime now stashes some state in TLS (https://github.com/apple-oss-distributions/objc4/blob/689525d556eb3dee1ffb700423bccf5ecc501dbf/runtime/objc-initialize.mm#LL139C45-L139C45) so any test that indirectly initializes an Objective-C object will have false positive leaks unless `use_tls=1` as is the default.
Example: https://bugs.chromium.org/p/chromium/issues/detail?id=1453649#c3

I removed `use_tls=0` unconditionally because it doesn't seem essential to any of these tests. Happy to only do this for Darwin if that doesn't work :)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153081

Files:
  compiler-rt/test/lsan/TestCases/disabler.c
  compiler-rt/test/lsan/TestCases/disabler.cpp
  compiler-rt/test/lsan/TestCases/ignore_object.c


Index: compiler-rt/test/lsan/TestCases/ignore_object.c
===================================================================
--- compiler-rt/test/lsan/TestCases/ignore_object.c
+++ compiler-rt/test/lsan/TestCases/ignore_object.c
@@ -1,6 +1,6 @@
 // Test for __lsan_ignore_object().
 // RUN: %clang_lsan %s -o %t
-// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0:use_tls=0 not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0 not %run %t 2>&1 | FileCheck %s
 
 // Investigate why it does not fail with use_stack=0
 // UNSUPPORTED: arm-linux || armhf-linux
Index: compiler-rt/test/lsan/TestCases/disabler.cpp
===================================================================
--- compiler-rt/test/lsan/TestCases/disabler.cpp
+++ compiler-rt/test/lsan/TestCases/disabler.cpp
@@ -1,6 +1,6 @@
 // Test for ScopedDisabler.
 // RUN: %clangxx_lsan %s -o %t
-// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0:use_tls=0 not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0 not %run %t 2>&1 | FileCheck %s
 
 #include <stdio.h>
 #include <stdlib.h>
Index: compiler-rt/test/lsan/TestCases/disabler.c
===================================================================
--- compiler-rt/test/lsan/TestCases/disabler.c
+++ compiler-rt/test/lsan/TestCases/disabler.c
@@ -1,6 +1,6 @@
 // Test for __lsan_disable() / __lsan_enable().
 // RUN: %clang_lsan %s -o %t
-// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0:use_tls=0 not %run %t 2>&1 | FileCheck %s
+// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0 not %run %t 2>&1 | FileCheck %s
 
 // Investigate why it does not fail with use_tls=0
 // UNSUPPORTED: arm-linux || armhf-linux


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153081.531921.patch
Type: text/x-patch
Size: 1791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230615/9129f4c4/attachment.bin>


More information about the llvm-commits mailing list