Age | Commit message (Collapse) | Author |
|
Summary:
The setlocale(3) function reloads the ctype(3) arrays from
external files. This happens behind the scenes in the internals
of libc (citrus library, runes functions etc).
ctype(3) functions like isspace(3) can be provided with two
variations on NetBSD: inlined or via a global symbol in libc:
```
#if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \
!defined(__cplusplus)
#include <sys/ctype_inline.h>
#else
#include <sys/ctype_bits.h>
#endif
```
The in-lined versions are de-facto array lookup operations.
```
#define isspace(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_S))
```
After setting setlocale(3) the ctype(3) arrays (_ctype_tab_,
_toupper_tab_, _tolower_tab_) are reload behind the scenes
and they are required to be marked as initialized.
Set them initialized inside the common setlocale(3) interceptor.
The arrays are of size of 257 elements: 0..255 + 1 (EOF).
This corrects errors on NetBSD/amd64 in applications
prebuilt with MSan.
Sponsored by <The NetBSD Foundation>
Reviewers: vitalybuka, dvyukov, joerg
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42020
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326008 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Reported on a buildbot:
Error in XFAIL list:
couldn't parse text: '| arm || aarch64 || mips'
in expression: 'freebsd | arm || aarch64 || mips'
Add || in the place of |
Fallout from D43382
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325751 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Left over after D43382
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325744 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
The Unix subdirectory mostly allows only on Linux x86_64 but now we can target x86_64 arch in general.
Patch by David CARLIER
Reviewers: krytarowski, dberris, emaste
Reviewed By: krytarowski, dberris, emaste
Subscribers: emaste, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43382
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325743 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
Child thread may finish before pthread_setname_np() and/or
pthread_getname_np() had a chance to run, which causes these functions
to fail with ENOENT (meaning /proc/self/task/[tid]/comm doesn't exist).
Fix by stalling child thread on a mutex.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43548
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325703 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
strmode - convert inode status information into a symbolic string
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D43485
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325588 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
fgetln - get a line from a stream
Sponsored by <The NetBSD Foundation>
Reviewers: vitalybuka, joerg
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D43482
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325587 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
Reuse the existing FreeBSD code as it is.
Sponsored by <The NetBSD Foundation>
Reviewers: dberris, rnk, vitalybuka
Reviewed By: dberris
Subscribers: mclow.lists, emaste, mgorny, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D43370
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325345 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Tested by Douglas Yung.
The original patch from D43278 has been reverted.
New patch by myself.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325315 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The original change broke a llvm-clang-lld-x86_64-debian setup.
This change will be investigated and reintroduced in future.
Original commit:
"Add Xray instrumentation support to FreeBSD"
https://reviews.llvm.org/D43278
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325309 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
It looks like get_bits_for_arch doesn't recognize "arm64" as a 64-bit architecture, and it actually matches the "arm" regexp, which marks it as 32-bit. Let's fix that by matching the 64-bit list first and addin "arm64" into the list.
Differential Revision: https://reviews.llvm.org/D43155
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325300 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Sponsored by <The NetBSD Foundation>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325246 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
- Enabling the build.
- Using assembly for the cpuid parts.
- Using thr_self FreeBSD call to get the thread id
Patch by: David CARLIER
Reviewers: dberris, rnk, krytarowski
Reviewed By: dberris, krytarowski
Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43278
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325240 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
lstat - get file status
Use it on NetBSD.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, eugenis
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42909
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325199 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Seems tests fails if link already exists.
Also removed duplicated part of tests.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325194 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Noted by David CARLIER.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324811 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
textdomain is a part of -lintl on BSDs. In GLIBC it's in libc.
We assume that -lintl will need to be rebuilt with sanitizers
in order to sanitize programs using its features.
This is a proper continuation of D41013.
The original patch has been reverted (adding -lintl).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324810 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The test expects to see the pattern "load add store" twice
in a row.
However the test contains actually several instances of this pattern.
Currently the first pattern appears in the output twice.
But after LLVM change https://reviews.llvm.org/D42691 some addtional
modification is done and one of another pattern has been hoisted in
function entry block.
As a result we have another order of meeting this pattern.
The test is updated to meet this change.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324571 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This should now pass on both ppc and x86. Sorry about the noise.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324556 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Should fix the ppc bots.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324548 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324541 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
nullptr is not available on older Darwin systems.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324136 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The "sleep(5)" sometimes times out on our bots, causing the test to fail. Let's use pthread_join.
Differential Revision: https://reviews.llvm.org/D42862
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324126 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324121 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
devname, devname_r - get device name
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42053
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324120 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
NetBSD ships with strlcpy(3) and strlcat(3), a safe
replacement of strcpy(3) and strcat(3).
Hide both functions under SANITIZER_INTERCEPT_STRLCPY.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42061
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324034 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324022 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@324016 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
With the change, one can choose not to report comparison (or subtraction)
of a pointer with nullptr pointer.
Reviewers: kcc, jakubjelinek, alekseyshl
Reviewed By: alekseyshl
Subscribers: kubamracek
Differential Revision: https://reviews.llvm.org/D41479
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323995 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323837 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323834 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
open_by_handle_at
Summary:
Also move existing readlink msan interceptor to sanitizer_common.
Fixes google/sanitizers#908
Patch by Oliver Chang
Reviewers: vitalybuka, eugenis
Reviewed By: vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42630
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323825 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
There was a failure on a bot:
http://lab.llvm.org:8011/builders/clang-cmake-mipsel/builds/1283
strerror test is indeed flaky. We protect all races by a barrier in other tests
to eliminate flakiness. Do the same here.
No idea why tls_race2.cc failed. Add output at the end of the test
as we do in other tests. Sometimes test process crashes somewhere
in the middle (e.g. during race reporting) and it looks like empty output.
Output at the end of test allows to understand if the process has crashed,
or it has finished but produced no race reports.
Reviewed in https://reviews.llvm.org/D42633
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323657 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This gets rid of a lit warning (input './projects/compiler-rt/test/xray/Unit' contained no tests).
Differential Revision: https://reviews.llvm.org/D42597
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323613 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
paccept(2) is a NetBSD-specific variation of accept(2).
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, eugenis
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42052
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323273 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
In more recent Linux kernels with 47 bit VMAs the layout of virtual memory
for powerpc64 changed causing the address sanitizer to not work properly. This
patch fixes up a test case that was found to fail on some newer Fedora
releases that use different address ranges.
ref: https://reviews.llvm.org/D40907
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323217 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
One test-case uses a wrong operation (should be subtraction).
Second test-case should declare a global variables before a tested one
in order to guarantee we will find a red-zone.
Reviewers: kcc, jakubjelinek, alekseyshl
Reviewed By: alekseyshl
Subscribers: kubamracek
Differential Revision: https://reviews.llvm.org/D41481
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323162 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Differential Revision: https://reviews.llvm.org/D42303
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323083 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
"the the" -> "the"
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323080 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
sequentially.
The current implementation of commands in
`test/sanitizer_common/ios_commands/` for iOS devices cannot be executed
in parallel which results in the ASan and TSan tests failing when
executed in parallel by lit which was the default behaviour.
We now force the ASan and TSan tests to be a new parallelism group named
`darwin-ios-device-sanitizer` which allows only one test to be run at a
time. We also emit a warning informing the user that tests are being
run sequentially.
This only applies if the target is an iOS device.
Differential Revision: https://reviews.llvm.org/D42156
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323026 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
Tests were being run by whole-linking the static library with our test binaries.
But since `-fsanitize=scudo` landed with rL317337, we might as well change how
the tests are compiled to use it.
The only difference will be on Android, where the clang flag links in the
dynamic library instead, but the bots are already pushing
`libclang_rt.*-android.so` to the device there is no additional change needed.
Tested locally, including with a standalone build, and an Android one on a O
device, and it all passes.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D42243
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322882 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
NetBSD can handle asan, ubsan, msan, tsan tests
on 64-bit and when applicable 32-bit X86 OS.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka
Subscribers: srhines, llvm-commits, kubamracek, mgorny, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42236
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322842 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
getgrouplist, getgroupmembership -- calculate group access list
Sponsored by <The NetBSD Foundation>
Reviewers: vitalybuka, joerg
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42064
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322836 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
access, faccessat - check access permissions of a file or pathname
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42065
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322831 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
From <pwd.h>: user_from_uid, uid_from_user
From <grp.h>: group_from_gid, gid_from_group
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42068
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322829 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is needed in case the users of libFuzzer use libc++ in their
code, which the fuzz target (libFuzzer) will be linked against.
When libc++ source is available, we build a private version of it
and link it against libFuzzer which allows using the same static
library against codebases which use both libc++ and libstdc++.
Differential Revision: https://reviews.llvm.org/D37631
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322755 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit r322604: test is failing for standalone compiler-rt.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322689 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Add missing endif.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322638 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
This patch (on top of the previous two (https://reviews.llvm.org/D40898 and
https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris
sanitizer port.
It contains the following sets of changes:
* For the time being, the port is for 32-bit x86 only, so reject the various tests on
x86_64.
* When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares
_setjmp and _longjmp inside namespace std.
* MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a
no-op compat define, Solaris does not.
* test/asan/TestCases/Posix/coverage.cc was initially failing like this:
/vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total
rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument
Further digging revealed that the rm was trying to remove the running test's working
directory which failed as observed. cd'ing out of the dir before let the test pass.
* Two tests needed a declaration of alloca. I've now copied the existing code from
test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and
maintainable to have a common testsuite header where such code is collected.
* Similarly, Solaris' printf %p format doesn't include the leading 0x.
* In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__
(predefined by clang for no apparent reason) to avoid conflicting declarations
for memalign.
* test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent
ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and
friends as predefined by clang and gcc?
Patch by Rainer Orth.
Reviewers: kcc, alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D40900
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322635 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is needed in case the users of libFuzzer use libc++ in their
code, which the fuzz target (libFuzzer) will be linked against.
When libc++ source is available, we build a private version of it
and link it against libFuzzer which allows using the same static
library against codebases which use both libc++ and libstdc++.
Differential Revision: https://reviews.llvm.org/D37631
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322604 91177308-0d34-0410-b5e6-96231b3b80d8
|