llvm-project/lldb
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
..
bindings [lldb] Fix that SBThread.GetStopDescription is returning strings with uninitialized memory at the end. 2020-01-14 09:34:32 +01:00
cmake [lldb/CMake] Only auto-enable Lua when SWIG is found 2020-01-08 14:02:47 -08:00
docs [lldb/Docs] Extend description section of the main page 2020-01-13 09:32:02 -08:00
examples [Examples] Move structured-data unpacking out of the loop. (NFC) 2019-11-22 15:43:39 -08:00
include/lldb [lldb/Reproducers] Print more info for reproducer status 2020-01-15 20:25:44 -08:00
packages/Python/lldbsuite [lldb] Fix asan failures in data-formatter-objc tests 2020-01-16 09:59:07 +01:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts [lldb/Scripts] Remove SWIG bot 2020-01-13 09:23:48 -08:00
source [lldb/Reproducers] Print more info for reproducer status 2020-01-15 20:25:44 -08:00
test [lldb/Reproducers] Print more info for reproducer status 2020-01-15 20:25:44 -08:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools [lldb/Reproducers] Add a flag to always generating a reproducer 2020-01-15 19:45:54 -08:00
unittests [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in Debug builds 2020-01-10 21:34:07 +01:00
utils [lldb/Utils] Patch all variables used by lldb-dotest (2/2) 2020-01-15 16:01:42 -08:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [lldb/Bindings] Move bindings into their own subdirectory 2020-01-09 08:44:34 -08:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py