Skip to content

Commit f8e2ec1

Browse files
committed
Revert "Add asan tests for libsanitizers. (#88349)"
This reverts commit 82f479b due to bot breakage.
1 parent bf1ad1d commit f8e2ec1

File tree

4 files changed

+5
-97
lines changed

4 files changed

+5
-97
lines changed
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
C_SOURCES := main.c
2-
asan: CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
3-
asan: all
4-
5-
libsanitizers: CFLAGS_EXTRAS := -fsanitize=address -fsanitize-stable-abi -g -gcolumn-info
6-
libsanitizers: all
2+
CFLAGS_EXTRAS := -fsanitize=address -g -gcolumn-info
73

84
include Makefile.rules

lldb/test/API/functionalities/asan/TestMemoryHistory.py

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,15 @@
99
from lldbsuite.test import lldbplatform
1010
from lldbsuite.test import lldbutil
1111

12-
from functionalities.libsanitizers.util import no_libsanitizers
1312

1413
class AsanTestCase(TestBase):
1514
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
1615
@expectedFailureNetBSD
1716
@skipUnlessAddressSanitizer
1817
def test(self):
19-
self.build(make_targets=["asan"])
18+
self.build()
2019
self.asan_tests()
2120

22-
@skipIf(oslist=no_match(["macosx"]))
23-
def test_libsanitizers_asan(self):
24-
self.build(make_targets=["libsanitizers"])
25-
self.libsanitizer_tests()
26-
2721
def setUp(self):
2822
# Call super's setUp().
2923
TestBase.setUp(self)
@@ -32,71 +26,6 @@ def setUp(self):
3226
self.line_free = line_number("main.c", "// free line")
3327
self.line_breakpoint = line_number("main.c", "// break line")
3428

35-
# Test line numbers: rdar://126237493
36-
def libsanitizer_tests(self):
37-
target = self.createTestTarget()
38-
39-
if no_libsanitizers(self):
40-
self.skipTest("libsanitizers not found")
41-
42-
self.runCmd(
43-
"env SanitizersAddress=1 MallocSanitizerZone=1 MallocSecureAllocator=0"
44-
)
45-
46-
self.runCmd("run")
47-
48-
# In libsanitizers, memory history is not supported until a report has been generated
49-
self.expect(
50-
"thread list",
51-
"Process should be stopped due to ASan report",
52-
substrs=["stopped", "stop reason = Use of deallocated memory"],
53-
)
54-
55-
# test the 'memory history' command
56-
self.expect(
57-
"memory history 'pointer'",
58-
substrs=[
59-
"Memory deallocated by Thread",
60-
"a.out`f2",
61-
"main.c",
62-
"Memory allocated by Thread",
63-
"a.out`f1",
64-
"main.c",
65-
],
66-
)
67-
68-
# do the same using SB API
69-
process = self.dbg.GetSelectedTarget().process
70-
val = (
71-
process.GetSelectedThread().GetSelectedFrame().EvaluateExpression("pointer")
72-
)
73-
addr = val.GetValueAsUnsigned()
74-
threads = process.GetHistoryThreads(addr)
75-
self.assertEqual(threads.GetSize(), 2)
76-
77-
history_thread = threads.GetThreadAtIndex(0)
78-
self.assertTrue(history_thread.num_frames >= 2)
79-
self.assertEqual(
80-
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
81-
"main.c",
82-
)
83-
84-
history_thread = threads.GetThreadAtIndex(1)
85-
self.assertTrue(history_thread.num_frames >= 2)
86-
self.assertEqual(
87-
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
88-
"main.c",
89-
)
90-
91-
# let's free the container (SBThreadCollection) and see if the
92-
# SBThreads still live
93-
threads = None
94-
self.assertTrue(history_thread.num_frames >= 2)
95-
self.assertEqual(
96-
history_thread.frames[1].GetLineEntry().GetFileSpec().GetFilename(),
97-
"main.c",
98-
)
99-
10029
def asan_tests(self):
10130
target = self.createTestTarget()
10231

lldb/test/API/functionalities/asan/TestReportData.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@
99
from lldbsuite.test.lldbtest import *
1010
from lldbsuite.test import lldbutil
1111

12-
from functionalities.libsanitizers.util import no_libsanitizers
1312

1413
class AsanTestReportDataCase(TestBase):
1514
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
1615
@expectedFailureNetBSD
1716
@skipUnlessAddressSanitizer
1817
@skipIf(archs=["i386"], bugnumber="llvm.org/PR36710")
1918
def test(self):
20-
self.build(make_targets=["asan"])
19+
self.build()
2120
self.asan_tests()
2221

23-
@skipIf(oslist=no_match(["macosx"]))
24-
def test_libsanitizers_asan(self):
25-
self.build(make_targets=["libsanitizers"])
26-
self.asan_tests(libsanitizers=True)
27-
2822
def setUp(self):
2923
# Call super's setUp().
3024
TestBase.setUp(self)
@@ -35,18 +29,10 @@ def setUp(self):
3529
self.line_crash = line_number("main.c", "// BOOM line")
3630
self.col_crash = 16
3731

38-
def asan_tests(self, libsanitizers=False):
32+
def asan_tests(self):
3933
target = self.createTestTarget()
4034

41-
if libsanitizers and no_libsanitizers(self):
42-
self.skipTest("libsanitizers not found")
43-
44-
if libsanitizers:
45-
self.runCmd(
46-
"env SanitizersAddress=1 MallocSanitizerZone=1 MallocSecureAllocator=0"
47-
)
48-
else:
49-
self.registerSanitizerLibrariesWithTarget(target)
35+
self.registerSanitizerLibrariesWithTarget(target)
5036

5137
self.runCmd("run")
5238

lldb/test/API/functionalities/libsanitizers/util.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)