You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Note that we already use -fsanitize=address,undefined in the Makefile tests for the C implementation.)
Reddit user /u/gzk11059 gave some very helpful pointers. Based on that thread, here's a first start on running sanitizers against the C implementation.
cd c/blake3_c_rust_bindings
CC=clang CFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all" RUSTFLAGS=-Zsanitizer=address cargo +nightly test
I can confirm that if I add some undefined behavior like this:
intsigned_overflow=2147483647;
signed_overflow++;
and then run the command above, I get a failure like this:
test test::test_compare_reference_impl ... ../blake3.c:11:18: runtime error: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../blake3.c:11:18 in
The text was updated successfully, but these errors were encountered:
oconnor663
changed the title
notes for adding ASan and UBSan testing
notes for turning on ASan and UBSan in the Rust test harness
Jun 28, 2020
(Note that we already use
-fsanitize=address,undefined
in the Makefile tests for the C implementation.)Reddit user /u/gzk11059 gave some very helpful pointers. Based on that thread, here's a first start on running sanitizers against the C implementation.
I can confirm that if I add some undefined behavior like this:
and then run the command above, I get a failure like this:
The text was updated successfully, but these errors were encountered: