-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs #846
ci: Run ASan/LSan and reorganize sanitizer and Valgrind jobs #846
Conversation
5716133
to
9e55f58
Compare
A few things are weird on MacOS, and I don't really understand what's going on:
And job 32 times out... well that's not nice but at least I understand what's going on ... |
IIRC that's why I did Lines 10 to 13 in 4232e5b
|
Apparently that does not seem to work (anymore?). I think we shouldn't try to fix this now but first move to another CI platform. For example, Cirrus seems to ship with GCC cirruslabs/cirrus-ci-docs#67 . |
9e55f58
to
b80e84f
Compare
Rebased to work with Cirrus. I also updated the initial comment. |
4087f78
to
1191bb0
Compare
utACK 1191bb0 |
.cirrus.yml
Outdated
WRAPPER_CMD: "valgrind --error-exitcode=42" | ||
- name: "UBSan, ASan, LSan" | ||
env: | ||
# Use dummy wrapper command to run the tests outside of make check |
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.
Remind me, what's the reason for not running this (and valgrind) in make check
? If it was just about being able to set the test "count"/TEST_ITERS separately then we do have an env var for this now, and could remove it like this https://github.com/jonasnick/secp256k1/commits/202010_ci_matrix-jn (untested).
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.
I think it's just that make check
will try to run without the wrappers.
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.
You mean make check
is run without a wrapper even when a wrapper is set? Afaics no, because we unset BUILD
whenever we set WRAPPER_CMD
.
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.
The main issue (and I think this is what Pieter is partly saying) is that ${WRAPPER_CMD} make check
typically won't work for all wrapper commands.
valgrind make check
will memcheckmake
but will notmemcheck
our tests because they'll be child processes. (Now you could tryvalgrind --trace-children
but then it will still additionally memcheckmake
which gives false positives and wastes CI time.)wine make check
just won't work at all becausemake
is not a Windows executable.- I haven't tried QEMU but I expect the same as for Wine (because we cross-build).
What we could is to tell make
to use the wrapper command. Now that I'm reading up on this again, I recall that it's not even more work to do this. There's the (obscurely named) LOG_COMPILER
env variable, which does exactly this. You can even pass LOG_COMPILER="./libtool --mode=execute valgrind"
etc, which we don't need now but maybe in the future. Running all tests using make check
will have the benefit that the logs always end up in the same place in the CI output. Let me give it a shot.
And thanks for reminding me of SECP256K1_TEST_ITERS
. When I was writing this, I didn't know that this exists (I reinvented the name TEST_ITERS
). So we should simply set this variable instead, like we do for the benchmarks. This has the nice side effect that it would apply to the ordinary make check
builds if we'd like to set it there for some reason.
1191bb0
to
431a3a2
Compare
updated as described above edit: pushed again, I had forgotten the |
222a563
to
22e9804
Compare
22e9804
to
7528944
Compare
Hm, it's still timing out. But everything looks correct including the test iterations (like in the revision yesterday, when the longest job took ~ 40 min.) If I'm not mistaken, the only difference to now is that we run the tests in |
9bbf807
to
02dcea1
Compare
Ok, ignore my last comment. The tests were running twice because I screwed up when rebasing. I hope it's really ready now... |
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.
Nice!
ACK 02dcea1 spot-checked ci output, checked that when valgrind ./tests
crashes then LOG_COMPILER=valgrind make check
also crashes.
utACK 02dcea1 |
Summary: ``` This enables asan (including lsan), and restructures the sanitizer builds. It also removes -fno-omit-frame-pointer again. This is debatable. The main reason for removing this is that GCC (but not clang) fails to build (runs out of registers) when combining asan, -fno-omit-frame-pointer, and the x86_64 asm. But I believe without -fno-omit-frame-pointer, the instrumented binary may be closer to the real binary, which is good. If we get unusable debugging output on CI without frame pointers, we can still reproduce the build locally. ``` Backport of [[bitcoin-core/secp256k1#846 | secp256k1#846]]. Completes backport of [[bitcoin-core/secp256k1#969 | secp256k1#969]]: bitcoin-core/secp256k1@3d2f492 Depends on D12957. Test Plan: ninja check-secp256k1 Tested the cirrus build against my personal github forked repo. Reviewers: #bitcoin_abc, sdulfari Reviewed By: #bitcoin_abc, sdulfari Subscribers: sdulfari Differential Revision: https://reviews.bitcoinabc.org/D12960
Summary: ``` This enables asan (including lsan), and restructures the sanitizer builds. It also removes -fno-omit-frame-pointer again. This is debatable. The main reason for removing this is that GCC (but not clang) fails to build (runs out of registers) when combining asan, -fno-omit-frame-pointer, and the x86_64 asm. But I believe without -fno-omit-frame-pointer, the instrumented binary may be closer to the real binary, which is good. If we get unusable debugging output on CI without frame pointers, we can still reproduce the build locally. ``` Backport of [[bitcoin-core/secp256k1#846 | secp256k1#846]]. Completes backport of [[bitcoin-core/secp256k1#969 | secp256k1#969]]: bitcoin-core/secp256k1@3d2f492 Depends on D12957. Test Plan: ninja check-secp256k1 Tested the cirrus build against my personal github forked repo. Reviewers: #bitcoin_abc, sdulfari Reviewed By: #bitcoin_abc, sdulfari Subscribers: sdulfari Differential Revision: https://reviews.bitcoinabc.org/D12960
This enables asan (including lsan), and restructures the sanitizer builds. It also removes
-fno-omit-frame-pointer
again. This is debatable. The main reason for removing this is that GCC (but not clang) fails to build (runs out of registers) when combining asan,-fno-omit-frame-pointer
, and the x86_64 asm. But I believe without-fno-omit-frame-pointer
, the instrumented binary may be closer to the real binary, which is good. If we get unusable debugging output on CI without frame pointers, we can still reproduce the build locally.ECMULTGENPRECISION=8
: We should disable this entirely, not only on CI, because it's slow and needs too much stack space