summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc file in lib/tsan/rtl to .cppNico Weber2019-08-011-2855/+0
| | | | | | Like r367463, but for tsan/rtl. llvm-svn: 367564
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.7Julian Lettner2019-07-021-23/+1
| | | | | | | | | | | Factor out `ExtractLongJmpSp` helper function and move platform-specific code to tsan_platform_{linux,mac}.cc. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64050 llvm-svn: 364947
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.3Julian Lettner2019-07-011-1/+1
| | | | | | | | | | Remove unnecessary computation of mangled SP for x86_64 architecture. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D63944 llvm-svn: 364874
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.2Julian Lettner2019-07-011-7/+4
| | | | | | | | | | | | Switch `LongJmp` over to lookup JmpBuf via plain old (unmangled) SP. This makes the computation of mangled SPs in the TSan assembly files unnecessary, which will be cleaned up in follow-up revisions. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D63942 llvm-svn: 364818
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.1Julian Lettner2019-06-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TSan needs to infer which calls to setjmp/longjmp are corresponding pairs. My understanding is, that we can't simply use the jmp_buf address, since this buffer is just a plain data structure storing the environment (registers) with no additional semantics, i.e., it can be copied around and is still expected to work. So we use the stack pointer (SP) instead. The setjmp interceptor stores some metadata, which is then consumed in the corresponding call to longjmp. We use the SP as an "index" (stable identifier) into the metadata table. So far so good. However, when mangling is used, the setjmp interceptor observes the UNmangled SP, but the longjmp interceptor only knows the mangled value for SP. To still correlate corresponding pairs of calls, TSan currently derives the mangled representation in setjmp and uses it as the stable identifer, so that longjmp can do it's lookup. Currently, this works since "mangling" simply means XOR with a secret value. However, in the future we want to use operations that do not allow us to easily go from unmangled -> mangled (pointer authentication). Going from mangled -> unmangled should still be possible (for pointer authentication it means zeroing a few bits). This patch is part 1 of changing set/longjmp interceptors to use the unmangled SP for metadata lookup. Instead of deriving the mangled SP in setjmp, we will derive the unmangled SP in longjmp. Since this change involves difficult-to-test code, it will be done in (at least) 2 parts: This patch only replicates the existing behavior and checks that the newly computed value for SP matches with what we have been doing so far. This should help me to fix issues on architectures I cannot test directly. I tested this patch on x86-64 (Linux/Darwin) and arm64 (Darwin). This patch will also address an orthogonal issue: there is a lot of code duplication in the assembly files, because the `void __tsan_setjmp(uptr sp, uptr mangled_sp)` already demands the mangled SP. This means that the code for computing the mangled SP is duplicated at every call site (in assembly). Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D60981 llvm-svn: 364662
* [Sanitizer] Reland "Cleanup INTERCEPT_FUNCTION macro"Julian Lettner2019-05-011-7/+6
| | | | | | | | | | | | | | | | | | | | | | On Linux both version of the INTERCEPT_FUNCTION macro now return true when interception was successful. Adapt and cleanup some usages. Also note that `&(func) == &WRAP(func)` is a link-time property, but we do a runtime check. Tested on Linux and macOS. Previous attempt reverted by: 5642c3feb03d020dc06a62e3dc54f3206a97a391 This attempt to bring order to the interceptor macro goes the other direction and aligns the Linux implementation with the way things are done on Windows. Reviewed By: vitalybuka, rnk Differential Revision: https://reviews.llvm.org/D61358 llvm-svn: 359725
* [sanitizer] Implement reallocarray.Evgeniy Stepanov2019-05-011-0/+14
| | | | | | | | | | | | | | | | Summary: It's a cross of calloc and realloc. Sanitizers implement calloc-like check for size overflow. Reviewers: vitalybuka, kcc Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61108 llvm-svn: 359708
* Revert r359325 "[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION ↵Reid Kleckner2019-04-301-7/+17
| | | | | | | | | | | | | | | to void" Changing INTERCEPT_FUNCTION to return void is not functionally correct. IMO the best way to communicate failure or success of interception is with a return value, not some external address comparison. This change was also creating link errors for _except_handler4_common, which is exported from ucrtbase.dll in 32-bit Windows. Also revert dependent changes r359362 and r359466. llvm-svn: 359611
* [NFC][Sanitizer] Remove GetRealFunctionAddress and replace usagesJulian Lettner2019-04-271-17/+7
| | | | | | | | Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D61205 llvm-svn: 359362
* [TSan] Initialize libdispatch interceptors if necessaryJulian Lettner2019-03-081-0/+4
| | | | | | | | | | | | On Linux (and other non-Darwin platforms) we need to initialize interceptors. Since tsan_libdispatch.cc is compiled optionally, add a weak default implementation of `InitializeLibdispatchInterceptors`. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D59113 llvm-svn: 355717
* [Sanitizer] Add interceptor for pthread_sigmaskPavel Labath2019-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: pthread_sigmask is just like sigprocmask, except that its behavior in multithreaded programs is explicitly specified. Sanitizers were lacking a common interceptor for pthread_sigmask (although some specific sanitizers defined custom version), which lead to false positives (at least in msan) when using this function. The interceptor implementation, and its test are based on the equivalent code for sigprocmask. Reviewers: eugenis, vitalybuka Subscribers: kubamracek, delcypher, jfb, jdoerfert, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58382 llvm-svn: 354874
* Dmitry Vyukov2019-02-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | tsan: add fiber support This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 [The previous commit of this change was reverted, this is a resubmit with a squashed fix for check_analyze.sh and COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED] llvm-svn: 353947
* Revert "tsan: add fiber support"Diana Picus2019-02-131-6/+0
| | | | | | | This reverts commit r353817 because we think it broke AARch64 and PowerPC buildbots. llvm-svn: 353939
* tsan: add fiber supportDmitry Vyukov2019-02-121-0/+6
| | | | | | | | | | | | | | | | | This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 llvm-svn: 353817
* tsan: Introduce in_symbolizer() function for Thread sanitizerDmitry Vyukov2019-02-121-13/+13
| | | | | | | | | This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D58104 llvm-svn: 353805
* tsan: Implement pthread_exit() interceptor for Thread sanitizerVitaly Buka2019-02-091-0/+8
| | | | | | | | | | | | This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57876 Context: https://reviews.llvm.org/D54889 > llvm-svn: 353385 llvm-svn: 353627
* [tsan] Remove pthread_exit interceptorVitaly Buka2019-02-091-8/+0
| | | | | | Crashes PPC bot llvm-svn: 353604
* Fix Die() after pthread_exit call on macOSVitaly Buka2019-02-081-0/+3
| | | | | | | | | | | | | | | | | | | | Summary: Scoped interceptor should not be used when calling real pthread_exit(). On macOS C++ destructors are not called by pthread_exit(), and later check for empty thread ignore set fails. Patch by Yuri Per. Reviewers: dvyukov, vitalybuka Reviewed By: vitalybuka Subscribers: vitalybuka, thegameg, kubamracek, jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57963 llvm-svn: 353561
* [tsan] Remove SCOPED_TSAN_INTERCEPTOR to try to fix ppc botVitaly Buka2019-02-081-1/+0
| | | | llvm-svn: 353552
* sanitizers: Introduce ThreadType enumDmitry Vyukov2019-02-071-1/+1
| | | | | | | | | | | | | Replace bool workerthread flag with ThreadType enum. This change is preparation for fiber support. [dvyukov: fixed build of sanitizer_thread_registry_test.cc] Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57839 Context: https://reviews.llvm.org/D54889 llvm-svn: 353390
* tsan: Implement pthread_exit() interceptor for Thread sanitizerDmitry Vyukov2019-02-071-0/+6
| | | | | | | | | | This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57876 Context: https://reviews.llvm.org/D54889 llvm-svn: 353385
* [sanitizer] Don't unpoison buffer in getpw/getgr functionsVitaly Buka2019-02-071-13/+0
| | | | | | | | | | | | | | | | | Summary: Buffer should be referenced by results so used parts will be unpoisoned with unpoison_group and unpoison_passwd. This fixes TSAN performance issue made us to disable this interceptors. Reviewers: eugenis, dvyukov Subscribers: srhines, kubamracek, krytarowski, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57731 llvm-svn: 353351
* [tsan] Disable fgetpwent_r to work around performance issuesVitaly Buka2019-02-041-0/+1
| | | | | | This was missed from D54041 when SANITIZER_INTERCEPT_FGETPWENT_R was branched from SANITIZER_INTERCEPT_GETPWENT_R llvm-svn: 353110
* 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] Remove ignore_interceptors_accesses flagJulian Lettner2019-01-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: It has been superseded by the `ignore_noninstrumented_modules` flag and is no longer needed. Also simplify a test that checks that `mmap_interceptor` respects ignore annotations (`thr->ignore_reads_and_writes `). Relevant: https://reviews.llvm.org/rL269855 <rdar://problem/46263073> Remove obsolete Apple-specific suppression option Reviewers: dcoughlin, kubamracek, dvyukov, delcypher Reviewed By: dvyukov Subscribers: jfb, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55075 llvm-svn: 350883
* [sanitizer_common] Define __sanitizer_FILE on NetBSDMichal Gorny2019-01-101-10/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D56109 llvm-svn: 350882
* [sanitizer_common] Implement popen, popenve, pclose interceptorsMichal Gorny2019-01-021-1/+2
| | | | | | | | | | | | | | | Implement the interceptors for popen(), pclose() and popenve() functions. The first two are POSIX, the third one is specific to NetBSD. popen() spawns a process and creates a FILE object piping data from/to that process. pclose() closes the pipe and waits for the process to terminate appropriately. For the purpose of popen(), the COMMON_INTERCEPTOR_FILE_OPEN macro is modified to allow null path parameter. Differential Revision: https://reviews.llvm.org/D56157 llvm-svn: 350232
* tsan: add pthread_tryjoin_np and pthread_timedjoin_np interceptorsDmitry Vyukov2018-11-211-0/+33
| | | | | | | | | | Add pthread_tryjoin_np() and pthread_timedjoin_np() interceptors on Linux, so that ThreadSanitizer can handle programs using these functions. Author: Yuri Per (yuri) Reviewed in: https://reviews.llvm.org/D54521 llvm-svn: 347383
* [tsan] Add __cxa_guard_acquire hooks to support cooperative schedulingVitaly Buka2018-11-201-0/+12
| | | | | | | | | | Reviewers: dvyukov Subscribers: krytarowski, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D54664 llvm-svn: 347336
* Handle NetBSD alias for pthread_sigmaskKamil Rytarowski2018-10-301-0/+3
| | | | | | | | | | | | | | | | | | | | | Summary: Add a new helper macro TSAN_INTERCEPTOR_NETBSD_ALIAS_THR2 that handles pthread(3)/libc aliases in scenarios when a name in both libraries differs not just in prefix namespace. Handle TSan pthread_sigmask mangling accordingly into __libc_thr_sigsetmask. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, jfb, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D53863 llvm-svn: 345627
* Handle NetBSD symbol mangling for nanosleep and vforkKamil Rytarowski2018-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Native code generated on NetBSD mangles: - vfork into __vfork14 - nanosleep into __nanosleep50 Handle this accordingly in TSan. Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D53806 llvm-svn: 345570
* [tsan] Adjust setjmp/longjmp handling on Darwin for macOS MojaveKuba Mracek2018-08-211-1/+2
| | | | | | | | | | On macOS Mojave, the OS started using the XOR-by-a-secret-key scheme (same as glibc is alread doing) for storing the SP value in setjmp environment. We need to adjust for that to keep supporting setjmp/longjmp on latest Darwin. The patch is basically doing the same what we're already doing for glibc. rdar://problem/43542596 Differential Revision: https://reviews.llvm.org/D51064 llvm-svn: 340350
* [tsan] Fix gcc pedantic warningDmitry Vyukov2018-07-261-16/+16
| | | | | | | | | Fix gcc (7.2.0) pedantic warning warning: extra ‘;’ [-Wpedantic] Author: jasonl220 (Jason Lovett) Review: https://reviews.llvm.org/D49817 llvm-svn: 338023
* [sanitizer] Add fgets, fputs and puts into sanitizer_commonPeter Wu2018-06-111-9/+0
| | | | | | | | | | | | | | | Summary: Add fgets, fputs and puts to sanitizer_common. This adds ASAN coverage for these functions, extends MSAN support from fgets to fputs/puts and extends TSAN support from puts to fputs. Fixes: https://github.com/google/sanitizers/issues/952 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D46545 llvm-svn: 334450
* [TSan] FreeBSD / intercept thr_exitDavid Carlier2018-06-041-0/+12
| | | | | | | | | | | | | | | intercepting thr_exit to terminate threads under FreeBSD. Unblock few unit tests hanging. Reviewers: krytarowski, vitalybuka, emaste Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D47677 M lib/tsan/rtl/tsan_interceptors.cc llvm-svn: 333870
* FreeBSD TSan support updateVitaly Buka2018-03-161-3/+3
| | | | | | | | | | | | | | | | | Summary: - Disable thread_finalize callback on FreeBSD, fixing couple of unit tests. Patch by David CARLIER Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: emaste, kubamracek, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44156 llvm-svn: 327697
* [sanitizer] Move mmap interceptors into sanitizer_commonVitaly Buka2018-03-071-34/+14
| | | | | | | | | | Reviewers: devnexen, krytarowski, eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44125 llvm-svn: 326851
* [TSan] Fix static TLS boundaries calculations in __tls_get_addr interceptor.Alex Shlyapnikov2018-02-151-1/+2
| | | | | | | | | | | | | | Summary: DTLS_on_tls_get_addr expects (tls_addr + tls_size) as the last parameter, static_tls_end. Reviewers: dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43325 llvm-svn: 325276
* Enable syscall-specific functions in TSan/NetBSDKamil Rytarowski2018-02-151-1/+1
| | | | | | | | | | | | | NetBSD ships now with netbsd_syscall_hooks.h and requires support for TSan specific features to be enabled. This is follow up of: D42048: Add NetBSD syscall hooks skeleton in sanitizers Sponsored by <The NetBSD Foundation> llvm-svn: 325245
* Add NetBSD syscall hooks skeleton in sanitizersKamil Rytarowski2018-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Implement the skeleton of NetBSD syscall hooks for use with sanitizers. Add a script that generates the rules to handle syscalls on NetBSD: generate_netbsd_syscalls.awk. It has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h that is a public header for applications, and included as: <sanitizer_common/sanitizer_platform_limits_netbsd.h>. Generate sanitizer_syscalls_netbsd.inc that defines all the syscall rules for NetBSD. This file is modeled after the Linux specific file: sanitizer_common_syscalls.inc. Start recognizing NetBSD syscalls with existing sanitizers: ASan, ESan, HWASan, TSan, MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis Reviewed By: vitalybuka Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42048 llvm-svn: 325206
* [scudo] Allow options to be defined at compile timeKostya Kortchinsky2018-02-081-4/+2
| | | | | | | | | | | | | | | | Summary: Allow for options to be defined at compile time, like is already the case for other sanitizers, via `SCUDO_DEFAULT_OPTIONS`. Reviewers: alekseyshl, dberris Reviewed By: alekseyshl, dberris Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42980 llvm-svn: 324620
* Correct typo in TSan codeKamil Rytarowski2018-01-251-3/+3
| | | | | | | | We wrongly enabled additional (unwanted) branch for NetBSD. Noted by Vlad Tsyrklevich llvm-svn: 323413
* [TSan] Make more TSan interceptors symbolizer-aware.Alex Shlyapnikov2017-12-061-9/+25
| | | | | | | | | | | | | | | | | | Summary: Switching the rest of intercepted allocs to InternalAlloc (well, except __libc_memalign) when current thread is 'in_symbolizer'. Symbolizer might (and does) use allocation functions other than malloc/calloc/realloc. posix_memalign is the one actually used, others switched just in case (since the failure is obscure and not obvious to diagnose). Reviewers: dvyukov Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D40877 llvm-svn: 319929
* Move __tsan::Vector to __sanitizerKamil Rytarowski2017-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: The low-fat STL-like vector container will be reused in MSan. It is needed to implement an atexit(3) interceptor on NetBSD/amd64 in MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: dvyukov Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40726 llvm-svn: 319650
* Defer StartBackgroundThread() and StopBackgroundThread() in TSanKamil Rytarowski2017-11-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD cannot spawn new POSIX thread entities in early libc and libpthread initialization stage. Defer this to the point of intercepting the first pthread_create(3) call. This is the last change that makes Thread Sanitizer functional on NetBSD/amd64 without downstream patches. ******************** Testing Time: 64.91s ******************** Failing Tests (5): ThreadSanitizer-x86_64 :: dtls.c ThreadSanitizer-x86_64 :: ignore_lib5.cc ThreadSanitizer-x86_64 :: ignored-interceptors-mmap.cc ThreadSanitizer-x86_64 :: mutex_lock_destroyed.cc ThreadSanitizer-x86_64 :: vfork.cc Expected Passes : 290 Expected Failures : 1 Unsupported Tests : 83 Unexpected Failures: 5 Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, dvyukov, vitalybuka Reviewed By: dvyukov Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40583 llvm-svn: 319305
* Support the setjmp(3) family of functions in TSan/NetBSDKamil Rytarowski2017-11-281-18/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change adds support for the setjmp(3)/longjmp(3) family of functions on NetBSD. There are three types of them on NetBSD: - setjmp(3) / longjmp(3) - sigsetjmp(3) / sigsetjmp(3) - _setjmp(3) / _longjmp(3) Due to historical and compat reasons the symbol names are mangled: - setjmp -> __setjmp14 - longjmp -> __longjmp14 - sigsetjmp -> __sigsetjmp14 - siglongjmp -> __siglongjmp14 - _setjmp -> _setjmp - _longjmp -> _longjmp This leads to symbol renaming in the existing codebase. There is no such symbol as __sigsetjmp/__longsetjmp on NetBSD Add a comment that GNU-style executable stack note is not needed on NetBSD. The stack is not executable without it. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, vitalybuka Reviewed By: dvyukov Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40337 llvm-svn: 319189
* Correct mangled_sp on NetBSD/amd64 in TSanKamil Rytarowski2017-11-281-2/+4
| | | | | | | | | | | | The proper index is 6, not 2. Patch extracted from https://reviews.llvm.org/D40337 Reviewed and accepted by <dvyukov>. Sponsored by <The NetBSD Foundation> llvm-svn: 319163
* Handle symbol renaming of sigaction for NetBSDKamil Rytarowski2017-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD uses the __sigaction14 symbol name for historical and compat reasons for the sigaction(2) function name. Rename the interceptors and users of sigaction to sigaction_symname and reuse it in the code base. This change fixes 4 failing tests in TSan/NetBSD: - ThreadSanitizer-x86_64 :: signal_errno.cc - ThreadSanitizer-x86_64 :: signal_malloc.cc - ThreadSanitizer-x86_64 :: signal_sync2.cc - ThreadSanitizer-x86_64 :: signal_thread.cc Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, dvyukov, kcc Reviewed By: dvyukov Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40341 llvm-svn: 319160
* Correct NetBSD support in pthread_once(3)/TSanKamil Rytarowski2017-11-211-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The pthread_once(3)/NetBSD type is built with the following structure: struct __pthread_once_st { pthread_mutex_t pto_mutex; int pto_done; }; Set the pto_done position as shifted by __sanitizer::pthread_mutex_t_sz from the beginning of the pthread_once struct. This corrects deadlocks when the pthread_once(3) function is used. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, vitalybuka Reviewed By: dvyukov Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40262 llvm-svn: 318742
* [tsan] Fix sigaction implementation when it's called only to get handlerVitaly Buka2017-11-201-25/+27
| | | | | | | | | | Reviewers: eugenis Subscribers: kubamracek, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40272 llvm-svn: 318707
OpenPOWER on IntegriCloud