Commit Graph

37 Commits

Author SHA1 Message Date
rin a65365b875 t_asan_global_buffer_overflow: Avoid ODR Violation for pic variants
Common symbol triggers ODR (One Definition Rule) Violation correctly,
instead of Global Buffer Overflow.

XXX
Add test for odr_violation.
2023-08-07 00:54:54 +00:00
christos 562596981f match the new compiler warning 2023-05-24 20:02:34 +00:00
skrll d5bc748e3e toolchain/57033: usr.bin/c++/t_call_once2:call_once2_profile test case fails
Remove the -static flag I added because it doesn't fix anything and it
actually causes more problems.
2022-09-29 07:22:49 +00:00
skrll 745686120d toolchain/57033: usr.bin/c++/t_call_once2:call_once2_profile test case fails
Revive a missing space.
2022-09-28 11:09:59 +00:00
skrll ac615257a7 Put the sprinkled -static in the right place, i.e. fix up previous.
Thanks to rillig for spotting my mistake.
2022-06-12 15:08:38 +00:00
skrll 4bb9965c48 Sprinkle "-static" when using "-pg" as profiling only works with static and
the gcc specs are currently broken.

PR/56876: hppa: "cc -pg" fails with "undefined reference to `mprotect'"
2022-06-12 08:55:36 +00:00
skrll db3cbfae74 Trailing whitespace 2022-06-02 07:31:35 +00:00
rin b73d7fb61c Bump timeout. 2022-05-07 05:14:09 +00:00
martin c95b4819a5 Remove bogus architecture detection voodo - tsan is not available
on most architectures, so just state it that way.
2021-12-16 16:30:55 +00:00
skrll 6281bd1084 asan is supported on aarch64 2021-10-12 18:40:01 +00:00
rin 7a28717ecb Fix typo to correctly initialize call_once2_pic_profile. 2021-09-04 05:47:31 +00:00
gson b19091917e Mark t_tsan_*:*profile test cases as expected failures as discussed in
PR toolchain/55760.
2020-11-17 08:25:57 +00:00
rin f46f81bd9a Now, profiling works for GCC9 on aarch64{,eb}.
Note that it seems to work even for GCC8, according to log data of
official test runs, e.g.,

	https://releng.netbsd.org/b5reports/evbarm-aarch64/2020/2020.09.01.15.45.20/test.log
2020-10-13 06:49:27 +00:00
martin af1644547e Simplify test requirements: we only build tsan for amd64 currently. 2020-09-15 09:33:12 +00:00
kamil 2062795b28 Enable TSan tests for GCC and >32bit address space environments 2020-09-14 15:17:53 +00:00
riastradh 8d4c37e85f Mark compilation with -pg as xfail on aarch64.
XXX file a PR to xref
2020-02-11 06:26:19 +00:00
kamil 5612f2cac8 Define target_not_supported_body() in TSan, MSan and libFuzzer tests 2019-08-23 06:39:54 +00:00
kamil f0720e6929 Add ATF c and c++ tests for TSan, MSan, libFuzzer
These tests require Clang/LLVM 7 or newer on NetBSD.

Contributed by Yang Zheng during GSoC 2018.
2019-08-18 20:15:58 +00:00
christos af5402251e Add explanatory text 2019-05-15 13:43:45 +00:00
mgorny de2592f9f0 Move common UBSAN test case code into ubsan_common.subr
Reviewed by <kamil>
2019-01-29 20:07:03 +00:00
mgorny ff295ecc8d Move common ASAN test case code into asan_common.subr
Reviewed by <kamil>
2019-01-29 20:02:34 +00:00
christos f629fca860 This now works too. 2019-01-08 00:22:11 +00:00
christos 82a6fadf05 this now works... 2019-01-08 00:21:19 +00:00
kamil b4d61ce68e Disable profile and compat 32-bit c++ sanitizer tests
These tests are known to be faulty. These fatures aren't ready.
They tend to break to unrelated changes to the codebase.

Base Clang and GCC are in general dated to use with sanitizers as these
features are being fixed on HEAD versions of both compilers (mostly Clang).
2018-07-16 07:27:26 +00:00
kamil 410141583e Improve wording for non-native speakers of English
Improve wording in t_ubsan tests in for c++.

No functional change intended.

Follow the changed in cc/ by <martin>
2018-05-04 12:51:18 +00:00
kamil 1560a24938 Explain VLA in c++/t_ubsan_vla_out_of_bounds.sh (ATF test)
VLA - Variable Length Array

Requested by <martin>
2018-05-04 12:27:58 +00:00
kamil e308425ef5 Add new ATF Undefined Behavior Sanitizer tests
Add new cc and c++ tests to check whether UBSan works.
These tests are prepared for GCC (in base) and Clang (with external patches).

Enable these tests for all ports by default, just verify whether we are
using GCC/Clang or a compatible compiler.

Add five equivalent C and C++ tests:
 - Integer addition overflow
 - Integer divide by zero
 - Integer negation overflow
 - Integer subtraction overflow
 - VLA out of bounds

All tests pass on NetBSD/amd64.

Patch submitted by <Harry Pantazis>
Minor cleanup by <myself>
2018-05-02 18:46:05 +00:00
kamil 8a7b75cec0 Import new C and C++ ATF tests for ASan
Add new tests:
 - tests/usr.bin/cc/t_asan_poison.sh
 - tests/usr.bin/c++/t_asan_poison.sh

These tests verify the following build options:
 - regular
 - profile
 - pic
 - pie
 - compat32
 - (static unsupported)

These tests verify whether ASan code can include compiler and sanitizer
specific header: <sanitizer/asan_interface.h>. The testing code checks
the ASAN_POISON_MEMORY_REGION() functionality, poisoning valid memory and
asserting that it triggers expected failure.

Patch submitted by <Siddharth Muralee>
2018-04-11 03:25:25 +00:00
kamil 8e4f836c68 Add new ATF tests for Address Sanitzier (ASan)
Add new C and C++ tests:
 - t_asan_double_free
 - t_asan_global_buffer_overflow
 - t_asan_heap_overflow
 - t_asan_off_by_one
 - t_asan_uaf

Each tests checks:
 - regular build
 - 32-bit
 - PIC
 - PIE
 - profile

These tests require paxctl(8) to disable ASLR in order to work in a
predictable way. This is especially true for all !regular builds with
additional compiler flags.

There are no static variations of these tests as this mode is not supported
in upstream ASan.

Enable these tests on amd64 and i386.

This is part two patch, adding the remaining C++ changes.

Patch submitted by <Siddharth Muralee>
Additional polishing by myself.
2018-04-04 23:53:26 +00:00
kamil b4fcb5aedb Correct a small regression typo in usr.bin/c++ ATF tests
TESTS_SH= changed to TESTS_SH+=
2018-04-04 15:53:04 +00:00
kamil b269e95d9e Sort entries in ATF tests in tests/usr.bin/c++/Makefile
No functional change intended.
2018-04-04 15:08:59 +00:00
kamil 77dc83fa09 Add new C++ ATF tests
Add new variations for existing C++ tests:
 - Static
 - Profile+32-bit
 - PIC+32-bit
 - PIC+Profile
 - PIC+Profile+32-bit

All tests pass for NetBSD/amd64:
 - t_cxxruntime
 - t_hello
 - t_static_destructor

+--------------------------------------------------------------+
| Options            | cxxruntime | hello  | static_destructor |
+--------------------------------------------------------------+
| None               | Passed     | Passed | Passed            |
| 32-bit             | Passed     | Passed | Passed            |
| PIC                | Passed     | Passed | Passed            |
| PIE                | Passed     | Passed | Passed            |
| Profile            | Passed     | Passed | Passed            |
| Static             | Passed     | Passed | Passed            |
| Profile+32-bit     | Passed     | Passed | Passed            |
| PIC+32-bit         | Passed     | Passed | Passed            |
| PIC+Profile        | Passed     | Passed | Passed            |
| PIC+Profile+32-bit | Passed     | Passed | Passed            |
+--------------------------------------------------------------+

Add new C++11 std::call_once tests:
 - t_call_once
 - t_call_once2

Add new C++11 test with pthread_once(3) and C++ lambda:
 - t_pthread_once

All tests with the profile option for std::call_once and
pthread_once(3) are marked as expected failure (NetBSD/amd64).

Results for *_once*:
+------------------------------------------------------------+
| Options            | call_once | call_once2 | pthread_once |
+------------------------------------------------------------+
| None               | Passed    | Passed     | Passed       |
| 32-bit             | Passed    |  Passed    | Passed       |
| PIC                | Passed    | Passed     | Passed       |
| PIE                | Passed    | Passed     | Passed       |
| Profile            |  Failed   |  Failed    |  Failed      |
| Static             | Passed    | Passed     | Passed       |
| Profile+32-bit     |  Failed   |  Failed    |  Failed      |
| PIC+32-bit         | Passed    | Passed     | Passed       |
| PIC+Profile        |  Failed   |  Failed    |  Failed      |
| PIC+Profile+32-bit |  Failed   |  Failed    |  Failed      |
+------------------------------------------------------------+

Long term there is an option to refacotr the framework for C and C++ tests,
in order to reduce code duplication.

Patches sent by Yang Zheng <tomsun.0.7@gmail.com>
2018-03-24 00:26:51 +00:00
martin 4fcb013cbf Add (currently failing) test cases for profiled programs. 2017-05-18 10:29:47 +00:00
kamil d1be05c0a9 Add new ATF C++ tests in usr.bin/c++: t_static_destructor
These tests are cloned from t_cxxruntime and check proper order of destructor
calls. They must be reported in reverse order of constructor completion.

Added tests:
 - static_destructor
 - static_destructor_pic
 - static_destructor_pie
 - static_destructor32

This test file replaces src/regress/usr.bin/c++/static_destructor.
2017-05-14 02:02:25 +00:00
kamil 179f19cf82 Use more C++ sugar in t_cxxruntime (ATF test) 2017-05-14 01:13:44 +00:00
kamil 9fab767d88 Add new ATF C++ tests in usr.bin/c++
These tests are cloned from t_hello and use c++ runtime basic functions.

Added tests:
 - hello
 - hello_pic
 - hello_pie
 - hello32
2017-05-14 01:03:21 +00:00
kamil b971227c60 Add new c++ ATF tests in usr.bin/c++: t_hello
This is a copy of t_hello from usr.bin/cc.

Added tests:
 - hello
 - hello_pic
 - hello_pie
 - hello32

These tests do not use c++ runtime library functions.

Protect these tests with MKCXX.
2017-05-14 00:07:07 +00:00