[x] It is not related to remote-vscode or I checked the following issue
[x] Imagine yourself into my position and think how hard to debug the issue without insufficient information.
I understand that you have privacy concerns and I expect you to understand that this extension is developed for free.
Thanks.
Describe the bug
Tests crash on start when built with ASAN
To Reproduce
See "Desktop" below for environment details.
Build a test with ASAN enabled.
Link it with ASAN-enabled gtest/gmock libraries.
Run the test executable from the command-line, and under the debugger using the following launch setting:
[----------] Global test environment tear-down
[==========] 3 tests from 1 test suite ran. (43 ms total)
[ PASSED ] 3 tests.
Try running the same test using C++ TestMate.
Test crashes on startup:
$5│ ==24166==ERROR: AddressSanitizer: container-overflow on address 0x60800006ecff at pc 0x00010678fe38 bp 0x00016d0927f0 sp 0x00016d0927e8
$5│ HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0.
... stack trace here ...
$5│ If you suspect a false positive see also: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow.
... more data here ...
$5│ ==24166==ABORTING
Desktop
Extension Version: 4.12.2
VS Code Version: 1.95.3 (Universal)
Google Test Version: 1.14.0
OS Type and Version: macOS Sonoma 14.6.1
The toolchain used is not the native Mac one (Xcode) but rather LLVM17 installed via homebrew and the environment set in a shell script:
We know about at least one kind of false positive container overflow reports. If a part of the application is built with asan and another part is not instrumented, and both parts use e.g. instrumented std::vector, asan may report non-existent container overflow. This happens because instrumented and non-instrumented bits of std::vector, inlined and not, are mixed during linking, so you end up with incompletely instrumented std::vector.
Unfortunately, I cannot suppress the ASAN check since it is an important one.
Checklist
Describe the bug
Tests crash on start when built with ASAN
To Reproduce
See "Desktop" below for environment details.
Desktop
The toolchain used is not the native Mac one (Xcode) but rather LLVM17 installed via
homebrew
and the environment set in a shell script:sourced from .zprofile
```bash export AR="llvm-ar" export CC="clang" export CXX="clang++" export LD="ld.lld" export NM="llvm-nm" export OBJCOPY="llvm-objcopy" export OBJDUMP="llvm-objdump" export READELF="llvm-readelf" export RANLIB="llvm-ranlib" export STRIP="llvm-strip" LLVM_DIR="$HOMEBREW_PREFIX/opt/llvm@17" export PATH="$LLVM_DIR/bin:$PATH" export LDFLAGS="-L$LLVM_DIR/lib -L$LLVM_DIR/lib/c++ -fuse-ld=lld -rtlib=compiler-rt -Wl,-rpath,$LLVM_DIR/lib/c++ -Wl,-rpath,$LLVM_DIR/lib/clang/17/lib/darwin/" export CPPFLAGS="-I$LLVM_DIR/include" ```Log (optional but recommended)
Log
```js [2024-11-15 19:39:34.330] [INFO] proc starting /Users/oren/work/rpp-server-2/build/rpp_daemon_server/tests/rpp_daemon_server_tests [ '--gtest_color=no', '--gtest_filter=DaemonTester.OneJobNowTwoBatches', '--gtest_also_run_disabled_tests' ] /Users/oren/work/rpp-server-2/build/rpp_daemon_server/tests/rpp_daemon_server_tests [2024-11-15 19:39:34.334] [INFO] proc started 24166 /Users/oren/work/rpp-server-2/build/rpp_daemon_server/tests/rpp_daemon_server_tests { shared: { workspaceFolder: { uri: Zo { scheme: 'file', authority: '', path: '/Users/oren/work/rpp-server-2', query: '', fragment: '', _formatted: 'file:///Users/oren/work/rpp-server-2', _fsPath: '/Users/oren/work/rpp-server-2' }, name: 'rpp-server-2', index: 0 }, log: { _logger: { configSection: 'testMate.cpp.log', workspaceFolder: undefined, outputChannelName: 'C++ TestMate', inspectOptions: [Object], includeLocation: false, targets: [Array], nextInspectOptions: undefined, configChangeSubscription: [Object] } }, testController: { controller: { items: [Object], label: [Getter/Setter], refreshHandler: [Getter/Setter], id: [Getter], relatedCodeProvider: [Getter/Setter], createRunProfile: [Function: createRunProfile], createTestItem: [Function: createTestItem], createTestRun: [Function: createTestRun], invalidateTestResults: [Function: invalidateTestResults], resolveHandler: [Getter/Setter], dispose: [Function: dispose] }, testItem2test: WeakMap {More info
Google says:
Unfortunately, I cannot suppress the ASAN check since it is an important one.