Skip to content

Commit

Permalink
Adapt TestCustomShell and TestMultipleDebuggers to run under ASAN
Browse files Browse the repository at this point in the history
In situations where only LLDB is ASANified, a false positive occurs
unless ASAN_OPTIONS=detect_container_overflow=0 is set in the
environment.

Differential Revision: https://reviews.llvm.org/D143772
  • Loading branch information
augusto2112 committed Feb 11, 2023
1 parent 0ac8dfd commit 294ca12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -15,7 +15,9 @@ class TestMultipleSimultaneousDebuggers(TestBase):
@skipIfNoSBHeaders
@skipIfWindows
def test_multiple_debuggers(self):
env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
env = {self.dylibPath: self.getLLDBLibraryEnvVal(),
# We need this in order to run under ASAN, in case only LLDB is ASANified.
'ASAN_OPTIONS': os.getenv('ASAN_OPTIONS', None)}

self.driver_exe = self.getBuildArtifact("multi-process-driver")
self.buildDriver('multi-process-driver.cpp', self.driver_exe)
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/Shell/Host/TestCustomShell.test
Expand Up @@ -7,7 +7,7 @@

# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
# RUN: SHELL=bogus not %lldb %t.out -b -o 'process launch -X 1 --' 2>&1 | FileCheck %s --check-prefix ERROR
# RUN: env -i %lldb %t.out -b -o 'process launch -X 1 --' 2>&1 | FileCheck %s
# RUN: env -i ASAN_OPTIONS='detect_container_overflow=0' %lldb %t.out -b -o 'process launch -X 1 --' 2>&1 | FileCheck %s

# ERROR: error: shell expansion failed
# CHECK-NOT: error: shell expansion failed

0 comments on commit 294ca12

Please sign in to comment.