Kostya Serebryany
7ada43d99a
[asan] add code to detect global initialization fiasco in C/C++. The sub-pass is off by default for now. Patch by Reid Watson. Note: this patch changes the interface between LLVM and compiler-rt parts of asan. The corresponding patch to compiler-rt will follow.
...
llvm-svn: 162268
2012-08-21 08:24:25 +00:00
Kostya Serebryany
5e3fbb5b34
[asan] insert crash basic blocks inline as opposed to inserting them at the end of the function. This doesn't seem to fix or break anything, but is considered to be more friendly to downstream passes (test change)
...
llvm-svn: 161871
2012-08-14 14:05:50 +00:00
Kostya Serebryany
a57ebfbe10
[asan] make sure that the crash callbacks do not get merged (Chandler's idea: insert an empty InlineAsm). Change the order in which the new BBs are inserted: the slow path BB is insert between old BBs, the crash BB is inserted at the end. Don't create an empty BB (introduced by recent commits). Update the test. The experimental code that does manual crash callback merge will most likely be deleted later.
...
llvm-svn: 160544
2012-07-20 09:54:50 +00:00
Kostya Serebryany
c80a9f4bea
[asan] refactor instrumentation to allow merging the crash callbacks (not fully implemented yet, no functionality change except the BB order)
...
llvm-svn: 160284
2012-07-16 16:15:40 +00:00
Chandler Carruth
800f86f31b
Revert r160254 temporarily.
...
It turns out that ASan relied on the at-the-end block insertion order to
(purely by happenstance) disable some LLVM optimizations, which in turn
start firing when the ordering is made more "normal". These
optimizations in turn merge many of the instrumentation reporting calls
which breaks the return address based error reporting in ASan.
We're looking at several different options for fixing this.
llvm-svn: 160256
2012-07-16 10:01:02 +00:00
Chandler Carruth
2f34858fa0
Teach AddressSanitizer to create basic blocks in a more natural order.
...
This is particularly useful to the backend code generators which try to
process things in the incoming function order.
Also, cleanup some uses of IRBuilder to be a bit simpler and more clear.
llvm-svn: 160254
2012-07-16 08:58:53 +00:00
Chandler Carruth
ff8e933c02
Add a basic test for AddressSanitizer. This is just a bare-bones
...
functionality test.
In general, unless the functionality is substantially separated, we
should lump more basic testing into this file. The test running
infrastructure likes having a few test files with more comprehensive
testing within them.
llvm-svn: 160253
2012-07-16 08:56:46 +00:00
Kostya Serebryany
9bdb57f07a
[asan] instrument cmpxchg and atomicrmw
...
llvm-svn: 157683
2012-05-30 09:04:06 +00:00
Kostya Serebryany
f5088bb8a5
[asan] move x86-specific test to a separate X86 directory with a custom lit.local.cfg file
...
llvm-svn: 152567
2012-03-12 18:49:11 +00:00
Eli Bendersky
4afdeeb682
Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
...
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.
llvm-svn: 150664
2012-02-16 06:28:33 +00:00
Kostya Serebryany
457b375949
[asan] fix asan-vs-gvn.ll test (it did not actually check much before this change)
...
llvm-svn: 150441
2012-02-14 00:02:35 +00:00
Kostya Serebryany
2de61e1628
[asan] unpoison the stack before every noreturn call. Fixes asan issue 37. llvm part
...
llvm-svn: 150102
2012-02-08 21:36:17 +00:00
Kostya Serebryany
f4be131943
The patch resolves the conflict between AddressSanitizer and load widening (GVN).
...
The problem initially reported by Mozilla folks (http://code.google.com/p/address-sanitizer/issues/detail?id=20 ),
but it also prevents us from enabling LLVM bootstrap with AddressSanitizer.
llvm-svn: 149925
2012-02-06 22:48:56 +00:00
Kostya Serebryany
ca8b911b2d
[asan] enable asan only for the functions that have Attribute::AddressSafety
...
llvm-svn: 148846
2012-01-24 19:34:43 +00:00
Kostya Serebryany
c69557e758
[asan] one more test for asan instrumentation: (*a)++ should be instrumented only once.
...
llvm-svn: 147509
2012-01-04 01:02:14 +00:00
Kostya Serebryany
c78b00cab4
[asan] add a test for instrumenting globals
...
llvm-svn: 146718
2011-12-16 01:28:19 +00:00
Kostya Serebryany
908509d41a
[asan] do not instrument threadlocal globals, this is buggy
...
llvm-svn: 145092
2011-11-23 02:10:54 +00:00
Kostya Serebryany
3a83736893
[asan] workaround for reg alloc bug 11395: don't instrument functions with large chunks of inline assembler
...
llvm-svn: 144962
2011-11-18 01:41:06 +00:00
Kostya Serebryany
3b8d362511
fall back to explicit list of allowed linkages when instrumenting globals in asan; add a test check that asan does not touch linkonce_odr
...
llvm-svn: 144933
2011-11-17 23:14:59 +00:00
Kostya Serebryany
4105068ea9
AddressSanitizer, first commit (compiler module only)
...
llvm-svn: 144758
2011-11-16 01:35:23 +00:00