Alexander Potapenko
4f1d3e8eaa
Make sure NSObjects are allocated in a way that is visible to ASan.
...
llvm-svn: 153762
2012-03-30 17:31:15 +00:00
Alexey Samsonov
b33c87bbb9
[ASan] interceptors for atoi/atol/atoll
...
llvm-svn: 153637
2012-03-29 08:04:35 +00:00
Kostya Serebryany
b0414e0eff
[asan] fix lint
...
llvm-svn: 153601
2012-03-28 21:03:34 +00:00
Kostya Serebryany
48c157c25a
[asan] add racy double-free test
...
llvm-svn: 153586
2012-03-28 18:30:10 +00:00
Alexey Samsonov
0a4f8dc0cb
[ASan] add interceptor for strtol
...
llvm-svn: 153444
2012-03-26 16:42:22 +00:00
Alexey Samsonov
c8efe828a9
[ASan] add interceptor for strtoll
...
llvm-svn: 153376
2012-03-24 08:39:14 +00:00
Timur Iskhodzhanov
99cc6235bc
[ASan/tests] Make 'noinline' and a bunch of other stuff portable
...
llvm-svn: 153333
2012-03-23 13:10:59 +00:00
Timur Iskhodzhanov
f392910965
[ASan] replace '#if ... or ...' with '#if ... || ...'
...
llvm-svn: 153332
2012-03-23 12:21:47 +00:00
Kostya Serebryany
3f56851f5c
[asan] extend the test for long double bug
...
llvm-svn: 153190
2012-03-21 15:29:28 +00:00
Kostya Serebryany
74a908bb85
[asan] disable GetOwnershipStressTest on non-linux
...
llvm-svn: 152953
2012-03-16 22:15:22 +00:00
Kostya Serebryany
b0f9354168
[asan] use O(log(N)) algorithm instead of O(N) in __asan_get_ownership
...
llvm-svn: 152467
2012-03-10 01:30:01 +00:00
Kostya Serebryany
8aff411add
[asan] add a (disabled) stress test for __asan_get_ownership
...
llvm-svn: 152362
2012-03-09 01:48:18 +00:00
Evgeniy Stepanov
f485c3ccbd
[asan] Add a negative test for memcpy of long double.
...
llvm-svn: 151888
2012-03-02 10:42:10 +00:00
Alexander Potapenko
7e07f56811
Introduce __asan_set_error_report_callback() to allow the client program post-process the error reports.
...
If the callback is set, Report() and Printf() print the reports into a buffer (together with stderr), which is then passed to the client.
llvm-svn: 151528
2012-02-27 14:06:48 +00:00
Evgeniy Stepanov
d84e16e6a3
Replace some #ifdef(s) with plain if(s).
...
llvm-svn: 151526
2012-02-27 13:07:29 +00:00
Alexey Samsonov
8e7bfceb98
AddressSanitizer: fix lint
...
llvm-svn: 150802
2012-02-17 08:31:10 +00:00
Evgeniy Stepanov
5d47e9164c
[asan] Allocator tweaks for low memory systems.
...
llvm-svn: 150689
2012-02-16 13:35:11 +00:00
Kostya Serebryany
fcd535ba6c
[asan] implement __asan_set_death_callback
...
llvm-svn: 150414
2012-02-13 21:24:29 +00:00
Evgeniy Stepanov
450c123218
[asan] Add a missing return.
...
It is technically reachable on Android, where pthread_exit is not
marked noreturn.
llvm-svn: 150381
2012-02-13 12:36:44 +00:00
Alexey Samsonov
b30df37ebf
AddressSanitizer: move output tests to a separate directory
...
llvm-svn: 150367
2012-02-13 08:50:21 +00:00
Alexey Samsonov
f9affd3a0c
AddressSanitizer: Use FileCheck instead of grep for pure C output tests
...
llvm-svn: 150366
2012-02-13 08:27:10 +00:00
Kostya Serebryany
0394da7bea
[asan] unpoison the stack before every noreturn call. Fixes asan issue 37. rt part
...
llvm-svn: 150101
2012-02-08 21:33:27 +00:00
Kostya Serebryany
9716914b2d
[asan] better warning messages for double-free bugs (provide allocation/deallocation stack traces)
...
llvm-svn: 150027
2012-02-08 00:42:29 +00:00
Kostya Serebryany
b5eb5a7a05
[asan] make sure the AsanThread object is destroyed if pthread_exit is called
...
llvm-svn: 149940
2012-02-07 00:27:15 +00:00
Alexander Potapenko
f504602a0f
Disables testing memcpy() on Mac OS 10.7,
...
where memcpy() in fact aliases memmove() and thus calling it with
overlapping parameters is not an error.
llvm-svn: 149491
2012-02-01 09:47:40 +00:00
Kostya Serebryany
ad1fccdb1c
[asan] tests should not require the asan-rt to be built with debug info
...
llvm-svn: 149330
2012-01-31 01:56:58 +00:00
Kostya Serebryany
bca91defcb
[asan] new run-time flag: sleep_before_dying (asan Issue #31 )
...
llvm-svn: 149306
2012-01-31 00:52:18 +00:00
Kostya Serebryany
9aca3b0d2f
[asan] re-enable the test for ObjC initialization bug
...
llvm-svn: 149302
2012-01-30 23:55:46 +00:00
Kostya Serebryany
39ba3f724f
[asan] fix issue 35: don't let the optimizer to optimize the test code away.
...
llvm-svn: 149296
2012-01-30 23:23:26 +00:00
Kostya Serebryany
cf2c65aa8e
[asan] add a test for __attribute__ no_address_safety_analysis
...
llvm-svn: 149278
2012-01-30 21:34:59 +00:00
Alexander Potapenko
fabfcd8bea
Darwin-specific templates for the output tests.
...
These should fix the output tests on Mac.
llvm-svn: 149068
2012-01-26 17:40:18 +00:00
Alexander Potapenko
1f397fb87f
Tune asan_symbolize.py to symbolize 64-bit binaries correctly.
...
Add the DEBUG flag to test_output.sh
llvm-svn: 148798
2012-01-24 10:44:44 +00:00
Kostya Serebryany
f9418f9679
[asan] test that -fno-optimize-sibling-calls helps to get sane stack traces
...
llvm-svn: 148714
2012-01-23 18:44:34 +00:00
Alexander Potapenko
046ecc06be
Wrap CFStringCreateCopy to prevent copying constant CF strings.
...
This should fix http://code.google.com/p/address-sanitizer/issues/detail?id=10
llvm-svn: 148696
2012-01-23 10:09:54 +00:00
Alexander Potapenko
f9392011c8
Add a test for CFStringCreateCopy.
...
Normally this function should not create copies of constant strings, but it does when the default CFAllocator
is replaced (e.g. under AddressSanitizer)
This test is related to http://code.google.com/p/address-sanitizer/issues/detail?id=10
llvm-svn: 148695
2012-01-23 10:06:14 +00:00
Alexey Samsonov
0ac73fc9f8
AddressSanitizer: return false instead of true for __asan_get_ownership(NULL)
...
llvm-svn: 148394
2012-01-18 15:26:55 +00:00
Kostya Serebryany
5767f0f113
[asan] workaround for bug http://llvm.org/bugs/show_bug.cgi?id=11763 . Do not bark on memcpy(a, a, size).
...
llvm-svn: 148318
2012-01-17 18:43:52 +00:00
Alexey Samsonov
67d508d083
Revert commit 148304
...
llvm-svn: 148305
2012-01-17 14:01:15 +00:00
Alexey Samsonov
1e310295d0
AddressSanitizer: from this patch, ASan allocator returns false for __asan_get_ownership(NULL) and produce error reports for malloc_usable_size(NULL) and __asan_get_allocated_size(NULL)
...
llvm-svn: 148304
2012-01-17 13:31:54 +00:00
Alexey Samsonov
209c514a1d
AddressSanitizer: add support for malloc_usable_size() function
...
llvm-svn: 148287
2012-01-17 06:39:10 +00:00
Alexey Samsonov
50bf956f29
AddressSanitizer: fix recently introduced lint errors and broken test on Mac.
...
llvm-svn: 148235
2012-01-16 12:38:09 +00:00
Evgeniy Stepanov
2227207c83
Disable posix_memalign test on Android.
...
llvm-svn: 148234
2012-01-16 12:19:51 +00:00
Kostya Serebryany
cc1d7893d6
[asan] remove objdump-based tests in favour of much simpler LLVM-ish tests
...
llvm-svn: 147514
2012-01-04 02:08:46 +00:00
Kostya Serebryany
76eca5e53a
[asan] enable memset/memcpy/memmove interceptors in asan-rt (in addition to those in the compiler module)
...
llvm-svn: 147319
2011-12-28 19:55:30 +00:00
Kostya Serebryany
e4a84c4f1f
[asan] better message for parameter overlap bugs
...
llvm-svn: 147317
2011-12-28 19:24:31 +00:00
Kostya Serebryany
50bc2a71b2
[asan] interceptor for strcat. Patch by samsonov@google.com
...
llvm-svn: 147316
2011-12-28 19:08:49 +00:00
Kostya Serebryany
6579e355c0
[asan] interceptor for memcmp. Patch by samsonov@google.com
...
llvm-svn: 147315
2011-12-28 18:56:42 +00:00
Kostya Serebryany
809632e28e
[asan] interceptors for strcasecmp and strncasecmp. patch by samsonov@google.com
...
llvm-svn: 147304
2011-12-28 02:24:50 +00:00
Kostya Serebryany
5469986da0
[asan] remove the test for cfree. 'man cfree' says: 'This function should never be used.' and this function is not found on many OSes we support.
...
llvm-svn: 147301
2011-12-27 23:42:55 +00:00
Kostya Serebryany
db32f967b9
[asan] rely on __has_feature(address_sanitizer) instead of the ADDRESS_SANITIZER macro
...
llvm-svn: 147297
2011-12-27 21:57:12 +00:00