Commit Graph

52 Commits

Author SHA1 Message Date
Fabian Boehm
5e775d1607 Upgrade actions/checkout to v4
Otherwise it's gonna start throwing node warnings soon.

Isn't software great?
2023-09-06 10:13:04 +02:00
Henrik Hørlück Berg
5734630966 Replace ATiltedTree/setup-rust with rust-toolchain
- https://github.com/ATiltedTree/setup-rust has not been committed to since May
  2022, I am uncertain about how widely used it is.
- It appears to have a bug with restoring its internal cache whenever there
  comes a new stable version (immediate guess would be the cache-key does not
  resolve `stable` to a specific version, which somehow breaks rustup, but I have not investigated)
- https://github.com/dtolnay/rust-toolchain is a more sensible take of https://github.com/actions-rs/toolchain,
  where the original repo appears to be unmaintained.
  It is implemented in one file of yaml/bash
  https://github.com/dtolnay/rust-toolchain/blob/master/action.yml, we could
  easily fork it if it becomes unmainted, unlike the other actions which uses
  unnecessary javascript
2023-08-28 23:15:25 +08:00
Fabian Boehm
055e40467f github actions: Disable pexpect for ASAN for now
This fails basically every commit, just by blowing the time budget.
2023-05-08 19:05:44 +02:00
Mahmoud Al-Qudsi
7b0cc33f2e Add LSAN suppressions file
Suppress TLS variable leaks caused by outstanding background threads by
suppressing the ASAN interposer functions. This is possible because because
we're now using use_tls=1.

-----------------------

Direct leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x5627a1f0cc86 in __interceptor_realloc (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xb9fc86) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #1 0x7f04d8800f79 in pthread_getattr_np (/lib/x86_64-linux-gnu/libc.so.6+0x95f79) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
    #2 0x5627a1f2f664 in __sanitizer::GetThreadStackTopAndBottom(bool, unsigned long*, unsigned long*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbc2664) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #3 0x5627a1f2fb83 in __sanitizer::GetThreadStackAndTls(bool, unsigned long*, unsigned long*, unsigned long*, unsigned long*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbc2b83) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #4 0x5627a1f19a0d in __asan::AsanThread::SetThreadStackAndTls(__asan::AsanThread::InitOptions const*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbaca0d) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #5 0x5627a1f19615 in __asan::AsanThread::Init(__asan::AsanThread::InitOptions const*) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbac615) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #6 0x5627a1f19b01 in __asan::AsanThread::ThreadStart(unsigned long long) (/home/runner/work/fish-shell/fish-shell/build/fish_tests+0xbacb01) (BuildId: da87d16730727369ad5fa46052d10337d6941fa9)
    #7 0x7f04d87ffb42  (/lib/x86_64-linux-gnu/libc.so.6+0x94b42) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
    #8 0x7f04d88919ff  (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
2023-05-02 11:52:42 -05:00
Mahmoud Al-Qudsi
905430629d Use ASAN_OPTIONS fast_unwind_on_malloc=0
This is much slower but gives proper stack traces for calls emanating from code
that wasn't compiled with -fno-omit-frame-pointer.
2023-05-02 11:52:42 -05:00
Mahmoud Al-Qudsi
c43e040c7c Fix spurious ASAN __cxa_thread_atexit_impl() leaks
Set use_tls back to its default of 1.

This is required to work around an ASAN/LSAN virtualization bug but seems to be
behind the random __cxa_thread_atexit_impl() leaks?
2023-05-02 11:52:41 -05:00
Mahmoud Al-Qudsi
544bd183da Add and use ASAN blacklist
Blacklist an apparently false positive in the underlying runtime.
2023-04-29 11:02:59 -05:00
ridiculousfish
2d6f752f6e Revert "Add link-asan to RUSTFLAGS in CI"
This reverts commit 8bb1bb8ae1.
2023-04-06 14:29:18 -07:00
ridiculousfish
8bb1bb8ae1 Add link-asan to RUSTFLAGS in CI
This fixes our CI for the new crates we're about to add.
2023-03-26 11:07:15 -07:00
Mahmoud Al-Qudsi
1bdb7dffaf Use cargo build -Z build-std for ASAN
This is recommended and increases coverage.
2023-03-08 11:27:15 -06:00
Mahmoud Al-Qudsi
ce5686edc7 Have ASAN CI use debug build
This catches things that might be optimized away by the compiler.
2023-03-07 13:04:28 -06:00
Mahmoud Al-Qudsi
91cf526d23
Enable rust address sanitizer for asan ci job (#9643)
Rust has multiple sanitizers available (with llvm integration).
-Zsanitizer=address catches the most likely culprits but we may want to set up a
separate job w/ -Zsanitizer=memory to catch uninitialized reads.

It might be necessary to execute `cargo build` as `cargo build -Zbuild-std` to
get full coverage.

When we're linking against the hybrid C++ codebase, the sanitizer library is
injected into the binary by also include `-fsanitize=address` in CXXFLAGS - we
do *not* want to manually opt-into `-lasan`. We also need to manually specify
the desired target triple as a CMake variable and then explicitly pass it to all
`cargo` invocations if building with ASAN.

Corrosion has been patched to make sure it follows these rules.

The `cargo-test` target is failing to link under ASAN. For some reason it has
autocxx/ffi dependencies even though only rust-native, ffi-free code should be
tested (and one would think the situation wouldn't change depending on the
presence of the sanitizer flag). It's been disabled under ASAN for now.
2023-03-06 18:15:36 -06:00
Fabian Boehm
ad22bf9387 GH Actions: Use our MSRV as the rust-version
Currently we're at 1.67, I don't want to accidentally introduce 1.68
features once that's released
2023-02-20 19:40:47 +01:00
Mahmoud Al-Qudsi
4f6fe0999e Disable TSAN in CI for now
See issues encountered in #9586 due to TSAN not recognizing valid/safe rust
patterns.
2023-02-19 15:42:07 -06:00
ridiculousfish
d843b67d2d Initial Rust commit 2023-02-02 19:34:47 -07:00
Mahmoud Al-Qudsi
31f63b2f87 Upgrade GitHub CI actions/checkout to v3
This addresses the node v12 deprecation warning in the GitHub CI, caused by the
dependency on actions/checkout@v2.

While actions/checkout@v3 introduces some new features and changes some
defaults, the subset of features that we use should not be affected by this
migration.

The "breaking change" from v2 to v3 can be seen at [0]. Since we are tracking
only v2 without a dot release specified, we are already opting into any breakage
across minor versions, so really the only change of note is the node version
upgrade.

[0]: https://github.com/actions/checkout/compare/v2.4.2...v3.0.0
2023-01-31 11:50:57 -06:00
ridiculousfish
5f23da9939 Add a TSAN workaround and re-enable the test
This reverts commit 865602e8d1.
2022-12-19 15:54:23 -08:00
Fabian Boehm
865602e8d1 Github Actions: Disable tsan once more 2022-12-19 19:55:36 +01:00
ridiculousfish
4159b2a33b Disable shebangless script tests in CI with sanitizers
Sanitizers inject a busted posix_spawn interceptor which mishandles
shebangless scripts. Disable this test under sanitizers.
2022-12-02 17:32:52 -08:00
Mahmoud Al-Qudsi
44c9c51841 Disable leak detection in test_autosuggest_suggest_special() under CI
This is a false positive as a result of disabling TLS support in LSAN due to an
incompatibility with newer versions of glibc.

Also remove the older workaround (because it didn't work).
2022-10-24 19:02:49 -05:00
Mahmoud Al-Qudsi
bfa172852f Add a workaround for intermittent LSAN crash under CI
LSAN seems to have an issue with glibc's TLS functionality that causes it to
intermittently crash with SIGSEGV when run virtualized, as it is in our CI.

Relevant GitHub issues:
* https://github.com/google/sanitizers/issues/1342
* https://github.com/google/sanitizers/issues/1409
2022-10-24 18:56:55 -05:00
Mahmoud Al-Qudsi
4f8a7c4779 Drop LSAN CI options that break tests
LSAN with verbosity=1 or log_threads=1 adds output to stderr, breaking
littlecheck tests.
2022-10-24 18:56:55 -05:00
Mahmoud Al-Qudsi
de62091b03 Correctly set ASAN/UBSAN/LSAN options for CI
These are NOT build-time defines but rather run-time environment variables! They
have never had any effect and we have effectively never used them to affect
sanitizer behavior under CI with ASAN/UBSAN/LSAN enabled.

(I caught this because the tests don't pass with either of LSAN_OPTIONS
`verbosity=1` or `log_threads=1` because they inject text into the stderr
output, ensuring they never pass littlecheck.)
2022-10-24 18:56:55 -05:00
Mahmoud Al-Qudsi
63a2fdd773 Re-enable tests under ASAN/LSAN/UBSAN in GitHub CI
With the previous workaround skipping `test_autosuggest_suggest_special()` when
LSAN is enabled, the sanitizer seems to run to completion just fine.
2022-10-24 18:56:55 -05:00
ridiculousfish
6c81eb14d7 CI: ubuntu-32bit-vendored-pcre2 -> ubuntu-32bit-fetched-pcre2
We no longer vendor PCRE2 sources, instead we fetch them from the
official repo.
2022-07-02 19:00:08 -07:00
naveen
1331b65023 chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-07 14:34:59 +02:00
Fabian Homborg
7dce2c0607 Disable ASAN test
The current Github Actions ubuntu-latest image crashes in the
autosuggest_suggest_special test with ASAN.

We have not been able to reproduce this locally, and this is getting
in the way.

I have no idea how to disable this test on ASAN specifically, all my
attempts have failed. So the only recourse I know is to disable the
ASAN tests on GA entirely.
2022-04-18 10:06:25 +02:00
Fabian Homborg
e3c4cde042 Enable LSAN_OPTIONS
Whyyyyy does this not tell me what's broken by *default*?
2022-04-17 13:57:52 +02:00
ridiculousfish
06666f3d1d CI: Set CMAKE_BUILD_PARALLEL_LEVEL to 4.
This speeds up the CI build, since before it was effectively 1.
Build times on ubuntu-latest are reduced by slightly over 2 minutes.

Note Linux CI runners are defined to have 2 cores and Mac runners 3.
2022-01-02 18:01:54 -08:00
Aaron Gyes
124dac4781
Update main.yml 2021-12-02 05:54:29 -08:00
Kid
03f9c3d2e6 Give tests a more generic name 2021-11-16 12:06:55 +01:00
Mahmoud Al-Qudsi
aa25c4eccc Run tests serially under CI 2021-08-29 08:56:12 +02:00
Fabian Homborg
4c90ed0e0d Generate french locale
To keep myself honest, we're not gonna choose german
2021-07-29 17:20:20 +02:00
Johannes Altmanninger
28b17879c7 Install tmux to run tmux-tests on MacOS CI
Also install them explicitly on Linux, for better discoverability.
2021-05-01 22:51:35 +02:00
David Adam
fd184cb4ea GitHub Actions: drop UBSan suppressions
These were only needed on Travis, and only worked there in this form.
2021-04-07 20:29:54 +08:00
David Adam
a1f55b1b73 GitHub Actions: run tests against all branches 2021-04-07 20:27:58 +08:00
Fabian Homborg
e19a2f9f85 Github: Force using vendored pcre2
It seems an update to the ubuntu image github uses included pcre2, but
only the 64-bit version.

So since we now force a 32-bit fish but don't force the vendored pcre,
it complains.

Simply force the vendored pcre as well as I don't believe it's worth
it to change the pcre2 detection in this case.
2021-04-01 22:58:25 +02:00
Mahmoud Al-Qudsi
070e6e41ca Remove homebrew dependency in macOS CI workflow
The GitHub documentation states that python3 w/ pip3 is already
installed, and homebrew is slow as molasses (and when it finally runs it
gives a warning about python already being installed and up to date).
2021-02-22 20:35:56 -06:00
ridiculousfish
96f2de9d15 Revert "Disable Github Actions tsan"
This reverts commit 432f005859.

Thread Sanitizer issues have been sorted, so bravely re-enable
this test.
2021-02-07 10:59:10 -08:00
Fabian Homborg
432f005859 Disable Github Actions tsan
This was updated and now always fails, but it always did so - you can
test it with 3.1.2 as well, it's just not happy with the iothread
stuff.

Because it's super easy to test this locally this disables the github
actions test so it doesn't complain *constantly*.

See #7681
2021-02-06 21:32:42 +01:00
ridiculousfish
c1cfefa057 Attempt to fix the ubuntu 32 bit vendored PCRE build
Use 'apt update' and see what happens
2020-12-19 18:22:10 -08:00
Fabian Homborg
6ceada8aa1 CI: Add sanitizer builds 2020-11-11 17:55:03 +01:00
Fabian Homborg
afa57619a8 CI: Add 32bit Ubuntu build with vendored pcre2
From Travis
2020-11-11 17:53:18 +01:00
Fabian Homborg
6e3537dbde CI: Add CXXFLAGS from Travis
This errored for some Warnings to match OBS
2020-11-11 17:43:24 +01:00
Fabian Homborg
bff1f1aeea Actually run the tests on Github Actions Ubuntu
Oops
2020-11-07 07:55:47 +01:00
Fabian Homborg
811ba586ea Github Actions: Try macOS again
Once more into the breach!

See #7447.
2020-11-02 21:04:36 +01:00
Fabian Homborg
92b987145e Disable macos tests on github again
Yeah, just *much* too slow to not be super flaky.
2020-06-19 23:13:21 +02:00
Fabian Homborg
56a9e698d0 Github Actions: Work around macos codesigning
We can't use gettext and we won't use system pcre2.
2020-06-18 17:27:07 +02:00
Fabian Homborg
89622eb6f3 Github actions: Try macos again
This might possibly use pexpect
2020-06-18 17:20:27 +02:00
Fabian Homborg
298073f08c github: Use pexpect 2020-06-18 17:10:09 +02:00