Index: compiler-rt/lib/asan/asan_flags.inc =================================================================== --- compiler-rt/lib/asan/asan_flags.inc +++ compiler-rt/lib/asan/asan_flags.inc @@ -20,11 +20,11 @@ ASAN_FLAG(int, quarantine_size, -1, "Deprecated, please use quarantine_size_mb.") ASAN_FLAG(int, quarantine_size_mb, -1, - "Size (in Mb) of quarantine used to detect use-after-free " - "errors. Lower value may reduce memory usage but increase the " + "Size (in Mb) of quarantine used to detect use-after-free\n" + "errors. Lower value may reduce memory usage but increase the\n" "chance of false negatives.") ASAN_FLAG(int, redzone, 16, - "Minimal size (in bytes) of redzones around heap objects. " + "Minimal size (in bytes) of redzones around heap objects.\n" "Requirement: redzone >= 16, is a power of two.") ASAN_FLAG(int, max_redzone, 2048, "Maximal size (in bytes) of redzones around heap objects.") @@ -33,14 +33,14 @@ "If set, prints some debugging information and does additional checks.") ASAN_FLAG( int, report_globals, 1, - "Controls the way to handle globals (0 - don't detect buffer overflow on " - "globals, 1 - detect buffer overflow, 2 - print data about registered " + "Controls the way to handle globals (0 - don't detect buffer overflow on\n" + "globals, 1 - detect buffer overflow, 2 - print data about registered\n" "globals).") ASAN_FLAG(bool, check_initialization_order, false, "If set, attempts to catch initialization order issues.") ASAN_FLAG( bool, replace_str, true, - "If set, uses custom wrappers and replacements for libc string functions " + "If set, uses custom wrappers and replacements for libc string functions\n" "to find more errors.") ASAN_FLAG(bool, replace_intrin, true, "If set, uses custom wrappers for memset/memcpy/memmove intrinsics.") @@ -55,44 +55,44 @@ "Use mmap with 'noreserve' flag to allocate fake stack.") ASAN_FLAG( int, max_malloc_fill_size, 0x1000, // By default, fill only the first 4K. - "ASan allocator flag. max_malloc_fill_size is the maximal amount of " + "ASan allocator flag. max_malloc_fill_size is the maximal amount of\n" "bytes that will be filled with malloc_fill_byte on malloc.") ASAN_FLAG(int, malloc_fill_byte, 0xbe, "Value used to fill the newly allocated memory.") ASAN_FLAG(bool, allow_user_poisoning, true, - "If set, user may manually mark memory regions as poisoned or " + "If set, user may manually mark memory regions as poisoned or\n" "unpoisoned.") ASAN_FLAG( int, sleep_before_dying, 0, - "Number of seconds to sleep between printing an error report and " - "terminating the program. Useful for debugging purposes (e.g. when one " + "Number of seconds to sleep between printing an error report and\n" + "terminating the program. Useful for debugging purposes (e.g. when one\n" "needs to attach gdb).") ASAN_FLAG(bool, check_malloc_usable_size, true, - "Allows the users to work around the bug in Nvidia drivers prior to " + "Allows the users to work around the bug in Nvidia drivers prior to\n" "295.*.") ASAN_FLAG(bool, unmap_shadow_on_exit, false, "If set, explicitly unmaps the (huge) shadow at exit.") ASAN_FLAG(bool, protect_shadow_gap, true, "If set, mprotect the shadow gap") ASAN_FLAG(bool, print_stats, false, - "Print various statistics after printing an error message or if " + "Print various statistics after printing an error message or if\n" "atexit=1.") ASAN_FLAG(bool, print_legend, true, "Print the legend for the shadow bytes.") ASAN_FLAG(bool, print_scariness, false, "Print the scariness score. Experimental.") ASAN_FLAG(bool, atexit, false, - "If set, prints ASan exit stats even after program terminates " + "If set, prints ASan exit stats even after program terminates\n" "successfully.") ASAN_FLAG( bool, print_full_thread_history, true, - "If set, prints thread creation stacks for the threads involved in the " + "If set, prints thread creation stacks for the threads involved in the\n" "report and their ancestors up to the main thread.") ASAN_FLAG( bool, poison_heap, true, - "Poison (or not) the heap memory on [de]allocation. Zero value is useful " + "Poison (or not) the heap memory on [de]allocation. Zero value is useful\n" "for benchmarking the allocator or instrumentator.") ASAN_FLAG(bool, poison_partial, true, - "If true, poison partially addressable 8-byte aligned words " - "(default=true). This flag affects heap and global buffers, but not " + "If true, poison partially addressable 8-byte aligned words\n" + "(default=true). This flag affects heap and global buffers, but not\n" "stack buffers.") ASAN_FLAG(bool, poison_array_cookie, true, "Poison (or not) the array cookie after operator new[].") @@ -109,33 +109,33 @@ "Report errors on mismatch between size of new and delete.") ASAN_FLAG( bool, strict_init_order, false, - "If true, assume that dynamic initializers can never access globals from " + "If true, assume that dynamic initializers can never access globals from\n" "other modules, even if the latter are already initialized.") ASAN_FLAG( bool, start_deactivated, false, - "If true, ASan tweaks a bunch of other flags (quarantine, redzone, heap " - "poisoning) to reduce memory consumption as much as possible, and " - "restores them to original values when the first instrumented module is " - "loaded into the process. This is mainly intended to be used on " + "If true, ASan tweaks a bunch of other flags (quarantine, redzone, heap\n" + "poisoning) to reduce memory consumption as much as possible, and\n" + "restores them to original values when the first instrumented module is\n" + "loaded into the process. This is mainly intended to be used on\n" "Android. ") ASAN_FLAG( int, detect_invalid_pointer_pairs, 0, - "If non-zero, try to detect operations like <, <=, >, >= and - on " - "invalid pointer pairs (e.g. when pointers belong to different objects). " + "If non-zero, try to detect operations like <, <=, >, >= and - on\n" + "invalid pointer pairs (e.g. when pointers belong to different objects).\n" "The bigger the value the harder we try.") ASAN_FLAG( bool, detect_container_overflow, true, - "If true, honor the container overflow annotations. See " + "If true, honor the container overflow annotations. See\n" "https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow") ASAN_FLAG(int, detect_odr_violation, 2, - "If >=2, detect violation of One-Definition-Rule (ODR); " - "If ==1, detect ODR-violation only if the two variables " + "If >=2, detect violation of One-Definition-Rule (ODR);\n" + "If ==1, detect ODR-violation only if the two variables\n" "have different sizes") ASAN_FLAG(bool, dump_instruction_bytes, false, "If true, dump 16 bytes starting at the instruction that caused SEGV") ASAN_FLAG(const char *, suppressions, "", "Suppressions file name.") ASAN_FLAG(bool, halt_on_error, true, - "Crash the program after printing the first error report " + "Crash the program after printing the first error report\n" "(WARNING: USE AT YOUR OWN RISK!)") ASAN_FLAG(bool, use_odr_indicator, false, "Use special ODR indicator symbol for ODR violation detection") Index: compiler-rt/lib/dfsan/dfsan_flags.inc =================================================================== --- compiler-rt/lib/dfsan/dfsan_flags.inc +++ compiler-rt/lib/dfsan/dfsan_flags.inc @@ -23,9 +23,9 @@ "Whether to warn on unimplemented functions.") DFSAN_FLAG( bool, strict_data_dependencies, true, - "Whether to propagate labels only when there is an obvious data dependency" - "(e.g., when comparing strings, ignore the fact that the output of the" - "comparison might be data-dependent on the content of the strings). This" + "Whether to propagate labels only when there is an obvious data dependency\n" + "(e.g., when comparing strings, ignore the fact that the output of the\n" + "comparison might be data-dependent on the content of the strings). This\n" "applies only to the custom functions defined in 'custom.c'.") DFSAN_FLAG(const char *, dump_labels_at_exit, "", "The path of the file where " "to dump the labels when the " Index: compiler-rt/lib/lsan/lsan_flags.inc =================================================================== --- compiler-rt/lib/lsan/lsan_flags.inc +++ compiler-rt/lib/lsan/lsan_flags.inc @@ -21,7 +21,7 @@ "Print addresses of leaked objects after main leak report.") LSAN_FLAG( int, resolution, 0, - "Aggregate two objects into one leak if this many stack frames match. If " + "Aggregate two objects into one leak if this many stack frames match. If\n" "zero, the entire stack trace must match.") LSAN_FLAG(int, max_leaks, 0, "The number of leaks reported.") @@ -35,8 +35,8 @@ LSAN_FLAG(bool, use_root_regions, true, "Root set: include regions added via __lsan_register_root_region().") LSAN_FLAG(bool, use_ld_allocations, true, - "Root set: mark as reachable all allocations made from dynamic " - "linker. This was the old way to handle dynamic TLS, and will " + "Root set: mark as reachable all allocations made from dynamic\n" + "linker. This was the old way to handle dynamic TLS, and will\n" "be removed soon. Do not use this flag.") LSAN_FLAG(bool, use_unaligned, false, "Consider unaligned pointers valid.") Index: compiler-rt/lib/sanitizer_common/sanitizer_common.h =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_common.h +++ compiler-rt/lib/sanitizer_common/sanitizer_common.h @@ -186,6 +186,7 @@ void Write(const char *buffer, uptr length); bool SupportsColors(); void SetReportPath(const char *path); + static void SwapStdoutReportFile(); // Don't use fields directly. They are only declared public to allow // aggregate initialization. @@ -207,6 +208,7 @@ void ReopenIfNecessary(); }; extern ReportFile report_file; +extern ReportFile stdout_report_file; extern uptr stoptheworld_tracer_pid; extern uptr stoptheworld_tracer_ppid; Index: compiler-rt/lib/sanitizer_common/sanitizer_common.cc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_common.cc +++ compiler-rt/lib/sanitizer_common/sanitizer_common.cc @@ -34,6 +34,7 @@ StaticSpinMutex report_file_mu; ReportFile report_file = {&report_file_mu, kStderrFd, "", "", 0}; +ReportFile stdout_report_file = {&report_file_mu, kStdoutFd, "", "", 0}; void RawWrite(const char *buffer) { report_file.Write(buffer, internal_strlen(buffer)); @@ -74,6 +75,10 @@ fd_pid = pid; } +void ReportFile::SwapStdoutReportFile() { + Swap(report_file, stdout_report_file); +} + void ReportFile::SetReportPath(const char *path) { if (!path) return; Index: compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cc +++ compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cc @@ -18,6 +18,8 @@ #include "sanitizer_flags.h" #include "sanitizer_flag_parser.h" +#include + namespace __sanitizer { LowLevelAllocator FlagParser::Alloc; @@ -57,9 +59,41 @@ } void FlagParser::PrintFlagDescriptions() { + char *saveopts; + bool inline_format = true; + char *indentation = "\t"; + +// _GNU_HELP_OUTPUT is used by GCC to reduce the width of printed help +// output to 80 characters. Moreover, the help output is printed to stdout. +#ifdef _GNU_HELP_OUTPUT + ReportFile::SwapStdoutReportFile(); + inline_format = false; + indentation = " "; +#endif + Printf("Available flags for %s:\n", SanitizerToolName); - for (int i = 0; i < n_flags_; ++i) - Printf("\t%s\n\t\t- %s\n", flags_[i].name, flags_[i].desc); + for (int i = 0; i < n_flags_; ++i) { + Printf("%s%s\n%s%s- ", indentation, flags_[i].name, indentation, + indentation); + char *desc = internal_strdup(flags_[i].desc); + char *token = strtok_r(desc, "\n", &saveopts); + bool first_line = true; + while (token != NULL) { + if (inline_format) + Printf ("%s%s", first_line ? "" : " ", token); + else + Printf("%s%s\n", first_line ? "" : " ", token); + token = strtok_r(NULL, "\n", &saveopts); + first_line = false; + } + + if (inline_format) + Printf ("\n"); + } + +#ifdef _GNU_HELP_OUTPUT + ReportFile::SwapStdoutReportFile(); +#endif } void FlagParser::fatal_error(const char *err) { Index: compiler-rt/lib/sanitizer_common/sanitizer_flags.inc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_flags.inc +++ compiler-rt/lib/sanitizer_common/sanitizer_flags.inc @@ -22,42 +22,42 @@ COMMON_FLAG( bool, symbolize, true, - "If set, use the online symbolizer from common sanitizer runtime to turn " + "If set, use the online symbolizer from common sanitizer runtime to turn\n" "virtual addresses to file/line locations.") COMMON_FLAG( const char *, external_symbolizer_path, nullptr, - "Path to external symbolizer. If empty, the tool will search $PATH for " + "Path to external symbolizer. If empty, the tool will search $PATH for\n" "the symbolizer.") COMMON_FLAG( bool, allow_addr2line, false, - "If set, allows online symbolizer to run addr2line binary to symbolize " - "stack traces (addr2line will only be used if llvm-symbolizer binary is " + "If set, allows online symbolizer to run addr2line binary to symbolize\n" + "stack traces (addr2line will only be used if llvm-symbolizer binary is\n" "unavailable.") COMMON_FLAG(const char *, strip_path_prefix, "", "Strips this prefix from file paths in error reports.") COMMON_FLAG(bool, fast_unwind_on_check, false, - "If available, use the fast frame-pointer-based unwinder on " + "If available, use the fast frame-pointer-based unwinder on\n" "internal CHECK failures.") COMMON_FLAG(bool, fast_unwind_on_fatal, false, - "If available, use the fast frame-pointer-based unwinder on fatal " + "If available, use the fast frame-pointer-based unwinder on fatal\n" "errors.") COMMON_FLAG(bool, fast_unwind_on_malloc, true, - "If available, use the fast frame-pointer-based unwinder on " + "If available, use the fast frame-pointer-based unwinder on\n" "malloc/free.") COMMON_FLAG(bool, handle_ioctl, false, "Intercept and handle ioctl requests.") COMMON_FLAG(int, malloc_context_size, 1, "Max number of stack frames kept for each allocation/deallocation.") COMMON_FLAG( const char *, log_path, "stderr", - "Write logs to \"log_path.pid\". The special values are \"stdout\" and " + "Write logs to \"log_path.pid\". The special values are \"stdout\" and\n" "\"stderr\". The default is \"stderr\".") COMMON_FLAG( bool, log_exe_name, false, - "Mention name of executable when reporting error and " + "Mention name of executable when reporting error and\n" "append executable name to logs (as in \"log_path.exe_name.pid\").") COMMON_FLAG( bool, log_to_syslog, SANITIZER_ANDROID || SANITIZER_MAC, - "Write all sanitizer output to syslog in addition to other means of " + "Write all sanitizer output to syslog in addition to other means of\n" "logging.") COMMON_FLAG( int, verbosity, 0, @@ -65,14 +65,14 @@ COMMON_FLAG(bool, detect_leaks, true, "Enable memory leak detection.") COMMON_FLAG( bool, leak_check_at_exit, true, - "Invoke leak checking in an atexit handler. Has no effect if " - "detect_leaks=false, or if __lsan_do_leak_check() is called before the " + "Invoke leak checking in an atexit handler. Has no effect if\n" + "detect_leaks=false, or if __lsan_do_leak_check() is called before the\n" "handler has a chance to run.") COMMON_FLAG(bool, allocator_may_return_null, false, - "If false, the allocator will crash instead of returning 0 on " + "If false, the allocator will crash instead of returning 0 on\n" "out-of-memory.") COMMON_FLAG(bool, print_summary, true, - "If false, disable printing error summaries in addition to error " + "If false, disable printing error summaries in addition to error\n" "reports.") COMMON_FLAG(bool, check_printf, true, "Check printf arguments.") COMMON_FLAG(bool, handle_segv, SANITIZER_NEEDS_SEGV, @@ -84,7 +84,7 @@ COMMON_FLAG(bool, handle_sigfpe, true, "If set, registers the tool's custom SIGFPE handler.") COMMON_FLAG(bool, allow_user_segv_handler, false, - "If set, allows user to register a SEGV handler even if the tool " + "If set, allows user to register a SEGV handler even if the tool\n" "registers one.") COMMON_FLAG(bool, use_sigaltstack, true, "If set, uses alternate stack for signal handling.") @@ -92,7 +92,7 @@ "If set, deadlock detection is enabled.") COMMON_FLAG( uptr, clear_shadow_mmap_threshold, 64 * 1024, - "Large shadow regions are zero-filled using mmap(NORESERVE) instead of " + "Large shadow regions are zero-filled using mmap(NORESERVE) instead of\n" "memset(). This is the threshold size in bytes.") COMMON_FLAG(const char *, color, "auto", "Colorize reports: (always|never|auto).") @@ -102,117 +102,117 @@ COMMON_FLAG(bool, intercept_tls_get_addr, false, "Intercept __tls_get_addr.") COMMON_FLAG(bool, help, false, "Print the flag descriptions.") COMMON_FLAG(uptr, mmap_limit_mb, 0, - "Limit the amount of mmap-ed memory (excluding shadow) in Mb; " + "Limit the amount of mmap-ed memory (excluding shadow) in Mb;\n" "not a user-facing flag, used mosly for testing the tools") COMMON_FLAG(uptr, hard_rss_limit_mb, 0, - "Hard RSS limit in Mb." - " If non-zero, a background thread is spawned at startup" - " which periodically reads RSS and aborts the process if the" - " limit is reached") + "Hard RSS limit in Mb.\n" + "If non-zero, a background thread is spawned at startup\n" + "which periodically reads RSS and aborts the process if the\n" + "limit is reached") COMMON_FLAG(uptr, soft_rss_limit_mb, 0, - "Soft RSS limit in Mb." - " If non-zero, a background thread is spawned at startup" - " which periodically reads RSS. If the limit is reached" - " all subsequent malloc/new calls will fail or return NULL" - " (depending on the value of allocator_may_return_null)" - " until the RSS goes below the soft limit." - " This limit does not affect memory allocations other than" - " malloc/new.") + "Soft RSS limit in Mb.\n" + "If non-zero, a background thread is spawned at startup\n" + "which periodically reads RSS. If the limit is reached\n" + "all subsequent malloc/new calls will fail or return NULL\n" + "(depending on the value of allocator_may_return_null)\n" + "until the RSS goes below the soft limit.\n" + "This limit does not affect memory allocations other than\n" + "malloc/new.") COMMON_FLAG(bool, can_use_proc_maps_statm, true, - "If false, do not attempt to read /proc/maps/statm." - " Mostly useful for testing sanitizers.") + "If false, do not attempt to read /proc/maps/statm.\n" + "Mostly useful for testing sanitizers.") COMMON_FLAG( bool, coverage, false, - "If set, coverage information will be dumped at program shutdown (if the " + "If set, coverage information will be dumped at program shutdown (if the\n" "coverage instrumentation was enabled at compile time).") COMMON_FLAG(bool, coverage_pcs, true, - "If set (and if 'coverage' is set too), the coverage information " + "If set (and if 'coverage' is set too), the coverage information\n" "will be dumped as a set of PC offsets for every module.") COMMON_FLAG(bool, coverage_order_pcs, false, - "If true, the PCs will be dumped in the order they've" - " appeared during the execution.") + "If true, the PCs will be dumped in the order they've\n" + "appeared during the execution.") COMMON_FLAG(bool, coverage_bitset, false, - "If set (and if 'coverage' is set too), the coverage information " + "If set (and if 'coverage' is set too), the coverage information\n" "will also be dumped as a bitset to a separate file.") COMMON_FLAG(bool, coverage_counters, false, - "If set (and if 'coverage' is set too), the bitmap that corresponds" - " to coverage counters will be dumped.") + "If set (and if 'coverage' is set too), the bitmap that\n" + "corresponds to coverage counters will be dumped.") COMMON_FLAG(bool, coverage_direct, SANITIZER_ANDROID, - "If set, coverage information will be dumped directly to a memory " - "mapped file. This way data is not lost even if the process is " + "If set, coverage information will be dumped directly to a memory\n" + "mapped file. This way data is not lost even if the process is\n" "suddenly killed.") COMMON_FLAG(const char *, coverage_dir, ".", - "Target directory for coverage dumps. Defaults to the current " + "Target directory for coverage dumps. Defaults to the current\n" "directory.") COMMON_FLAG(bool, coverage_pc_buffer, true, - "If set (and if 'coverage' is set too), the pcs would be collected " + "If set (and if 'coverage' is set too), the pcs would be collected\n" "in a buffer.") COMMON_FLAG(bool, full_address_space, false, - "Sanitize complete address space; " + "Sanitize complete address space;\n" "by default kernel area on 32-bit platforms will not be sanitized") COMMON_FLAG(bool, print_suppressions, true, "Print matched suppressions at exit.") COMMON_FLAG( bool, disable_coredump, (SANITIZER_WORDSIZE == 64), - "Disable core dumping. By default, disable_core=1 on 64-bit to avoid " - "dumping a 16T+ core file. Ignored on OSes that don't dump core by" + "Disable core dumping. By default, disable_core=1 on 64-bit to avoid\n" + "dumping a 16T+ core file. Ignored on OSes that don't dump core by\n" "default and for sanitizers that don't reserve lots of virtual memory.") COMMON_FLAG(bool, use_madv_dontdump, true, - "If set, instructs kernel to not store the (huge) shadow " + "If set, instructs kernel to not store the (huge) shadow\n" "in core file.") COMMON_FLAG(bool, symbolize_inline_frames, true, "Print inlined frames in stacktraces. Defaults to true.") COMMON_FLAG(bool, symbolize_vs_style, false, - "Print file locations in Visual Studio style (e.g: " + "Print file locations in Visual Studio style (e.g:\n" " file(10,42): ...") COMMON_FLAG(const char *, stack_trace_format, "DEFAULT", - "Format string used to render stack frames. " - "See sanitizer_stacktrace_printer.h for the format description. " + "Format string used to render stack frames.\n" + "See sanitizer_stacktrace_printer.h for the format description.\n" "Use DEFAULT to get default format.") COMMON_FLAG(bool, no_huge_pages_for_shadow, true, "If true, the shadow is not allowed to use huge pages. ") COMMON_FLAG(bool, strict_string_checks, false, "If set check that string arguments are properly null-terminated") COMMON_FLAG(bool, intercept_strstr, true, - "If set, uses custom wrappers for strstr and strcasestr functions " + "If set, uses custom wrappers for strstr and strcasestr functions\n" "to find more errors.") COMMON_FLAG(bool, intercept_strspn, true, - "If set, uses custom wrappers for strspn and strcspn function " + "If set, uses custom wrappers for strspn and strcspn function\n" "to find more errors.") COMMON_FLAG(bool, intercept_strpbrk, true, - "If set, uses custom wrappers for strpbrk function " + "If set, uses custom wrappers for strpbrk function\n" "to find more errors.") COMMON_FLAG(bool, intercept_strlen, true, - "If set, uses custom wrappers for strlen and strnlen functions " + "If set, uses custom wrappers for strlen and strnlen functions\n" "to find more errors.") COMMON_FLAG(bool, intercept_strchr, true, - "If set, uses custom wrappers for strchr, strchrnul, and strrchr " + "If set, uses custom wrappers for strchr, strchrnul, and strrchr\n" "functions to find more errors.") COMMON_FLAG(bool, intercept_memcmp, true, - "If set, uses custom wrappers for memcmp function " + "If set, uses custom wrappers for memcmp function\n" "to find more errors.") COMMON_FLAG(bool, strict_memcmp, true, - "If true, assume that memcmp(p1, p2, n) always reads n bytes before " + "If true, assume that memcmp(p1, p2, n) always reads n bytes before\n" "comparing p1 and p2.") COMMON_FLAG(bool, intercept_intrin, true, - "If set, uses custom wrappers for memset/memcpy/memmove " + "If set, uses custom wrappers for memset/memcpy/memmove\n" "intrinsics to find more errors.") COMMON_FLAG(bool, intercept_stat, true, - "If set, uses custom wrappers for *stat functions " + "If set, uses custom wrappers for *stat functions\n" "to find more errors.") -COMMON_FLAG(bool, decorate_proc_maps, false, "If set, decorate sanitizer " - "mappings in /proc/self/maps with " +COMMON_FLAG(bool, decorate_proc_maps, false, "If set, decorate sanitizer\n" + "mappings in /proc/self/maps with\n" "user-readable names") -COMMON_FLAG(int, exitcode, 1, "Override the program exit status if the tool " +COMMON_FLAG(int, exitcode, 1, "Override the program exit status if the tool\n" "found an error") COMMON_FLAG( bool, abort_on_error, SANITIZER_MAC, - "If set, the tool calls abort() instead of _exit() after printing the " + "If set, the tool calls abort() instead of _exit() after printing the\n" "error report.") COMMON_FLAG(bool, suppress_equal_pcs, true, - "Deduplicate multiple reports for single source location in " + "Deduplicate multiple reports for single source location in\n" "halt_on_error=false mode (asan only).") -COMMON_FLAG(bool, print_cmdline, false, "Print command line on crash " +COMMON_FLAG(bool, print_cmdline, false, "Print command line on crash\n" "(asan only).") COMMON_FLAG(bool, html_cov_report, false, "Generate html coverage report.") COMMON_FLAG(const char *, sancov_path, "sancov", "Sancov tool location.") Index: compiler-rt/lib/tsan/rtl/tsan_flags.inc =================================================================== --- compiler-rt/lib/tsan/rtl/tsan_flags.inc +++ compiler-rt/lib/tsan/rtl/tsan_flags.inc @@ -22,10 +22,10 @@ // Suppress a race report if we've already output another race report // with the same stack. TSAN_FLAG(bool, suppress_equal_stacks, true, - "Suppress a race report if we've already output another race report " + "Suppress a race report if we've already output another race report\n" "with the same stack.") TSAN_FLAG(bool, suppress_equal_addresses, true, - "Suppress a race report if we've already output another race report " + "Suppress a race report if we've already output another race report\n" "on the same address.") TSAN_FLAG(bool, report_bugs, true, @@ -36,18 +36,18 @@ TSAN_FLAG(bool, report_mutex_bugs, true, "Report incorrect usages of mutexes and mutex annotations?") TSAN_FLAG(bool, report_signal_unsafe, true, - "Report violations of async signal-safety " + "Report violations of async signal-safety\n" "(e.g. malloc() call from a signal handler).") TSAN_FLAG(bool, report_atomic_races, true, "Report races between atomic and plain memory accesses.") TSAN_FLAG( bool, force_seq_cst_atomics, false, - "If set, all atomics are effectively sequentially consistent (seq_cst), " + "If set, all atomics are effectively sequentially consistent (seq_cst),\n" "regardless of what user actually specified.") TSAN_FLAG(bool, print_benign, false, "Print matched \"benign\" races at exit.") TSAN_FLAG(bool, halt_on_error, false, "Exit after first reported error.") TSAN_FLAG(int, atexit_sleep_ms, 1000, - "Sleep in main thread before exiting for that many ms " + "Sleep in main thread before exiting for that many ms\n" "(useful to catch \"at exit\" races).") TSAN_FLAG(const char *, profile_memory, "", "If set, periodically write memory profile to that file.") @@ -55,23 +55,24 @@ TSAN_FLAG(int, flush_symbolizer_ms, 5000, "Flush symbolizer caches every X ms.") TSAN_FLAG( int, memory_limit_mb, 0, - "Resident memory limit in MB to aim at." - "If the process consumes more memory, then TSan will flush shadow memory.") + "Resident memory limit in MB to aim at.\n" + "If the process consumes more memory,\n" + "then TSan will flush shadow memory.") TSAN_FLAG(bool, stop_on_start, false, "Stops on start until __tsan_resume() is called (for debugging).") TSAN_FLAG(bool, running_on_valgrind, false, "Controls whether RunningOnValgrind() returns true or false.") TSAN_FLAG( int, history_size, kGoMode ? 1 : 3, // There are a lot of goroutines in Go. - "Per-thread history size, controls how many previous memory accesses " - "are remembered per thread. Possible values are [0..7]. " - "history_size=0 amounts to 32K memory accesses. Each next value doubles " - "the amount of memory accesses, up to history_size=7 that amounts to " + "Per-thread history size, controls how many previous memory accesses\n" + "are remembered per thread. Possible values are [0..7].\n" + "history_size=0 amounts to 32K memory accesses. Each next value doubles\n" + "the amount of memory accesses, up to history_size=7 that amounts to\n" "4M memory accesses. The default value is 2 (128K memory accesses).") TSAN_FLAG(int, io_sync, 1, - "Controls level of synchronization implied by IO operations. " - "0 - no synchronization " - "1 - reasonable level of synchronization (write->read)" + "Controls level of synchronization implied by IO operations.\n" + "0 - no synchronization\n" + "1 - reasonable level of synchronization (write->read)\n" "2 - global synchronization of all IO operations.") TSAN_FLAG(bool, die_after_fork, true, "Die after multi-threaded fork if the child creates new threads.")