Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #15817

Closed (moved)
Open
Opened 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 admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.2.7.x-final
Milestone
Tor: 0.2.7.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#15817