[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #15817 [Tor]: Allow clang runtime sanitizers to be used on tor unit tests
#15817: Allow clang runtime sanitizers to be used on tor unit tests
------------------------------+------------------------------------
Reporter: teor | Owner:
Type: defect | Status: new
Priority: minor | Milestone: Tor: 0.2.7.x-final
Component: Tor | Version: Tor: 0.2.7
Keywords: unit-tests clang | Actual Points:
Parent ID: | Points:
------------------------------+------------------------------------
The clang runtime address sanitizer causes the memwipe and backtrace tests
to fail, because it catches the undefined behavior that is invoked as an
unavoidable part of these tests.
This issue can be resolved by:
1. blacklisting the involved functions so the sanitizer doesn't check
them, by adding to the command line `-fsanitize-
blacklist=sanitize_blacklist.txt` containing:
{{{
# test-memwipe.c checks if a freed buffer was properly wiped
fun:vmemeq
# test_bt_cl.c stores to a NULL pointer to trigger a crash
fun:crash
# we need to exempt the entire file, otherwise address sanitizer munges
# the expected output
src:test_bt_cl.c
}}}
2. allowing the backtrace handler to catch SIGSEGV (rather than address
sanitizer), by setting the environmental variable
`ASAN_OPTIONS=allow_user_segv_handler=1`
The attached file is a sanitizer blacklist file which documents this
resolution, and implements the blacklisting (but not the environmental
variable).
Nick, can we put this in contrib?
I think that's the best way to deal with the special case of "clang users
running tests under AddressSanitizer"
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15817>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs