Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #15817
Closed (moved) (moved)
Open
Issue created Apr 25, 2015 by teor@teor

Allow clang runtime sanitizers to be used on tor unit tests

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
  1. 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"

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking