summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/go/test.c
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [TSan] fix Go runtime test on amd64 with PIEMartin Pelikan2018-03-151-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Without this diff, the test segfaults. Examining the generated executable (which gets auto-deleted likely by cmake/ninja) yields this error message: ThreadSanitizer failed to allocate 0x4000 (16384) bytes at address 1755558480000 (errno: 12) Note that the address has more than 47 bits, which on amd64 means special treatment and therefore points out an overflow. The allocation came from __tsan_map_shadow on a .data pointer, which (on my work Debian-based box) means the 0x550000000000 range. This doesn't correspond to the constants mentioned in tsan_platform.h for Go binaries on Linux/amd64. The diff therefore allocates memory in the sort of area Go programs would, and prevents the test from crashing. It would be nice if reviewers kindly considered other setups and architectures :-) Reviewers: kcc, dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44071 llvm-svn: 327621
* tsan: fix build Dmitry Vyukov2016-04-271-0/+1
| | | | | error: implicit declaration of function 'abort' is invalid in C99 llvm-svn: 267710
* tsan: change tsan/Go interface for obtaining the current ProcessorDmitry Vyukov2016-04-271-9/+16
| | | | | | | | | | | | | | | Current interface assumes that Go calls ProcWire/ProcUnwire to establish the association between thread and proc. With the wisdom of hindsight, this interface does not work very well. I had to sprinkle Go scheduler with wire/unwire calls, and any mistake leads to hard to debug crashes. This is not something one wants to maintian. Fortunately, there is a simpler solution. We can ask Go runtime as to what is the current Processor, and that question is very easy to answer on Go side. Switch to such interface. llvm-svn: 267703
* tsan: split thread into logical and physical stateDmitry Vyukov2016-04-271-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This is reincarnation of http://reviews.llvm.org/D17648 with the bug fix pointed out by Adhemerval (zatrazz). Currently ThreadState holds both logical state (required for race-detection algorithm, user-visible) and physical state (various caches, most notably malloc cache). Move physical state in a new Process entity. Besides just being the right thing from abstraction point of view, this solves several problems: Cache everything on P level in Go. Currently we cache on a mix of goroutine and OS thread levels. This unnecessary increases memory consumption. Properly handle free operations in Go. Frees are issue by GC which don't have goroutine context. As the result we could not do anything more than just clearing shadow. For example, we leaked sync objects and heap block descriptors. This will allow to get rid of libc malloc in Go (now we have Processor context for internal allocator cache). This in turn will allow to get rid of dependency on libc entirely. Potentially we can make Processor per-CPU in C++ mode instead of per-thread, which will reduce resource consumption. The distinction between Thread and Processor is currently used only by Go, C++ creates Processor per OS thread, which is equivalent to the current scheme. llvm-svn: 267678
* [TSan] Fix compiler warning in Go sanity test.Alexey Samsonov2016-03-041-0/+1
| | | | llvm-svn: 262680
* tsan: describe heap/data locations in GoDmitry Vyukov2016-03-011-6/+7
| | | | llvm-svn: 262343
* tsan: revert r262037Dmitry Vyukov2016-02-261-21/+6
| | | | | | Broke aarch64 and darwin bots. llvm-svn: 262046
* tsan: split thread into logical and physical stateDmitry Vyukov2016-02-261-6/+21
| | | | | | | | | | | | | | | | | | | | Currently ThreadState holds both logical state (required for race-detection algorithm, user-visible) and physical state (various caches, most notably malloc cache). Move physical state in a new Process entity. Besides just being the right thing from abstraction point of view, this solves several problems: 1. Cache everything on P level in Go. Currently we cache on a mix of goroutine and OS thread levels. This unnecessary increases memory consumption. 2. Properly handle free operations in Go. Frees are issue by GC which don't have goroutine context. As the result we could not do anything more than just clearing shadow. For example, we leaked sync objects and heap block descriptors. 3. This will allow to get rid of libc malloc in Go (now we have Processor context for internal allocator cache). This in turn will allow to get rid of dependency on libc entirely. 4. Potentially we can make Processor per-CPU in C++ mode instead of per-thread, which will reduce resource consumption. The distinction between Thread and Processor is currently used only by Go, C++ creates Processor per OS thread, which is equivalent to the current scheme. llvm-svn: 262037
* tsan: update interface for GoDmitry Vyukov2014-03-061-2/+3
| | | | | | | this is required to fix: https://code.google.com/p/go/issues/detail?id=7460 llvm-svn: 203116
* tsan: ensure proper alignment of mmaps on windowsDmitry Vyukov2014-02-051-2/+3
| | | | llvm-svn: 200832
* tsan: update Go public interfaceDmitry Vyukov2014-02-041-5/+3
| | | | | | in preparation for https://codereview.appspot.com/55100044 llvm-svn: 200766
* tsan: update public Go interfaceDmitry Vyukov2014-02-041-2/+0
| | | | | | in preparation for https://codereview.appspot.com/55100044 llvm-svn: 200750
* tsan: better report formatting for GoDmitry Vyukov2013-08-161-4/+16
| | | | | | | Say that gorotuine 1 is main goroutine. Remove excessive new line. llvm-svn: 188542
* tsan: switch to explicit thread contexts in Go (instead of monotonic ↵Dmitry Vyukov2013-01-311-22/+24
| | | | | | goroutine ids) llvm-svn: 174047
* tsan: move traces from tls into dedicated storage at fixed addressDmitry Vyukov2012-11-281-1/+1
| | | | | | | helps to reduce tls size (it's weird to have multi-MB tls) will help with dynamically adjustable trace size llvm-svn: 168783
* tsan: slightly relax requirements for lazy shadow memory (can overlap and ↵Dmitry Vyukov2012-11-061-1/+1
| | | | | | | | may not be properly aligned) it's problematic on windows where allocation granularity is much larger than page size llvm-svn: 167466
* tsan: lazily allocate shadow for GoDmitry Vyukov2012-11-061-0/+2
| | | | llvm-svn: 167464
* tsan: add ReleaseStore() function that merely copies vector clock rather ↵Dmitry Vyukov2012-07-281-1/+0
| | | | | | | | than combines two clocks fix clock setup for finalizer goroutine (Go runtime) llvm-svn: 160918
* tsan: add missing includeDmitry Vyukov2012-07-271-0/+2
| | | | llvm-svn: 160875
* tsan: change event handling from single HandleEvent() to a set of separate ↵Dmitry Vyukov2012-07-271-6/+36
| | | | | | functions (Go runtime) llvm-svn: 160863
* tsan: align report style with Go internal formatDmitry Vyukov2012-07-241-1/+1
| | | | llvm-svn: 160672
* tsan: Go runtime: support goroutine end eventDmitry Vyukov2012-07-161-0/+5
| | | | llvm-svn: 160282
* tsan: add missing test for Go runtimeDmitry Vyukov2012-07-161-0/+15
llvm-svn: 160258
OpenPOWER on IntegriCloud