Commit Graph

10881 Commits

Author SHA1 Message Date
Kamil Rytarowski 8448460975 Update ioctl(2) operations for NetBSD 8.99.25
Eliminate dropped operations, add new operations.

Update included headers for newer need.

Add a fallback definition of nvlist_ref_t, becaue this type
is internal to libnpf and the kernel, not exported into public
headers.

llvm-svn: 345726
2018-10-31 15:04:20 +00:00
Kamil Rytarowski ec37188a86 Update generate_netbsd_ioctls.awk for NetBSD 8.99.25
Add dynamic detection of header files in /usr/include.
Handle "nvlist_ref_t" needed by npf(4) ioctl(2) operations.

llvm-svn: 345715
2018-10-31 12:52:08 +00:00
Kamil Rytarowski 3d2ab50d33 Diable test suppressions-library for NetBSD/i386
This is a part of the ASan test-suite.

llvm-svn: 345707
2018-10-31 10:16:54 +00:00
Reid Kleckner 3e27306565 [asan] Remove stale -fno-exceptions flag in sanitizer_common as well
llvm-svn: 345685
2018-10-31 00:35:46 +00:00
Reid Kleckner 1079d7ccfe [asan] Remove flags for clang-cl before it supported EH
Also remove -Wno-undefined-inline, which needed to work around PR19898,
which was fixed.

llvm-svn: 345677
2018-10-31 00:20:41 +00:00
Kamil Rytarowski 9fe6b4d522 Disable BufferOverflowAfterManyFrees for NetBSD
This test hangs in the i386 mode.

llvm-svn: 345666
2018-10-30 22:08:47 +00:00
Kamil Rytarowski e90a7df5a1 Mark breaking asan tests on NetBSD
Failing ones:
 - coverage-reset
 - coverage
 - dlclose-test
 - interception-in-shared-lib-test
 - stack-use-after-return
 - tsd_dtor_leak

llvm-svn: 345663
2018-10-30 22:05:49 +00:00
Roman Lebedev a0457c02b3 [NFC][compiler-rt] Cleanup Implicit Conversion Sanitizer tests to use sized types
Summary: As requested by @filcab in https://reviews.llvm.org/D50251#1280267

Reviewers: filcab, vsk, #sanitizers, vitalybuka

Reviewed By: filcab, #sanitizers, vitalybuka

Subscribers: vitalybuka, kubamracek, dberris, llvm-commits, filcab

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D53869

llvm-svn: 345661
2018-10-30 21:59:09 +00:00
Roman Lebedev 320e9af309 [compiler-rt][ubsan] Implicit Conversion Sanitizer - integer sign change - compiler-rt part
Summary:
This is a compiler-rt part.
The clang part is D50250.

See [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], https://github.com/google/sanitizers/issues/940.

Reviewers: vsk, filcab, #sanitizers

Reviewed By: filcab, #sanitizers

Subscribers: mclow.lists, srhines, kubamracek, dberris, rjmccall, rsmith, llvm-commits, regehr

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D50251

llvm-svn: 345659
2018-10-30 21:58:54 +00:00
Marco Castelluccio c8d94f3847 [GCOV] Make test path generic so it passes on all machines
llvm-svn: 345656
2018-10-30 21:43:47 +00:00
Kamil Rytarowski 5786b9fe88 Switch getline_nohang from XFAIL to UNSUPPORTED for NetBSD
This test sometimes works, usually breaks.

llvm-svn: 345655
2018-10-30 21:41:31 +00:00
Kamil Rytarowski 9e5016a384 Mark vptr-non-unique-typeinfo as a broken test for NetBSD/i386
llvm-svn: 345654
2018-10-30 21:39:45 +00:00
Kamil Rytarowski 3b59f89a56 Mark breaking sanitizer_common tests on NetBSD
Set XFAIL with appropriate configuration for:
 - NetBSD/getgroupmembership
 - Posix/dedup_token_length_test
 - Posix/readlinkat
 - get_module_and_offset_for_pc

llvm-svn: 345651
2018-10-30 21:20:17 +00:00
Reid Kleckner 96b823418d [builtins] Re-enable x86-only long double tests
Summary:
In r81552, the HAS_80_BIT_LONG_DOUBLE macro was added to the unit test
only version of int_lib.h. One month later in r85260 the duplicate
int_lib.h was removed, but the tests still passed because we don't build
with -Werror.

This is the minimal change to bring it back, and I decided to put the
configuration macro next to our 128-bit integer support macro.

Reviewers: joerg, compnerd, mstorsjo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D53838

llvm-svn: 345645
2018-10-30 20:51:27 +00:00
Petr Hosek 0bd1a0fac1 [CMake] Check -ffreestanding as C not C++ flag
When -ffreestanding is used, main() isn't considered special and
when compiled as C++ code it'll get mangled which makes the
compilation fail since main() will be undefined so this check will
never succeed.

Differential Revision: https://reviews.llvm.org/D49332

llvm-svn: 345632
2018-10-30 19:19:47 +00:00
Kamil Rytarowski df8802da7a Handle NetBSD alias for pthread_sigmask
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
2018-10-30 18:49:19 +00:00
Calixte Denizet 4b0c66deb3 [GCOV] Add a test for function defined on one line (follow-up of https://reviews.llvm.org/D53600)
Summary: Add a test for coverage for function definition like void foo() { }.

Reviewers: marco-c

Reviewed By: marco-c

Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru

Differential Revision: https://reviews.llvm.org/D53601

llvm-svn: 345625
2018-10-30 18:41:41 +00:00
Kamil Rytarowski 98f1dd0bd5 Cast the return value of _Unwind_GetIP() to uptr
This is needed for NetBSD to match the expected type in
Unwind_GetIP().

llvm-svn: 345620
2018-10-30 18:25:12 +00:00
Kamil Rytarowski d54d17b6e2 Mark interception_failure_test with XFAIL for NetBSD
This test breaks also on FreeBSD.

llvm-svn: 345619
2018-10-30 18:21:58 +00:00
Kamil Rytarowski d045b15bce Disable ASan test asan_and_llvm_coverage_test for NetBSD
Right now the LLVM profile feature is turned off for this OS.

llvm-svn: 345600
2018-10-30 13:58:45 +00:00
Kamil Rytarowski 02f838d778 Adapt ASan test heavy_uar_test for NetBSD
The stack size is tight for the main thread in multithread
environment and follow the FreeBSD approach of reducing stack
usage.

llvm-svn: 345599
2018-10-30 13:49:15 +00:00
Kamil Rytarowski 647ece0144 Mark breaking TSan tests on NetBSD with XFAIL
Failing tests:
 - dtls
 - ignored-interceptors-mmap
 - mutex_lock_destroyed

llvm-svn: 345595
2018-10-30 13:28:32 +00:00
Kamil Rytarowski 8f545983a3 Cleanup includes in sanitizer_platform_limits_netbsd.cc
Sort the headers more correctly according to NetBSD style.
Prevent in this code part clang-format, as shuffling the order
will cause build failures.

llvm-svn: 345586
2018-10-30 11:34:36 +00:00
Kamil Rytarowski 4f343547ba Regenerate syscall hooks for NetBSD 8.99.25
Register new syscall getsockopt2.
Drop removed syscalls pmc_get_info and pmc_control.

While there address compiler warnings about potentially
unused variables.

llvm-svn: 345582
2018-10-30 11:10:36 +00:00
Kamil Rytarowski 1308779f79 Update generate_netbsd_syscalls.awk for NetBSD 8.99.25
Register new syscall getsockopt2.
Drop removed syscalls pmc_get_info and pmc_control.

While there address compiler warnings about potentially
unused variables.

llvm-svn: 345580
2018-10-30 11:03:37 +00:00
Kamil Rytarowski da78171643 Handle pthread_sigmask in DemangleFunctionName()
Translate __libc_thr_sigsetmask to pthread_sigmask on NetBSD.

llvm-svn: 345574
2018-10-30 08:51:34 +00:00
Kamil Rytarowski 7fc4f0d9af Drop now hidden ioctl(2) operations for NetBSD
POWER_IOC_GET_TYPE_WITH_LOSSAGE is no longer accessible from userland.

llvm-svn: 345572
2018-10-30 08:32:47 +00:00
Kamil Rytarowski 4c5620f233 Handle NetBSD symbol mangling for tzset
Native code generated on NetBSD mangles tzet to __tzset50.

Handle this accordingly in MSan.

llvm-svn: 345571
2018-10-30 08:16:14 +00:00
Kamil Rytarowski 7b88204b39 Handle NetBSD symbol mangling for nanosleep and vfork
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
2018-10-30 08:06:42 +00:00
Dean Michael Berris 01aeb3221d [XRay] Migrate FDR runtime to use refactored controller
Summary:
This change completes the refactoring of the FDR runtime to support the
following:

- Generational buffer management.

- Centralised and well-tested controller implementation.

In this change we've had to:

- Greatly simplify the code in xray_fdr_logging.cc to only implement the
  glue code for calling into the controller.

- Implement the custom and typed event logging functions in the
  FDRLogWriter.

- Imbue the `XRAY_NEVER_INSTRUMENT` attribute onto all functions in the
  controller implementation.

Reviewers: mboerger, eizan, jfb

Subscribers: jfb, llvm-commits

Differential Revision: https://reviews.llvm.org/D53858

llvm-svn: 345568
2018-10-30 04:35:48 +00:00
Vitaly Buka 7c180fa915 [ubsan-minimal] update comments in CMakeLists.txt
Summary:
Prepend minimal when UBsan is mentioned and delete a dead comment

Patch by Igor Sugak

Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: mgorny, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D53826

llvm-svn: 345557
2018-10-30 01:20:12 +00:00
Vitaly Buka 9817192691 [sanitizer] Move interceptor initialization check into real_clock_gettime
Reviewers: cryptoad, kubamracek

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D53777

llvm-svn: 345556
2018-10-30 01:20:01 +00:00
Erik Pilkington 81b89fd7bd [compiler-rt][builtins] Don't #include CoreFoundation in os_version_check.c
This breaks some configurations, so just forward declare everything that we need.

rdar://35943793

Differential revision: https://reviews.llvm.org/D50269

llvm-svn: 345551
2018-10-29 23:01:26 +00:00
Reid Kleckner 143f1a9e72 [builtins] Fix -Wunused-local-typedef warning in compile time asserts
Use the __attribute__ spellings when compiling with clang-cl so that
__attribute__((unused)) expands to something.

llvm-svn: 345550
2018-10-29 22:48:14 +00:00
Petr Hosek 54153c3b5e [CMake] When built with LLVM, not use `-Wl,-z,defs`
This matches standalone build behavior. PR28681

Differential Revision: https://reviews.llvm.org/D53686

Patch By: tabloid.adroit

llvm-svn: 345547
2018-10-29 22:16:56 +00:00
Kamil Rytarowski 0ef090cad1 Mark test/tsan/getline_nohang as XFAIL for NetBSD
llvm-svn: 345493
2018-10-29 09:44:42 +00:00
Kamil Rytarowski 43d1653fc0 Disable the GNU strerror_r TSan test for NetBSD
Revert older change that was incorrect in this test.
It was already reverted in the past after an attempt to port it to Darwin.

While there, mark FreeBSD as unsupported as well.

llvm-svn: 345492
2018-10-29 09:12:38 +00:00
Kamil Rytarowski 5267698376 Mark test/tsan/ignore_lib5 as unsupported for NetBSD
ReadProcMaps() on NetBSD does not handle >=1MB of memory layout information.

llvm-svn: 345490
2018-10-29 08:42:46 +00:00
Dean Michael Berris e01d25efbd [XRay] Guard call to postCurrentThreadFCT()
Summary:
Some cases where `postCurrentThreadFCT()` are not guarded by our
recursion guard. We've observed that sometimes these can lead to
deadlocks when some functions (like memcpy()) gets outlined and the
version of memcpy is XRay-instrumented, which can be materialised by the
compiler in the implementation of lower-level components used by the
profiling runtime.

This change ensures that all calls to `postCurrentThreadFCT` are guarded
by our thread-recursion guard, to prevent deadlocks.

Reviewers: mboerger, eizan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D53805

llvm-svn: 345489
2018-10-29 05:39:43 +00:00
Dean Michael Berris 36d9746630 [XRay] Use more portable control block
Summary:
In D53560, we assumed a specific layout for memory without using an
explicit structure. This follow-up change uses more portable layout
control by using unions in a struct, and consolidating the memory
management code in the buffer queue.

We also take the opportunity to improve the documentation on the types
and operations, along with simplifying some of the logic in the buffer
queue implementation.

Reviewers: mboerger, eizan

Subscribers: jfb, llvm-commits

Differential Revision: https://reviews.llvm.org/D53802

llvm-svn: 345485
2018-10-29 02:18:14 +00:00
Dean Michael Berris 299e9b8be0 [XRay] Refcount backing store for buffers
Summary:
This change implements the ref-counting for backing stores associated
with generational buffer management. We do this as an implementation
detail of the buffer queue, instead of exposing this to the interface.

This change allows us to keep the buffer queue interface and usage model
the same.

Depends on D53551.

Reviewers: mboerger, eizan

Subscribers: jfb, llvm-commits

Differential Revision: https://reviews.llvm.org/D53560

llvm-svn: 345471
2018-10-28 09:12:43 +00:00
Dean Michael Berris 18024786b9 [XRay] Support generational buffers in FDR controller
Summary:
This is an intermediary step in the full support for generational buffer
management in the FDR runtime. This change makes the FDR controller
aware of the new generation number in the buffers handed out by the
BufferQueue type.

In the process of making this change, we've realised that the cleanest
way of ensuring that the backing store per generation is live while all
the threads that need access to it will need reference counting to tie
the backing store to the lifetime of all threads that have a handle on
buffers associated with the memory.

We also learn that we're missing the edge-case in the function exit
handler's implementation where the first record being written into the
buffer is a function exit, which is caught/fixed by the test for
generational buffer management.

We still haven't wired the controller into the FDR mode runtime, which
will need the reference counting on the backing store implemented to
ensure that we're being conservatively thread-safe with this approach.

Depends on D52974.

Reviewers: mboerger, eizan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D53551

llvm-svn: 345445
2018-10-27 03:00:21 +00:00
Kuba Mracek 117360cc24 [sanitizer] Improve macOS version detection
Part of <https://reviews.llvm.org/D48445>.

llvm-svn: 345406
2018-10-26 17:19:41 +00:00
Evgeniy Stepanov f4a6f6424d [sanitizer] Fix mallopt test on Android.
There is not a single common mallopt option between gnu/linux and
android, so simply use a random number there.

llvm-svn: 345394
2018-10-26 15:13:20 +00:00
Evgeniy Stepanov ea857e8225 [sanitizer] Fix mallopt interceptor.
On error, mallopt is supposed to return 0, not -1.

llvm-svn: 345323
2018-10-25 22:15:44 +00:00
Kuba Mracek 6b6d9bbd48 [sanitizer] Avoid calling a nullptr in MonotonicNanoTime if interceptors are not yet initialized
There's a TSan startup crash on Linux when used in Swift programs, where MonotonicNanoTime will try to call real_clock_gettime and then jump to NULL because interceptors are not yet initialized. This is on Ubuntu 18.04. Looks like TSan's main Initialize() function is called at a point where __progname is already set, but interceptors aren't yet set up. Let's fix this by checking whether interceptors are initialized in MonotonicNanoTime.

Differential Revision: https://reviews.llvm.org/D53528

llvm-svn: 345174
2018-10-24 18:40:08 +00:00
Kostya Serebryany ad11526c30 [hwasan] when printing a stack-related bugs, also print stack frame descriptions provided by the compiler
llvm-svn: 345110
2018-10-24 01:35:50 +00:00
Kostya Serebryany af95597c3c [hwasan] add stack frame descriptions.
Summary:
At compile-time, create an array of {PC,HumanReadableStackFrameDescription}
for every function that has an instrumented frame, and pass this array
to the run-time at the module-init time.
Similar to how we handle pc-table in SanitizerCoverage.
The run-time is dummy, will add the actual logic in later commits.

Reviewers: morehouse, eugenis

Reviewed By: eugenis

Subscribers: srhines, llvm-commits, kubamracek

Differential Revision: https://reviews.llvm.org/D53227

llvm-svn: 344985
2018-10-23 00:50:40 +00:00
Kuba Mracek 975352c0b1 [interception] Switch to _type suffix instead of _f, NFC.
Some Darwin functions have pairs like dispatch_apply and dispatch_apply_f so the added _f to interceptor types causes a clash. Let's add _type suffix instead.

Differential Revision: https://reviews.llvm.org/D53167

llvm-svn: 344954
2018-10-22 20:54:48 +00:00
Dean Michael Berris 2336dc3c51 [XRay] Account for virtual memory re-use
Change the assumption when releasing memory to a buffer queue that new
generations might not be able to re-use the memory mapped addresses.

llvm-svn: 344882
2018-10-22 06:11:50 +00:00