I think invoke.texi should at least mention that the environment variables LSAN_OPTIONS, TSAN_OPTIONS and ASAN_OPTIONS. (And none for ubsan.) Better would be if there were a full support, but I admit that that's a rather long list, of supported values: COMMON: malloc_context_size strip_path_prefix fast_unwind_on_fatal fast_unwind_on_malloc symbolize handle_ioctl log_path detect_leaks leak_check_at_exit allocator_may_return_null LSAN: use_registers use_globals use_stacks use_tls use_unaligned report_objects resolution max_leaks verbosity log_pointers log_threads exitcode suppressions TSAN: enable_annotations suppress_equal_stacks suppress_equal_addresses suppress_java report_bugs report_thread_leaks report_destroy_locked report_signal_unsafe report_atomic_races force_seq_cst_atomics strip_path_prefix suppressions print_suppressions print_benign exitcode halt_on_error log_path atexit_sleep_ms verbosity profile_memory flush_memory_ms flush_symbolizer_ms stop_on_start external_symbolizer_path history_size io_sync allocator_may_return_null ASAN: quarantine_size verbosity redzone debug report_globals check_initialization_order replace_str replace_intrin mac_ignore_invalid_free asan/asan_rtl.cc: ParseFlag(str, &f->detect_stack_use_after_return, uar_stack_size_log max_malloc_fill_size malloc_fill_byte exitcode allow_user_poisoning sleep_before_dying handle_segv allow_user_segv_handler use_sigaltstack check_malloc_usable_size unmap_shadow_on_exit abort_on_error print_stats print_legend atexit disable_core allow_reexec print_full_thread_history poison_heap alloc_dealloc_mismatch use_stack_depot strict_memcmp strict_init_order
Not all of these options are "supported" -- some are for internal use only and may change or disappear at any time. The supported ones are described here: https://code.google.com/p/address-sanitizer/wiki/Flags https://code.google.com/p/thread-sanitizer/wiki/Flags Note that these flags may change too, and so if you document them in gcc docs, someone will need to keep the docs in sync with the updates.
Partial list for ASAN; linking to it might be an option: https://code.google.com/p/address-sanitizer/wiki/Flags#Run-time_flags Seemingly, there is no list for LSAN/TSAN. The URL above lists part of the common options, missing are: symbolize handle_ioctl detect_leaks leak_check_at_exit allocator_may_return_null and most of the ASAN options, missing are allow_reexec atexit check_malloc_usable_size debug malloc_fill_byte max_malloc_fill_size poison_heap print_full_thread_history print_legend print_stats replace_intrin replace_str report_globals unmap_shadow_on_exit use_sigaltstack use_stack_depot
(In reply to Kostya Serebryany from comment #1) > https://code.google.com/p/thread-sanitizer/wiki/Flags Seems as if the page has changed. Currently, invoke.texi points to: http://code.google.com/p/data-race-test/wiki/ThreadSanitizer
> Seems as if the page has changed. Currently, invoke.texi points to: > http://code.google.com/p/data-race-test/wiki/ThreadSanitizer Link to data-race-test was never correct. This is the old and unsupported version of the tool -- it was never part of gcc or llvm.
Author: burnus Date: Sat Nov 30 09:11:13 2013 New Revision: 205548 URL: http://gcc.gnu.org/viewcvs?rev=205548&root=gcc&view=rev Log: 2013-11-30 Tobias Burnus <burnus@net-b.de> PR sanitizer/59275 * doc/invoke.texi (-fsanitize=address,leak): Mention the * associated environment variable and link to a list with flags. (-fsanitize=thread): Ditto and update link. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/invoke.texi
Close as sufficiently FIXED. However, on the Wiki side, one should add the missing items, cf. comment 2, to ASAN/TSAN - and LSAN completely misses a flag description. Kostya: What's the best way to get them added to the Wiki pages?
(In reply to Tobias Burnus from comment #6) > Close as sufficiently FIXED. > > However, on the Wiki side, one should add the missing items, cf. comment 2, > to ASAN/TSAN - and LSAN completely misses a flag description. > > Kostya: What's the best way to get them added to the Wiki pages? lsan flags are now documented at https://code.google.com/p/address-sanitizer/wiki/LeakSanitizer All ASAN/TSAN flags that we wanted to document are already documented on their wikis.