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
Kostya Serebryany
1b82c281f3
[asan] make sure frame pointers are not omitted when running asan output tests
...
llvm-svn: 147293
2011-12-27 19:52:54 +00:00
Kostya Serebryany
7ce9686921
[asan] added a test to check that a global-buffer-overflow mentioned the module name; revert incorrect change in the test runner
...
llvm-svn: 146701
2011-12-15 22:57:32 +00:00
Kostya Serebryany
9366d42e91
[asan] fix a bug (issue 19) where dlclose and the following mmap caused a false positive. run-time part.
...
llvm-svn: 146687
2011-12-15 21:55:34 +00:00
Kostya Serebryany
e8a7d2aef8
[asan] regression test for asan issue 19, currently fails.
...
llvm-svn: 146681
2011-12-15 20:38:14 +00:00
Kostya Serebryany
e85da73553
[asan] fix the test runner to detect build breakages; add a test for -pie
...
llvm-svn: 146528
2011-12-14 00:05:22 +00:00
Kostya Serebryany
d47a91ad2a
[asan] canonicalise the output for double-free and wrong-free. fixes asan issue 18
...
llvm-svn: 146501
2011-12-13 19:16:36 +00:00
Kostya Serebryany
7487a0ae1f
[asan] fix output test to not require debug symbols in asan run-time
...
llvm-svn: 146212
2011-12-09 00:18:21 +00:00
Kostya Serebryany
7c01c1af19
[asan] better test for use-after-return mode
...
llvm-svn: 146203
2011-12-08 23:30:48 +00:00
Kostya Serebryany
f0d799a6bc
[asan] fix the error message for 16-byte accesses (it previously printed 'unknown-crash')
...
llvm-svn: 146075
2011-12-07 21:30:20 +00:00
Kostya Serebryany
8b815e1a08
[asan] GCD tests on Mac: prevent optimization and enable. Patch by glider@google.com
...
llvm-svn: 145953
2011-12-06 19:10:48 +00:00