-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add address/undefined behavior/thread sanitizer builds to CI #373
Conversation
This cannot be merged for two reasons:
|
b5d84e3
to
a817fff
Compare
a3588cb
to
42366b0
Compare
42366b0
to
b42a79d
Compare
I've addressed the issues I mentioned above; it's ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@@ -262,7 +263,7 @@ TYPED_TEST_P(GroupByTester, test_groupby_modify_combine) { | |||
const auto grouped = group_by(parent, this->test_case.get_grouper()); | |||
auto groups = grouped.groups(); | |||
|
|||
const auto first_key = map_keys(groups)[0]; | |||
const typename decltype(groups)::key_t first_key = map_keys(groups)[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why auto
doesn't work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It deduces a reference type which has lifetime issues, triggering the address sanitizer!
.github/workflows/ci.yaml
Outdated
ubuntu-clang14-thread: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- name: Install clang-14 | ||
run: | | ||
sudo apt-get update && \ | ||
sudo apt-get install build-essential software-properties-common -y && \ | ||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ | ||
sudo apt-get update && \ | ||
sudo apt-get install clang-14 && \ | ||
gcc -v | ||
- name: Run build | ||
env: | ||
CC: clang-14 | ||
CXX: clang++-14 | ||
TESTENV: clang14 | ||
run: | | ||
bash ./ci/run_thread_sanitizer_tests.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extreme nit. This and the address undefined leak
jobs are relatively similar so we can matricize them. Something like:
ubuntu-clang14-thread: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
ssh-key: ${{ secrets.SSH_KEY }} | |
- name: Install clang-14 | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ | |
sudo apt-get update && \ | |
sudo apt-get install clang-14 && \ | |
gcc -v | |
- name: Run build | |
env: | |
CC: clang-14 | |
CXX: clang++-14 | |
TESTENV: clang14 | |
run: | | |
bash ./ci/run_thread_sanitizer_tests.sh | |
ubuntu-clang14-sanitizer-tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
os: | |
- { name: "address-undefined-leak", script: "./ci/run_address_sanitizer_tests.sh" } | |
- { name: "thread", script: "./ci/run_thread_sanitizer_tests.sh" } | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
ssh-key: ${{ secrets.SSH_KEY }} | |
- name: Install clang-14 | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential software-properties-common -y | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
sudo apt-get update | |
sudo apt-get install clang-14 | |
gcc -v | |
- name: Run (${{ matrix.name }} ) Sanitizer Tests | |
env: | |
CC: clang-14 | |
CXX: clang++-14 | |
TESTENV: clang14 | |
run: | | |
bash "${{ matrix.script }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done; let's see if I copied correctly :)
submodules: recursive | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- name: Install clang-14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to replace this with a premade action, such as:
https://github.com/marketplace/actions/install-llvm-and-clang
Maybe in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to make a ticket for the future -- for now I think I'll just keep it simple.
b42a79d
to
94b115a
Compare
This PR fixes existing runtime sanitizer failures and then adds CI jobs to run the sanitizers on every PR.