teak-llvm/lldb/packages/Python/lldbsuite/test
Raphael Isemann 4f244bba4f [lldb] Fix asan failures in data-formatter-objc tests
The test is currently failing on some systems with ASAN enabled due to:
```
==22898==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000003da4 at pc 0x00010951c33d bp 0x7ffee6709e00 sp 0x7ffee67095c0
READ of size 5 at 0x603000003da4 thread T0
    #0 0x10951c33c in wrap_memmove+0x16c (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x1833c)
    #1 0x7fff4a327f57 in CFDataReplaceBytes+0x1ba (CoreFoundation:x86_64+0x13f57)
    #2 0x7fff4a415a44 in __CFDataInit+0x2db (CoreFoundation:x86_64+0x101a44)
    #3 0x1094f8490 in main main.m:424
    #4 0x7fff77482084 in start+0x0 (libdyld.dylib:x86_64+0x17084)
0x603000003da4 is located 0 bytes to the right of 20-byte region [0x603000003d90,0x603000003da4)
allocated by thread T0 here:
    #0 0x109547c02 in wrap_calloc+0xa2 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x43c02)
    #1 0x7fff763ad3ef in class_createInstance+0x52 (libobjc.A.dylib:x86_64+0x73ef)
    #2 0x7fff4c6b2d73 in NSAllocateObject+0x12 (Foundation:x86_64+0x1d73)
    #3 0x7fff4c6b5e5f in -[_NSPlaceholderData initWithBytes:length:copy:deallocator:]+0x40 (Foundation:x86_64+0x4e5f)
    #4 0x7fff4c6d4cf1 in -[NSData(NSData) initWithBytes:length:]+0x24 (Foundation:x86_64+0x23cf1)
    #5 0x1094f8245 in main main.m:404
    #6 0x7fff77482084 in start+0x0 (libdyld.dylib:x86_64+0x17084)
```

The reason is that we create a string "HELLO" but get the size wrong (it's 5 bytes instead
of 4). Later on we read the buffer and pretend it is 5 bytes long, causing an OOB read
which ASAN detects.

In general this test probably needs some cleanup as it produces on macOS 10.15 around
100 compiler warnings which isn't great, but let's first get the bot green.
2020-01-16 09:59:07 +01:00
..
android/platform [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
api [lldb][NFC] Simplify if-return 2019-12-26 18:49:35 +03:00
arm [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
benchmarks [dotest] Avoid the need for LEVEL= makefile boilerplate 2019-09-04 07:46:25 +00:00
commands [lldb] Add expect_expr function for testing expression evaluation in dotests. 2020-01-15 13:04:04 +01:00
driver/batch_mode [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
functionalities [lldb] Fix asan failures in data-formatter-objc tests 2020-01-16 09:59:07 +01:00
iohandler [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off. 2019-12-20 21:01:23 -08:00
issue_verification [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
lang [lldb/test] test_breakpoints_func_full from TestNamespace.NamespaceBreakpointTestCase is now passing on Windows 2020-01-14 11:15:48 -08:00
linux [lldb][NFC] Remove all setUp overrides that only call the parent implementation 2019-12-13 12:34:49 +01:00
macosx [lldb][NFC] Remove all setUp overrides that only call the parent implementation 2019-12-13 12:34:49 +01:00
make [-gmodules] Let LLDB log a warning if the Clang module hash mismatches. 2019-11-15 11:52:13 -08:00
plugins [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
python_api [lldb][NFC] Rewrite python_api/rdar-12481949 test 2020-01-14 10:10:24 +01:00
sample_test [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
sanity [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
source-manager tests: XFAIL/UNSUPPORTED tests on Windows 2020-01-01 14:22:49 -08:00
terminal [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off. 2019-12-20 21:01:23 -08:00
test_runner [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
tools [lldb-vscode] Centrally skip debug info variants for vscode tests 2019-12-17 11:08:52 +01:00
types [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
__init__.py
bench.py [lldb][NFC] Remove unused imports in python tests 2019-08-02 08:06:22 +00:00
concurrent_base.py [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()' 2019-12-13 12:23:04 +01:00
configuration.py dotest.py: Add option to pass extra lldb settings to dotest 2020-01-14 12:35:24 -08:00
darwin_log.py [lldb][NFC] Remove unused imports in python tests 2019-08-02 08:06:22 +00:00
decorators.py [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off. 2019-12-20 21:01:23 -08:00
dotest_args.py dotest.py: Add option to pass extra lldb settings to dotest 2020-01-14 12:35:24 -08:00
dotest.py dotest.py: Add option to pass extra lldb settings to dotest 2020-01-14 12:35:24 -08:00
lldb_pylint_helper.py Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
lldbbench.py
lldbdwarf.py
lldbinline.py [dotest] Avoid the need for LEVEL= makefile boilerplate 2019-09-04 07:46:25 +00:00
lldbpexpect.py [lldb/pexpect] Force-set the TERM environment variable 2019-12-20 15:19:41 +01:00
lldbplatform.py [dotest] Remove dead code 2019-07-26 01:58:18 +00:00
lldbplatformutil.py [lldb][tests] Platform triple can be None 2019-12-26 18:49:35 +03:00
lldbtest_config.py [dotest] Add the ability to set environment variables for the inferior. 2019-06-26 16:12:08 +00:00
lldbtest.py [lldb] Add expect_expr function for testing expression evaluation in dotests. 2020-01-15 13:04:04 +01:00
lldbutil.py lldbutil: Forward ASan launch info to test inferiors 2020-01-10 14:52:51 -08:00
lock.py [lldb][NFC] Remove unused imports in python tests 2019-08-02 08:06:22 +00:00
README-TestSuite Reflow readme 2018-12-17 21:18:12 +00:00
redo.py
test_categories.py [lldb][NFC] Add "lldb-vscode" to all_categories 2019-12-26 18:49:35 +03:00
test_result.py [lldb][tests] Make it possible to expect failure for a whole category 2020-01-10 17:37:55 +03:00