Commit Graph

90 Commits

Author SHA1 Message Date
Peter Collingbourne 6f4be19b57 [nolibc] Change internal syscall API to remove reliance on libc's errno.
This change moves to a model where the error value of a system call is
potentially contained in the return value itself rather than being
implicit in errno.  The helper function internal_iserror can be used
to extract the error value from a return value.  On platforms other
than Linux/x86_64 this still uses errno, but other platforms are free
to port their error handling to this new model.

Differential Revision: http://llvm-reviews.chandlerc.com/D756

llvm-svn: 181436
2013-05-08 14:43:49 +00:00
Dmitry Vyukov 3f7bf08b12 tsan: add interface functions for unaligned access, e.g. __sanitizer_unaligned_load16
llvm-svn: 180780
2013-04-30 11:56:56 +00:00
Dmitry Vyukov 368d97e33c tsan: fix stack traces for malloc and free
llvm-svn: 180184
2013-04-24 11:16:47 +00:00
Alexey Samsonov 734aab4066 [Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516
llvm-svn: 178853
2013-04-05 07:30:29 +00:00
Kostya Serebryany 91952cda76 [tsan] restore performance critical inlining in tsan: remove static from ALWAYS_INLINE, use ALWAYS_INLINE USED for critical functions.
llvm-svn: 178341
2013-03-29 09:44:16 +00:00
Timur Iskhodzhanov 23411d9a95 Band-aid fix for the TSan RTL build
llvm-svn: 178298
2013-03-28 22:23:03 +00:00
Dmitry Vyukov f2cbda4082 tsan: print statistics about benign race annotations
(total count, unique, matched) if requested with print_benign=1
flag.

llvm-svn: 178245
2013-03-28 16:21:19 +00:00
Dmitry Vyukov b365d40415 tsan: print matched suppressions if print_suppressions=1 flag is provided
llvm-svn: 178159
2013-03-27 17:59:57 +00:00
Dmitry Vyukov 4adf49d253 tsan: intercept setjmp/longjmp
llvm-svn: 177858
2013-03-25 10:10:44 +00:00
Dmitry Vyukov 2c3b919ad3 tsan: add flag to control symbolizer flush frequency
llvm-svn: 177638
2013-03-21 13:01:50 +00:00
Dmitry Vyukov 48e5d4a2d3 tsan: flush symbolizer cache if not symbolized for more than 5 seconds
llvm-svn: 177629
2013-03-21 07:02:36 +00:00
Dmitry Vyukov 78693730a4 tsan: use a single background thread for memory profiler and memory flush (and later for symbolizer flush)
llvm-svn: 177627
2013-03-21 06:24:31 +00:00
Dmitry Vyukov b62c158d81 tsan: special handling of .rodata (don't try to find races, don't keep shadow, dont' put into traces)
llvm-svn: 177517
2013-03-20 13:21:50 +00:00
Dmitry Vyukov ccbdea956f tsan: fix build
llvm-svn: 177513
2013-03-20 11:22:03 +00:00
Dmitry Vyukov 79915de6af tsan: move trace header into 0x600000000000 range
eliminat thread "dead info" altogether

llvm-svn: 177512
2013-03-20 10:31:53 +00:00
Dmitry Vyukov ce26a0aa92 tsan: touch less shadow memory during operations on big memory ranges
greatly reduces memory consumption

llvm-svn: 177289
2013-03-18 16:56:48 +00:00
Dmitry Vyukov 2e7f29f042 tsan: mark shadow for thread stack as "don't need" when thread exits
llvm-svn: 177288
2013-03-18 15:49:07 +00:00
Dmitry Vyukov f123337275 tsan: better memory profiler
llvm-svn: 177286
2013-03-18 13:55:33 +00:00
Dmitry Vyukov 50160030e1 tsan: fix Go build
llvm-svn: 177260
2013-03-18 08:52:46 +00:00
Dmitry Vyukov a221620b2e tsan: use StackDepot in sync object to store creation stacks
llvm-svn: 177258
2013-03-18 08:27:47 +00:00
Alexey Samsonov 9aecdfe34d [TSan] Switch TSan runtime to use ThreadRegistry class from sanitizer_common
llvm-svn: 177154
2013-03-15 13:48:44 +00:00
Alexey Samsonov 39313b780d [Sanitizer] make internal_open have the same interface as libc version
llvm-svn: 174187
2013-02-01 15:58:46 +00:00
Dmitry Vyukov 87c6bb9716 tsan: even if races between atomic and plain memory accesses are turned off (report_atomic_races=0),
still report races between atomic accesses and free().

llvm-svn: 174175
2013-02-01 14:41:58 +00:00
Dmitry Vyukov ba4291480d tsan: detect races between plain and atomic memory accesses
llvm-svn: 174163
2013-02-01 09:42:06 +00:00
Kostya Serebryany bda64b4d40 [sanitizer] make the error messages from sanitizer_common contain the actual tool name
llvm-svn: 174059
2013-01-31 14:11:21 +00:00
Dmitry Vyukov d6b9348bf3 tsan: introduce a helped macro CPP_WEAK (Go linker does not support weak symbols)
llvm-svn: 173917
2013-01-30 09:46:53 +00:00
Dmitry Vyukov 5fbfafcd8c tsan: add OnFinalize() callback for frontends
llvm-svn: 173915
2013-01-30 09:24:00 +00:00
Alexey Samsonov 49a32c1d08 [Sanitizer] update style checker script and fix namespace style warnings
llvm-svn: 173910
2013-01-30 07:45:58 +00:00
Dmitry Vyukov 6e406cda4b tsan: implement malloc stats querying
llvm-svn: 173332
2013-01-24 09:08:03 +00:00
Dmitry Vyukov fe817bdb88 tsan: less debug output
llvm-svn: 170889
2012-12-21 12:30:52 +00:00
Dmitry Vyukov 3e7ede230f tsan: support MapThreadTrace() on all platforms
llvm-svn: 170113
2012-12-13 08:14:02 +00:00
Dmitry Vyukov 54b87409b4 tsan: even more fd interceptors + fixes
llvm-svn: 169628
2012-12-07 19:23:59 +00:00
Dmitry Vyukov fd5ebcd1b0 tsan: add mutexsets to reports
With this change reports say what mutexes the threads hold around the racy memory accesses.

llvm-svn: 169493
2012-12-06 12:16:15 +00:00
Dmitry Vyukov 1b46993598 tsan: output thread names
llvm-svn: 169279
2012-12-04 15:46:05 +00:00
Dmitry Vyukov 55b47cad33 tsan: fix trace handling when trace is reused between threads
llvm-svn: 169259
2012-12-04 12:19:53 +00:00
Dmitry Vyukov e993dac233 tsan: fix int overflow and several instances where tid is used with ignore
llvm-svn: 169029
2012-11-30 20:02:11 +00:00
Dmitry Vyukov 0a4d875c48 tsan: fix bug that leads to spurious use-after-free reports
llvm-svn: 168985
2012-11-30 06:39:01 +00:00
Dmitry Vyukov 3374e3f874 tsan: add log_path parameter (similar to asan)
remove old log_fileno

llvm-svn: 168788
2012-11-28 12:56:52 +00:00
Dmitry Vyukov e1a7f338a3 tsan: dynamic history size
introduces history_size parameter that can be used to control trace size at startup

llvm-svn: 168786
2012-11-28 12:19:50 +00:00
Dmitry Vyukov 2429b02770 tsan: move traces from tls into dedicated storage at fixed address
helps to reduce tls size (it's weird to have multi-MB tls)
will help with dynamically adjustable trace size

llvm-svn: 168783
2012-11-28 10:35:31 +00:00
Dmitry Vyukov db584aded7 tsan: ensure than func entry/exit are inlined
llvm-svn: 168506
2012-11-23 07:14:11 +00:00
Dmitry Vyukov 933c9889aa tsan: remove unused parameter
llvm-svn: 168060
2012-11-15 18:49:08 +00:00
Dmitry Vyukov 041eaf976c tsan: better function names
llvm-svn: 167834
2012-11-13 14:05:58 +00:00
Dmitry Vyukov dcba4d1288 tsan: fix stats collection
llvm-svn: 167832
2012-11-13 13:53:43 +00:00
Alexey Samsonov ae9b18b607 [Sanitizer] add sanity checks for communication with external symbolizer
llvm-svn: 167617
2012-11-09 14:45:30 +00:00
Dmitry Vyukov 67dc5702f8 tsan: do not sleep at exit if there are no other threads
llvm-svn: 167533
2012-11-07 16:41:57 +00:00
Dmitry Vyukov da78be74f3 tsan: slightly relax requirements for lazy shadow memory (can overlap and may not be properly aligned)
it's problematic on windows where allocation granularity is much larger than page size

llvm-svn: 167466
2012-11-06 16:48:46 +00:00
Dmitry Vyukov c015712992 tsan: lazily allocate shadow for Go
llvm-svn: 167464
2012-11-06 16:00:16 +00:00
Alexey Samsonov ad9d65feb8 [TSan] finally remove TsanPrintf in favor of Printf from sanitizer_common
llvm-svn: 167294
2012-11-02 12:17:51 +00:00
Dmitry Vyukov 19ba50a8b9 tsan: better message about found races for Go ThreadSanitizer
llvm-svn: 165376
2012-10-07 14:21:24 +00:00