Date: Wed, 20 Dec 2017 19:12:15 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r327033 - in projects/clang600-import/contrib/compiler-rt: include/sanitizer include/xray lib/BlocksRuntime lib/asan lib/builtins lib/builtins/arm lib/cfi lib/dfsan lib/esan lib/hwasan ... Message-ID: <201712201912.vBKJCFMD084901@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Wed Dec 20 19:12:15 2017 New Revision: 327033 URL: https://svnweb.freebsd.org/changeset/base/327033 Log: Merge compiler-rt trunk r321017 to contrib/compiler-rt. Added: projects/clang600-import/contrib/compiler-rt/include/sanitizer/hwasan_interface.h - copied unchanged from r327030, vendor/compiler-rt/dist/include/sanitizer/hwasan_interface.h projects/clang600-import/contrib/compiler-rt/include/sanitizer/scudo_interface.h - copied unchanged from r327030, vendor/compiler-rt/dist/include/sanitizer/scudo_interface.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_fuchsia.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/asan/asan_fuchsia.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/asan/asan_interceptors_memintrinsics.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/asan/asan_interceptors_memintrinsics.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_premap_shadow.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/asan/asan_premap_shadow.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_premap_shadow.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/asan/asan_premap_shadow.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_shadow_setup.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/asan/asan_shadow_setup.cc projects/clang600-import/contrib/compiler-rt/lib/hwasan/ - copied from r327030, vendor/compiler-rt/dist/lib/hwasan/ projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_checks.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_file.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_file.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_file.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_file.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_fuchsia.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_fuchsia.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_getauxval.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_solaris.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_solaris.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps_solaris.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_signal_interceptors.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_solaris.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_fuchsia.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_fuchsia.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_arm.inc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_syscall_linux_arm.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_vector.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_vector.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_interface_internal.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/scudo/scudo_interface_internal.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_platform.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/scudo/scudo_platform.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/scudo/scudo_tsd.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_exclusive.cpp - copied unchanged from r327030, vendor/compiler-rt/dist/lib/scudo/scudo_tsd_exclusive.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_exclusive.inc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/scudo/scudo_tsd_exclusive.inc projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_shared.cpp - copied unchanged from r327030, vendor/compiler-rt/dist/lib/scudo/scudo_tsd_shared.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tsd_shared.inc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/scudo/scudo_tsd_shared.inc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_signals_standalone.cc - copied unchanged from r327030, vendor/compiler-rt/dist/lib/ubsan/ubsan_signals_standalone.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_signals_standalone.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/ubsan/ubsan_signals_standalone.h projects/clang600-import/contrib/compiler-rt/lib/ubsan_minimal/ - copied from r327030, vendor/compiler-rt/dist/lib/ubsan_minimal/ projects/clang600-import/contrib/compiler-rt/lib/xray/weak_symbols.txt - copied unchanged from r327030, vendor/compiler-rt/dist/lib/xray/weak_symbols.txt projects/clang600-import/contrib/compiler-rt/lib/xray/xray_inmemory_log.h - copied unchanged from r327030, vendor/compiler-rt/dist/lib/xray/xray_inmemory_log.h Deleted: projects/clang600-import/contrib/compiler-rt/lib/hwasan/.clang-format projects/clang600-import/contrib/compiler-rt/lib/hwasan/CMakeLists.txt projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tls.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tls_android.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tls_android.inc projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tls_context_android.inc projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tls_context_linux.inc projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tls_linux.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_tls_linux.inc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_vector.h projects/clang600-import/contrib/compiler-rt/lib/ubsan_minimal/CMakeLists.txt Modified: projects/clang600-import/contrib/compiler-rt/include/sanitizer/allocator_interface.h projects/clang600-import/contrib/compiler-rt/include/sanitizer/asan_interface.h projects/clang600-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h projects/clang600-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h projects/clang600-import/contrib/compiler-rt/include/sanitizer/tsan_interface.h projects/clang600-import/contrib/compiler-rt/include/xray/xray_interface.h projects/clang600-import/contrib/compiler-rt/include/xray/xray_log_interface.h projects/clang600-import/contrib/compiler-rt/include/xray/xray_records.h projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block.h projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_activation.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_errors.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_errors.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_fake_stack.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_flags.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_flags.inc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_globals.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_init_version.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_interceptors.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_internal.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_linux.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_malloc_linux.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_mapping.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_memory_profile.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_new_delete.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_poisoning.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_poisoning.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_posix.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_report.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_report.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_rtl.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_scariness_score.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_stack.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_thread.cc projects/clang600-import/contrib/compiler-rt/lib/asan/asan_thread.h projects/clang600-import/contrib/compiler-rt/lib/asan/asan_win.cc projects/clang600-import/contrib/compiler-rt/lib/builtins/adddf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/addsf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_memcmp.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_memcpy.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_memmove.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_memset.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/bswapdi2.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/bswapsi2.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/clzdi2.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/clzsi2.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/comparesf2.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/divmodsi4.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/divsi3.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/modsi3.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/udivmodsi4.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/udivsi3.S projects/clang600-import/contrib/compiler-rt/lib/builtins/arm/umodsi3.S projects/clang600-import/contrib/compiler-rt/lib/builtins/ashldi3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/ashrdi3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/assembly.h projects/clang600-import/contrib/compiler-rt/lib/builtins/clear_cache.c projects/clang600-import/contrib/compiler-rt/lib/builtins/comparedf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/comparesf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/cpu_model.c projects/clang600-import/contrib/compiler-rt/lib/builtins/divdf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/divsf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/divsi3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/emutls.c projects/clang600-import/contrib/compiler-rt/lib/builtins/enable_execute_stack.c projects/clang600-import/contrib/compiler-rt/lib/builtins/extendhfsf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/extendsfdf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixdfdi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixdfsi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixsfdi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixsfsi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixunsdfdi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixunsdfsi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixunssfdi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/fixunssfsi.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatdidf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatdisf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatsidf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatsisf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatundidf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatundisf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatunsidf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/floatunsisf.c projects/clang600-import/contrib/compiler-rt/lib/builtins/int_endianness.h projects/clang600-import/contrib/compiler-rt/lib/builtins/int_lib.h projects/clang600-import/contrib/compiler-rt/lib/builtins/lshrdi3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/muldf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/muldi3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/mulsf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/negdf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/negsf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/subdf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/subsf3.c projects/clang600-import/contrib/compiler-rt/lib/builtins/truncdfhf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/truncdfsf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/truncsfhf2.c projects/clang600-import/contrib/compiler-rt/lib/builtins/udivsi3.c projects/clang600-import/contrib/compiler-rt/lib/cfi/cfi.cc projects/clang600-import/contrib/compiler-rt/lib/cfi/cfi_blacklist.txt projects/clang600-import/contrib/compiler-rt/lib/dfsan/dfsan.cc projects/clang600-import/contrib/compiler-rt/lib/esan/esan_sideline.h projects/clang600-import/contrib/compiler-rt/lib/esan/esan_sideline_linux.cpp projects/clang600-import/contrib/compiler-rt/lib/esan/working_set_posix.cpp projects/clang600-import/contrib/compiler-rt/lib/interception/interception.h projects/clang600-import/contrib/compiler-rt/lib/interception/interception_linux.cc projects/clang600-import/contrib/compiler-rt/lib/interception/interception_linux.h projects/clang600-import/contrib/compiler-rt/lib/interception/interception_mac.cc projects/clang600-import/contrib/compiler-rt/lib/interception/interception_mac.h projects/clang600-import/contrib/compiler-rt/lib/interception/interception_type_test.cc projects/clang600-import/contrib/compiler-rt/lib/interception/interception_win.cc projects/clang600-import/contrib/compiler-rt/lib/interception/interception_win.h projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan.cc projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan.h projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan_allocator.h projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan_common.cc projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan_common.h projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan_common_linux.cc projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan_common_mac.cc projects/clang600-import/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc projects/clang600-import/contrib/compiler-rt/lib/lsan/weak_symbols.txt projects/clang600-import/contrib/compiler-rt/lib/msan/msan.cc projects/clang600-import/contrib/compiler-rt/lib/msan/msan.h projects/clang600-import/contrib/compiler-rt/lib/msan/msan_allocator.cc projects/clang600-import/contrib/compiler-rt/lib/msan/msan_interceptors.cc projects/clang600-import/contrib/compiler-rt/lib/msan/msan_linux.cc projects/clang600-import/contrib/compiler-rt/lib/msan/msan_report.cc projects/clang600-import/contrib/compiler-rt/lib/profile/GCDAProfiling.c projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfData.inc projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfiling.c projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingFile.c projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingInternal.h projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingPlatformOther.c projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingPort.h projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingUtil.c projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingUtil.h projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingValue.c projects/clang600-import/contrib/compiler-rt/lib/profile/InstrProfilingWriter.c projects/clang600-import/contrib/compiler-rt/lib/profile/WindowsMMap.c projects/clang600-import/contrib/compiler-rt/lib/safestack/safestack.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_size_class_map.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_asm.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_bitvector.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_bvgraph.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_interface.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_errno.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mutex.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_freebsd.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_linux.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_quarantine.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_weak_interception.cc projects/clang600-import/contrib/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_allocator.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_allocator.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_allocator_combined.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_allocator_secondary.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_crc32.h projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_flags.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_flags.inc projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_new_delete.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_utils.cpp projects/clang600-import/contrib/compiler-rt/lib/scudo/scudo_utils.h projects/clang600-import/contrib/compiler-rt/lib/stats/stats.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_fd.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.h projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_mman.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_mman.h projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_report.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_report.h projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.h projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.h projects/clang600-import/contrib/compiler-rt/lib/tsan/rtl/tsan_trace.h projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_checks.inc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_diag.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_diag.h projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_diag_standalone.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_flags.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers.h projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_init.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_init_standalone.cc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_interface.inc projects/clang600-import/contrib/compiler-rt/lib/ubsan/ubsan_platform.h projects/clang600-import/contrib/compiler-rt/lib/xray/xray_buffer_queue.cc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_buffer_queue.h projects/clang600-import/contrib/compiler-rt/lib/xray/xray_fdr_log_records.h projects/clang600-import/contrib/compiler-rt/lib/xray/xray_fdr_logging.cc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_fdr_logging.h projects/clang600-import/contrib/compiler-rt/lib/xray/xray_fdr_logging_impl.h projects/clang600-import/contrib/compiler-rt/lib/xray/xray_flags.h projects/clang600-import/contrib/compiler-rt/lib/xray/xray_flags.inc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_init.cc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_inmemory_log.cc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_interface.cc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_interface_internal.h projects/clang600-import/contrib/compiler-rt/lib/xray/xray_log_interface.cc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_trampoline_x86_64.S projects/clang600-import/contrib/compiler-rt/lib/xray/xray_utils.cc projects/clang600-import/contrib/compiler-rt/lib/xray/xray_x86_64.cc Directory Properties: projects/clang600-import/contrib/compiler-rt/ (props changed) Modified: projects/clang600-import/contrib/compiler-rt/include/sanitizer/allocator_interface.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/sanitizer/allocator_interface.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/sanitizer/allocator_interface.h Wed Dec 20 19:12:15 2017 (r327033) @@ -76,6 +76,13 @@ extern "C" { void (*malloc_hook)(const volatile void *, size_t), void (*free_hook)(const volatile void *)); + /* Drains allocator quarantines (calling thread's and global ones), returns + freed memory back to OS and releases other non-essential internal allocator + resources in attempt to reduce process RSS. + Currently available with ASan only. + */ + void __sanitizer_purge_allocator(); + #ifdef __cplusplus } // extern "C" #endif Modified: projects/clang600-import/contrib/compiler-rt/include/sanitizer/asan_interface.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/sanitizer/asan_interface.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/sanitizer/asan_interface.h Wed Dec 20 19:12:15 2017 (r327033) @@ -144,6 +144,10 @@ extern "C" { void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg, void **end); + // Performs cleanup before a [[noreturn]] function. Must be called + // before things like _exit and execl to avoid false positives on stack. + void __asan_handle_no_return(void); + #ifdef __cplusplus } // extern "C" #endif Modified: projects/clang600-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h Wed Dec 20 19:12:15 2017 (r327033) @@ -22,8 +22,11 @@ extern "C" { // Record and dump coverage info. void __sanitizer_cov_dump(); - // Dump collected coverage info. Sorts pcs by module into individual - // .sancov files. + // Clear collected coverage info. + void __sanitizer_cov_reset(); + + // Dump collected coverage info. Sorts pcs by module into individual .sancov + // files. void __sanitizer_dump_coverage(const uintptr_t *pcs, uintptr_t len); #ifdef __cplusplus Copied: projects/clang600-import/contrib/compiler-rt/include/sanitizer/hwasan_interface.h (from r327030, vendor/compiler-rt/dist/include/sanitizer/hwasan_interface.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang600-import/contrib/compiler-rt/include/sanitizer/hwasan_interface.h Wed Dec 20 19:12:15 2017 (r327033, copy of r327030, vendor/compiler-rt/dist/include/sanitizer/hwasan_interface.h) @@ -0,0 +1,33 @@ +//===-- sanitizer/asan_interface.h ------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of HWAddressSanitizer. +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_HWASAN_INTERFACE_H +#define SANITIZER_HWASAN_INTERFACE_H + +#include <sanitizer/common_interface_defs.h> + +#ifdef __cplusplus +extern "C" { +#endif + // This function may be optionally provided by user and should return + // a string containing HWASan runtime options. See asan_flags.h for details. + const char* __hwasan_default_options(); + + void __hwasan_enable_allocator_tagging(); + void __hwasan_disable_allocator_tagging(); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_HWASAN_INTERFACE_H Modified: projects/clang600-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h Wed Dec 20 19:12:15 2017 (r327033) @@ -64,7 +64,13 @@ extern "C" { // for the program it is linked into (if the return value is non-zero). This // function must be defined as returning a constant value; any behavior beyond // that is unsupported. + // To avoid dead stripping, you may need to define this function with + // __attribute__((used)) int __lsan_is_turned_off(); + + // This function may be optionally provided by user and should return + // a string containing LSan runtime options. See lsan_flags.inc for details. + const char *__lsan_default_options(); // This function may be optionally provided by the user and should return // a string containing LSan suppressions. Copied: projects/clang600-import/contrib/compiler-rt/include/sanitizer/scudo_interface.h (from r327030, vendor/compiler-rt/dist/include/sanitizer/scudo_interface.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang600-import/contrib/compiler-rt/include/sanitizer/scudo_interface.h Wed Dec 20 19:12:15 2017 (r327033, copy of r327030, vendor/compiler-rt/dist/include/sanitizer/scudo_interface.h) @@ -0,0 +1,34 @@ +//===-- sanitizer/scudo_interface.h -----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +/// Public Scudo interface header. +// +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_SCUDO_INTERFACE_H_ +#define SANITIZER_SCUDO_INTERFACE_H_ + +#include <sanitizer/common_interface_defs.h> + +#ifdef __cplusplus +extern "C" { +#endif + // This function may be optionally provided by a user and should return + // a string containing Scudo runtime options. See scudo_flags.h for details. + const char* __scudo_default_options(); + + // This function allows to set the RSS limit at runtime. This can be either + // the hard limit (HardLimit=1) or the soft limit (HardLimit=0). The limit + // can be removed by setting LimitMb to 0. This function's parameters should + // be fully trusted to avoid security mishaps. + void __scudo_set_rss_limit(unsigned long LimitMb, int HardLimit); +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_SCUDO_INTERFACE_H_ Modified: projects/clang600-import/contrib/compiler-rt/include/sanitizer/tsan_interface.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/sanitizer/tsan_interface.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/sanitizer/tsan_interface.h Wed Dec 20 19:12:15 2017 (r327033) @@ -44,6 +44,11 @@ const unsigned __tsan_mutex_linker_init = 1 << 0; const unsigned __tsan_mutex_write_reentrant = 1 << 1; // Mutex is read reentrant. const unsigned __tsan_mutex_read_reentrant = 1 << 2; +// Mutex does not have static storage duration, and must not be used after +// its destructor runs. The opposite of __tsan_mutex_linker_init. +// If this flag is passed to __tsan_mutex_destroy, then the destruction +// is ignored unless this flag was previously set on the mutex. +const unsigned __tsan_mutex_not_static = 1 << 8; // Mutex operation flags: @@ -70,6 +75,7 @@ void __tsan_mutex_create(void *addr, unsigned flags); // Annotate destruction of a mutex. // Supported flags: // - __tsan_mutex_linker_init +// - __tsan_mutex_not_static void __tsan_mutex_destroy(void *addr, unsigned flags); // Annotate start of lock operation. Modified: projects/clang600-import/contrib/compiler-rt/include/xray/xray_interface.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/xray/xray_interface.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/xray/xray_interface.h Wed Dec 20 19:12:15 2017 (r327033) @@ -106,6 +106,14 @@ extern uintptr_t __xray_function_address(int32_t FuncI /// encounter errors (when there are no instrumented functions, etc.). extern size_t __xray_max_function_id(); +/// Initialize the required XRay data structures. This is useful in cases where +/// users want to control precisely when the XRay instrumentation data +/// structures are initialized, for example when the XRay library is built with +/// the XRAY_NO_PREINIT preprocessor definition. +/// +/// Calling __xray_init() more than once is safe across multiple threads. +extern void __xray_init(); + } // end extern "C" #endif // XRAY_XRAY_INTERFACE_H Modified: projects/clang600-import/contrib/compiler-rt/include/xray/xray_log_interface.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/xray/xray_log_interface.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/xray/xray_log_interface.h Wed Dec 20 19:12:15 2017 (r327033) @@ -128,6 +128,16 @@ enum XRayLogFlushStatus { XRAY_LOG_FLUSHED = 2, }; +/// This enum indicates the installation state of a logging implementation, when +/// associating a mode to a particular logging implementation through +/// `__xray_log_register_impl(...)` or through `__xray_log_select_mode(...`. +enum XRayLogRegisterStatus { + XRAY_REGISTRATION_OK = 0, + XRAY_DUPLICATE_MODE = 1, + XRAY_MODE_NOT_FOUND = 2, + XRAY_INCOMPLETE_IMPL = 3, +}; + /// A valid XRay logging implementation MUST provide all of the function /// pointers in XRayLogImpl when being installed through `__xray_set_log_impl`. /// To be precise, ALL the functions pointers MUST NOT be nullptr. @@ -159,6 +169,9 @@ struct XRayLogImpl { /// always have a handler for function entry and exit events. In case the /// implementation wants to support arg1 (or other future extensions to XRay /// logging) those MUST be installed by the installed 'log_init' handler. + /// + /// Because we didn't want to change the ABI of this struct, the arg1 handler + /// may be silently overwritten during initialization as well. void (*handle_arg0)(int32_t, XRayEntryType); /// The log implementation provided routine for when __xray_log_flushLog() is @@ -186,6 +199,34 @@ struct XRayLogImpl { /// called while in any other states. void __xray_set_log_impl(XRayLogImpl Impl); +/// This function registers a logging implementation against a "mode" +/// identifier. This allows multiple modes to be registered, and chosen at +/// runtime using the same mode identifier through +/// `__xray_log_select_mode(...)`. +/// +/// We treat the Mode identifier as a null-terminated byte string, as the +/// identifier used when retrieving the log impl. +/// +/// Returns: +/// - XRAY_REGISTRATION_OK on success. +/// - XRAY_DUPLICATE_MODE when an implementation is already associated with +/// the provided Mode; does not update the already-registered +/// implementation. +XRayLogRegisterStatus __xray_log_register_mode(const char *Mode, + XRayLogImpl Impl); + +/// This function selects the implementation associated with Mode that has been +/// registered through __xray_log_register_mode(...) and installs that +/// implementation (as if through calling __xray_set_log_impl(...)). The same +/// caveats apply to __xray_log_select_mode(...) as with +/// __xray_log_set_log_impl(...). +/// +/// Returns: +/// - XRAY_REGISTRATION_OK on success. +/// - XRAY_MODE_NOT_FOUND if there is no implementation associated with Mode; +/// does not update the currently installed implementation. +XRayLogRegisterStatus __xray_log_select_mode(const char *Mode); + /// This function removes the currently installed implementation. It will also /// uninstall any handlers that have been previously installed. It does NOT /// unpatch the instrumentation sleds. @@ -220,10 +261,17 @@ XRayLogFlushStatus __xray_log_flushLog(); namespace __xray { -// Options used by the LLVM XRay FDR implementation. +/// Options used by the LLVM XRay FDR logging implementation. struct FDRLoggingOptions { bool ReportErrors = false; int Fd = -1; +}; + +/// Options used by the LLVM XRay Basic (Naive) logging implementation. +struct BasicLoggingOptions { + int DurationFilterMicros = 0; + size_t MaxStackDepth = 0; + size_t ThreadBufferSize = 0; }; } // namespace __xray Modified: projects/clang600-import/contrib/compiler-rt/include/xray/xray_records.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/include/xray/xray_records.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/include/xray/xray_records.h Wed Dec 20 19:12:15 2017 (r327033) @@ -17,6 +17,8 @@ #ifndef XRAY_XRAY_RECORDS_H #define XRAY_XRAY_RECORDS_H +#include <cstdint> + namespace __xray { enum FileTypes { @@ -65,18 +67,23 @@ static_assert(sizeof(XRayFileHeader) == 32, "XRayFileH enum RecordTypes { NORMAL = 0, + ARG_PAYLOAD = 1, }; struct alignas(32) XRayRecord { // This is the type of the record being written. We use 16 bits to allow us to // treat this as a discriminant, and so that the first 4 bytes get packed // properly. See RecordTypes for more supported types. - uint16_t RecordType = 0; + uint16_t RecordType = RecordTypes::NORMAL; // The CPU where the thread is running. We assume number of CPUs <= 256. uint8_t CPU = 0; - // The type of the event. Usually either ENTER = 0 or EXIT = 1. + // The type of the event. One of the following: + // ENTER = 0 + // EXIT = 1 + // TAIL_EXIT = 2 + // ENTER_ARG = 3 uint8_t Type = 0; // The function ID for the record. @@ -93,6 +100,32 @@ struct alignas(32) XRayRecord { } __attribute__((packed)); static_assert(sizeof(XRayRecord) == 32, "XRayRecord != 32 bytes"); + +struct alignas(32) XRayArgPayload { + // We use the same 16 bits as a discriminant for the records in the log here + // too, and so that the first 4 bytes are packed properly. + uint16_t RecordType = RecordTypes::ARG_PAYLOAD; + + // Add a few bytes to pad. + uint8_t Padding[2] = {}; + + // The function ID for the record. + int32_t FuncId = 0; + + // The thread ID for the currently running thread. + uint32_t TId = 0; + + // Add more padding. + uint8_t Padding2[4] = {}; + + // The argument payload. + uint64_t Arg = 0; + + // The rest of this record ought to be left as padding. + uint8_t TailPadding[8] = {}; +} __attribute__((packed)); + +static_assert(sizeof(XRayArgPayload) == 32, "XRayArgPayload != 32 bytes"); } // namespace __xray Modified: projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block.h Wed Dec 20 19:12:15 2017 (r327033) @@ -27,7 +27,7 @@ #if !defined(BLOCK_EXPORT) # if defined(__cplusplus) -# define BLOCK_EXPORT extern "C" +# define BLOCK_EXPORT extern "C" # else # define BLOCK_EXPORT extern # endif Modified: projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/BlocksRuntime/Block_private.h Wed Dec 20 19:12:15 2017 (r327033) @@ -27,7 +27,7 @@ #if !defined(BLOCK_EXPORT) # if defined(__cplusplus) -# define BLOCK_EXPORT extern "C" +# define BLOCK_EXPORT extern "C" # else # define BLOCK_EXPORT extern # endif Modified: projects/clang600-import/contrib/compiler-rt/lib/asan/asan_activation.cc ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/asan/asan_activation.cc Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/asan/asan_activation.cc Wed Dec 20 19:12:15 2017 (r327033) @@ -16,8 +16,10 @@ #include "asan_allocator.h" #include "asan_flags.h" #include "asan_internal.h" +#include "asan_mapping.h" #include "asan_poisoning.h" #include "asan_stack.h" +#include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_flags.h" namespace __asan { @@ -110,8 +112,9 @@ void AsanDeactivate() { AllocatorOptions disabled = asan_deactivated_flags.allocator_options; disabled.quarantine_size_mb = 0; disabled.thread_local_quarantine_size_kb = 0; - disabled.min_redzone = 16; // Redzone must be at least 16 bytes long. - disabled.max_redzone = 16; + // Redzone must be at least Max(16, granularity) bytes long. + disabled.min_redzone = Max(16, (int)SHADOW_GRANULARITY); + disabled.max_redzone = disabled.min_redzone; disabled.alloc_dealloc_mismatch = false; disabled.may_return_null = true; ReInitializeAllocator(disabled); Modified: projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.cc ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.cc Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.cc Wed Dec 20 19:12:15 2017 (r327033) @@ -84,7 +84,10 @@ struct ChunkHeader { // This field is used for small sizes. For large sizes it is equal to // SizeClassMap::kMaxSize and the actual size is stored in the // SecondaryAllocator's metadata. - u32 user_requested_size; + u32 user_requested_size : 29; + // align < 8 -> 0 + // else -> log2(min(align, 512)) - 2 + u32 user_requested_alignment_log : 3; u32 alloc_context_id; }; @@ -271,9 +274,9 @@ struct Allocator { atomic_store(&max_redzone, options.max_redzone, memory_order_release); } - void Initialize(const AllocatorOptions &options) { + void InitLinkerInitialized(const AllocatorOptions &options) { SetAllocatorMayReturnNull(options.may_return_null); - allocator.Init(options.release_to_os_interval_ms); + allocator.InitLinkerInitialized(options.release_to_os_interval_ms); SharedInitCode(options); } @@ -351,6 +354,20 @@ struct Allocator { return Min(Max(rz_log, RZSize2Log(min_rz)), RZSize2Log(max_rz)); } + static uptr ComputeUserRequestedAlignmentLog(uptr user_requested_alignment) { + if (user_requested_alignment < 8) + return 0; + if (user_requested_alignment > 512) + user_requested_alignment = 512; + return Log2(user_requested_alignment) - 2; + } + + static uptr ComputeUserAlignment(uptr user_requested_alignment_log) { + if (user_requested_alignment_log == 0) + return 0; + return 1LL << (user_requested_alignment_log + 2); + } + // We have an address between two chunks, and we want to report just one. AsanChunk *ChooseChunk(uptr addr, AsanChunk *left_chunk, AsanChunk *right_chunk) { @@ -385,6 +402,8 @@ struct Allocator { Flags &fl = *flags(); CHECK(stack); const uptr min_alignment = SHADOW_GRANULARITY; + const uptr user_requested_alignment_log = + ComputeUserRequestedAlignmentLog(alignment); if (alignment < min_alignment) alignment = min_alignment; if (size == 0) { @@ -472,6 +491,7 @@ struct Allocator { meta[0] = size; meta[1] = chunk_beg; } + m->user_requested_alignment_log = user_requested_alignment_log; m->alloc_context_id = StackDepotPut(*stack); @@ -573,8 +593,8 @@ struct Allocator { } } - void Deallocate(void *ptr, uptr delete_size, BufferedStackTrace *stack, - AllocType alloc_type) { + void Deallocate(void *ptr, uptr delete_size, uptr delete_alignment, + BufferedStackTrace *stack, AllocType alloc_type) { uptr p = reinterpret_cast<uptr>(ptr); if (p == 0) return; @@ -601,13 +621,16 @@ struct Allocator { ReportAllocTypeMismatch((uptr)ptr, stack, (AllocType)m->alloc_type, (AllocType)alloc_type); } + } else { + if (flags()->new_delete_type_mismatch && + (alloc_type == FROM_NEW || alloc_type == FROM_NEW_BR) && + ((delete_size && delete_size != m->UsedSize()) || + ComputeUserRequestedAlignmentLog(delete_alignment) != + m->user_requested_alignment_log)) { + ReportNewDeleteTypeMismatch(p, delete_size, delete_alignment, stack); + } } - if (delete_size && flags()->new_delete_type_mismatch && - delete_size != m->UsedSize()) { - ReportNewDeleteSizeMismatch(p, delete_size, stack); - } - QuarantineChunk(m, ptr, stack); } @@ -631,7 +654,7 @@ struct Allocator { // If realloc() races with free(), we may start copying freed memory. // However, we will report racy double-free later anyway. REAL(memcpy)(new_ptr, old_ptr, memcpy_size); - Deallocate(old_ptr, 0, stack, FROM_MALLOC); + Deallocate(old_ptr, 0, 0, stack, FROM_MALLOC); } return new_ptr; } @@ -716,6 +739,22 @@ struct Allocator { return AsanChunkView(m1); } + void Purge() { + AsanThread *t = GetCurrentThread(); + if (t) { + AsanThreadLocalMallocStorage *ms = &t->malloc_storage(); + quarantine.DrainAndRecycle(GetQuarantineCache(ms), + QuarantineCallback(GetAllocatorCache(ms))); + } + { + SpinMutexLock l(&fallback_mutex); + quarantine.DrainAndRecycle(&fallback_quarantine_cache, + QuarantineCallback(&fallback_allocator_cache)); + } + + allocator.ForceReleaseToOS(); + } + void PrintStats() { allocator.PrintStats(); quarantine.PrintStats(); @@ -750,6 +789,9 @@ bool AsanChunkView::IsQuarantined() const { uptr AsanChunkView::Beg() const { return chunk_->Beg(); } uptr AsanChunkView::End() const { return Beg() + UsedSize(); } uptr AsanChunkView::UsedSize() const { return chunk_->UsedSize(); } +u32 AsanChunkView::UserRequestedAlignment() const { + return Allocator::ComputeUserAlignment(chunk_->user_requested_alignment_log); +} uptr AsanChunkView::AllocTid() const { return chunk_->alloc_tid; } uptr AsanChunkView::FreeTid() const { return chunk_->free_tid; } AllocType AsanChunkView::GetAllocType() const { @@ -775,7 +817,7 @@ StackTrace AsanChunkView::GetFreeStack() const { } void InitializeAllocator(const AllocatorOptions &options) { - instance.Initialize(options); + instance.InitLinkerInitialized(options); } void ReInitializeAllocator(const AllocatorOptions &options) { @@ -802,12 +844,12 @@ void PrintInternalAllocatorStats() { } void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type) { - instance.Deallocate(ptr, 0, stack, alloc_type); + instance.Deallocate(ptr, 0, 0, stack, alloc_type); } -void asan_sized_free(void *ptr, uptr size, BufferedStackTrace *stack, - AllocType alloc_type) { - instance.Deallocate(ptr, size, stack, alloc_type); +void asan_delete(void *ptr, uptr size, uptr alignment, + BufferedStackTrace *stack, AllocType alloc_type) { + instance.Deallocate(ptr, size, alignment, stack, alloc_type); } void *asan_malloc(uptr size, BufferedStackTrace *stack) { @@ -823,7 +865,7 @@ void *asan_realloc(void *p, uptr size, BufferedStackTr return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true)); if (size == 0) { if (flags()->allocator_frees_and_returns_null_on_realloc_zero) { - instance.Deallocate(p, 0, stack, FROM_MALLOC); + instance.Deallocate(p, 0, 0, stack, FROM_MALLOC); return nullptr; } // Allocate a size of 1 if we shouldn't free() on Realloc to 0 @@ -839,6 +881,10 @@ void *asan_valloc(uptr size, BufferedStackTrace *stack void *asan_pvalloc(uptr size, BufferedStackTrace *stack) { uptr PageSize = GetPageSizeCached(); + if (UNLIKELY(CheckForPvallocOverflow(size, PageSize))) { + errno = errno_ENOMEM; + return AsanAllocator::FailureHandler::OnBadRequest(); + } // pvalloc(0) should allocate one page. size = size ? RoundUpTo(size, PageSize) : PageSize; return SetErrnoOnNull( @@ -1005,6 +1051,10 @@ uptr __sanitizer_get_allocated_size(const void *p) { ReportSanitizerGetAllocatedSizeNotOwned(ptr, &stack); } return allocated_size; +} + +void __sanitizer_purge_allocator() { + instance.Purge(); } #if !SANITIZER_SUPPORTS_WEAK_HOOKS Modified: projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/asan/asan_allocator.h Wed Dec 20 19:12:15 2017 (r327033) @@ -58,6 +58,7 @@ class AsanChunkView { uptr Beg() const; // First byte of user memory. uptr End() const; // Last byte of user memory. uptr UsedSize() const; // Size requested by the user. + u32 UserRequestedAlignment() const; // Originally requested alignment. uptr AllocTid() const; uptr FreeTid() const; bool Eq(const AsanChunkView &c) const { return chunk_ == c.chunk_; } @@ -119,7 +120,11 @@ struct AsanMapUnmapCallback { }; #if SANITIZER_CAN_USE_ALLOCATOR64 -# if defined(__powerpc64__) +# if SANITIZER_FUCHSIA +const uptr kAllocatorSpace = ~(uptr)0; +const uptr kAllocatorSize = 0x40000000000ULL; // 4T. +typedef DefaultSizeClassMap SizeClassMap; +# elif defined(__powerpc64__) const uptr kAllocatorSpace = 0xa0000000000ULL; const uptr kAllocatorSize = 0x20000000000ULL; // 2T. typedef DefaultSizeClassMap SizeClassMap; @@ -193,8 +198,8 @@ struct AsanThreadLocalMallocStorage { void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack, AllocType alloc_type); void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type); -void asan_sized_free(void *ptr, uptr size, BufferedStackTrace *stack, - AllocType alloc_type); +void asan_delete(void *ptr, uptr size, uptr alignment, + BufferedStackTrace *stack, AllocType alloc_type); void *asan_malloc(uptr size, BufferedStackTrace *stack); void *asan_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack); Modified: projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc Wed Dec 20 19:12:15 2017 (r327033) @@ -122,6 +122,7 @@ static void GetAccessToHeapChunkInformation(ChunkAcces } descr->chunk_begin = chunk.Beg(); descr->chunk_size = chunk.UsedSize(); + descr->user_requested_alignment = chunk.UserRequestedAlignment(); descr->alloc_type = chunk.GetAllocType(); } @@ -150,7 +151,7 @@ static void PrintHeapChunkAccess(uptr addr, const Chun str.append(" %zu-byte region [%p,%p)\n", descr.chunk_size, (void *)descr.chunk_begin, (void *)(descr.chunk_begin + descr.chunk_size)); - str.append("%s", d.EndLocation()); + str.append("%s", d.Default()); Printf("%s", str.data()); } @@ -260,7 +261,7 @@ static void PrintAccessAndVarIntersection(const StackV // FIXME: we may want to also print the size of the access here, // but in case of accesses generated by memset it may be confusing. str.append("%s <== Memory access at offset %zd %s this variable%s\n", - d.Location(), addr, pos_descr, d.EndLocation()); + d.Location(), addr, pos_descr, d.Default()); } else { str.append("\n"); } @@ -295,7 +296,7 @@ static void DescribeAddressRelativeToGlobal(uptr addr, MaybeDemangleGlobalName(g.name)); PrintGlobalLocation(&str, g); str.append("' (0x%zx) of size %zu\n", g.beg, g.size); - str.append("%s", d.EndLocation()); + str.append("%s", d.Default()); PrintGlobalNameIfASCII(&str, g); Printf("%s", str.data()); } @@ -335,6 +336,26 @@ void GlobalAddressDescription::Print(const char *bug_t } } +bool GlobalAddressDescription::PointsInsideTheSameVariable( + const GlobalAddressDescription &other) const { + if (size == 0 || other.size == 0) return false; + + for (uptr i = 0; i < size; i++) { + const __asan_global &a = globals[i]; + for (uptr j = 0; j < other.size; j++) { + const __asan_global &b = other.globals[j]; + if (a.beg == b.beg && + a.beg <= addr && + b.beg <= other.addr && + (addr + access_size) < (a.beg + a.size) && + (other.addr + other.access_size) < (b.beg + b.size)) + return true; + } + } + + return false; +} + void StackAddressDescription::Print() const { Decorator d; char tname[128]; @@ -343,10 +364,10 @@ void StackAddressDescription::Print() const { ThreadNameWithParenthesis(tid, tname, sizeof(tname))); if (!frame_descr) { - Printf("%s\n", d.EndLocation()); + Printf("%s\n", d.Default()); return; } - Printf(" at offset %zu in frame%s\n", offset, d.EndLocation()); + Printf(" at offset %zu in frame%s\n", offset, d.Default()); // Now we print the frame where the alloca has happened. // We print this frame as a stack trace with one element. @@ -355,7 +376,7 @@ void StackAddressDescription::Print() const { // previously. That's unfortunate, but I have no better solution, // especially given that the alloca may be from entirely different place // (e.g. use-after-scope, or different thread's stack). - Printf("%s", d.EndLocation()); + Printf("%s", d.Default()); StackTrace alloca_stack(&frame_pc, 1); alloca_stack.Print(); @@ -405,18 +426,18 @@ void HeapAddressDescription::Print() const { Printf("%sfreed by thread T%d%s here:%s\n", d.Allocation(), free_thread->tid, ThreadNameWithParenthesis(free_thread, tname, sizeof(tname)), - d.EndAllocation()); + d.Default()); StackTrace free_stack = GetStackTraceFromId(free_stack_id); free_stack.Print(); Printf("%spreviously allocated by thread T%d%s here:%s\n", d.Allocation(), alloc_thread->tid, ThreadNameWithParenthesis(alloc_thread, tname, sizeof(tname)), - d.EndAllocation()); + d.Default()); } else { Printf("%sallocated by thread T%d%s here:%s\n", d.Allocation(), alloc_thread->tid, ThreadNameWithParenthesis(alloc_thread, tname, sizeof(tname)), - d.EndAllocation()); + d.Default()); } alloc_stack.Print(); DescribeThread(GetCurrentThread()); Modified: projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.h ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.h Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/asan/asan_descriptions.h Wed Dec 20 19:12:15 2017 (r327033) @@ -34,11 +34,8 @@ class Decorator : public __sanitizer::SanitizerCommonD public: Decorator() : SanitizerCommonDecorator() {} const char *Access() { return Blue(); } - const char *EndAccess() { return Default(); } const char *Location() { return Green(); } - const char *EndLocation() { return Default(); } const char *Allocation() { return Magenta(); } - const char *EndAllocation() { return Default(); } const char *ShadowByte(u8 byte) { switch (byte) { @@ -72,9 +69,6 @@ class Decorator : public __sanitizer::SanitizerCommonD return Default(); } } - const char *EndShadowByte() { return Default(); } - const char *MemoryByte() { return Magenta(); } - const char *EndMemoryByte() { return Default(); } }; enum ShadowKind : u8 { @@ -108,6 +102,7 @@ struct ChunkAccess { sptr offset; uptr chunk_begin; uptr chunk_size; + u32 user_requested_alignment : 12; u32 access_type : 2; u32 alloc_type : 2; }; @@ -151,6 +146,10 @@ struct GlobalAddressDescription { u8 size; void Print(const char *bug_type = "") const; + + // Returns true when this descriptions points inside the same global variable + // as other. Descriptions can have different address within the variable + bool PointsInsideTheSameVariable(const GlobalAddressDescription &other) const; }; bool GetGlobalAddressInformation(uptr addr, uptr access_size, Modified: projects/clang600-import/contrib/compiler-rt/lib/asan/asan_errors.cc ============================================================================== --- projects/clang600-import/contrib/compiler-rt/lib/asan/asan_errors.cc Wed Dec 20 18:23:22 2017 (r327032) +++ projects/clang600-import/contrib/compiler-rt/lib/asan/asan_errors.cc Wed Dec 20 19:12:15 2017 (r327033) @@ -13,7 +13,6 @@ //===----------------------------------------------------------------------===// #include "asan_errors.h" -#include <signal.h> #include "asan_descriptions.h" #include "asan_mapping.h" #include "asan_report.h" @@ -22,82 +21,26 @@ namespace __asan { -void ErrorStackOverflow::Print() { - Decorator d; - Printf("%s", d.Warning()); - Report( - "ERROR: AddressSanitizer: %s on address %p" - " (pc %p bp %p sp %p T%d)\n", scariness.GetDescription(), - (void *)addr, (void *)pc, (void *)bp, (void *)sp, tid); - Printf("%s", d.EndWarning()); - scariness.Print(); - BufferedStackTrace stack; - GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, pc, bp, context, - common_flags()->fast_unwind_on_fatal); - stack.Print(); - ReportErrorSummary(scariness.GetDescription(), &stack); -} - -static void MaybeDumpInstructionBytes(uptr pc) { - if (!flags()->dump_instruction_bytes || (pc < GetPageSizeCached())) return; - InternalScopedString str(1024); - str.append("First 16 instruction bytes at pc: "); - if (IsAccessibleMemoryRange(pc, 16)) { - for (int i = 0; i < 16; ++i) { - PrintMemoryByte(&str, "", ((u8 *)pc)[i], /*in_shadow*/ false, " "); - } - str.append("\n"); - } else { - str.append("unaccessible\n"); - } - Report("%s", str.data()); -} - -static void MaybeDumpRegisters(void *context) { - if (!flags()->dump_registers) return; - SignalContext::DumpAllRegisters(context); -} - -static void MaybeReportNonExecRegion(uptr pc) { -#if SANITIZER_FREEBSD || SANITIZER_LINUX - MemoryMappingLayout proc_maps(/*cache_enabled*/ true); - MemoryMappedSegment segment; - while (proc_maps.Next(&segment)) { - if (pc >= segment.start && pc < segment.end && !segment.IsExecutable()) - Report("Hint: PC is at a non-executable region. Maybe a wild jump?\n"); - } +static void OnStackUnwind(const SignalContext &sig, + const void *callback_context, + BufferedStackTrace *stack) { + bool fast = common_flags()->fast_unwind_on_fatal; +#if SANITIZER_FREEBSD || SANITIZER_NETBSD + // On FreeBSD the slow unwinding that leverages _Unwind_Backtrace() + // yields the call stack of the signal's handler and not of the code + // that raised the signal (as it does on Linux). + fast = true; #endif + // Tests and maybe some users expect that scariness is going to be printed + // just before the stack. As only asan has scariness score we have no + // corresponding code in the sanitizer_common and we use this callback to + // print it. + static_cast<const ScarinessScoreBase *>(callback_context)->Print(); + GetStackTrace(stack, kStackTraceMax, sig.pc, sig.bp, sig.context, fast); } void ErrorDeadlySignal::Print() { - Decorator d; - Printf("%s", d.Warning()); - const char *description = __sanitizer::DescribeSignalOrException(signo); - Report( - "ERROR: AddressSanitizer: %s on unknown address %p (pc %p bp %p sp %p " - "T%d)\n", - description, (void *)addr, (void *)pc, (void *)bp, (void *)sp, tid); - Printf("%s", d.EndWarning()); - if (pc < GetPageSizeCached()) Report("Hint: pc points to the zero page.\n"); - if (is_memory_access) { - const char *access_type = - write_flag == SignalContext::WRITE - ? "WRITE" - : (write_flag == SignalContext::READ ? "READ" : "UNKNOWN"); - Report("The signal is caused by a %s memory access.\n", access_type); - if (addr < GetPageSizeCached()) - Report("Hint: address points to the zero page.\n"); - } - MaybeReportNonExecRegion(pc); - scariness.Print(); - BufferedStackTrace stack; - GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, pc, bp, context, - common_flags()->fast_unwind_on_fatal); - stack.Print(); - MaybeDumpInstructionBytes(pc); - MaybeDumpRegisters(context); - Printf("AddressSanitizer can not provide additional info.\n"); - ReportErrorSummary(description, &stack); + ReportDeadlySignal(signal, tid, &OnStackUnwind, &scariness); } void ErrorDoubleFree::Print() { @@ -109,7 +52,7 @@ void ErrorDoubleFree::Print() { "thread T%d%s:\n", scariness.GetDescription(), addr_description.addr, tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname))); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); scariness.Print(); GET_STACK_TRACE_FATAL(second_free_stack->trace[0], second_free_stack->top_frame_bp); @@ -118,7 +61,7 @@ void ErrorDoubleFree::Print() { ReportErrorSummary(scariness.GetDescription(), &stack); } -void ErrorNewDeleteSizeMismatch::Print() { +void ErrorNewDeleteTypeMismatch::Print() { Decorator d; Printf("%s", d.Warning()); char tname[128]; @@ -127,11 +70,29 @@ void ErrorNewDeleteSizeMismatch::Print() { "T%d%s:\n", scariness.GetDescription(), addr_description.addr, tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname))); - Printf("%s object passed to delete has wrong type:\n", d.EndWarning()); - Printf( - " size of the allocated type: %zd bytes;\n" - " size of the deallocated type: %zd bytes.\n", - addr_description.chunk_access.chunk_size, delete_size); + Printf("%s object passed to delete has wrong type:\n", d.Default()); + if (delete_size != 0) { + Printf( + " size of the allocated type: %zd bytes;\n" + " size of the deallocated type: %zd bytes.\n", + addr_description.chunk_access.chunk_size, delete_size); + } + const uptr user_alignment = + addr_description.chunk_access.user_requested_alignment; + if (delete_alignment != user_alignment) { + char user_alignment_str[32]; + char delete_alignment_str[32]; + internal_snprintf(user_alignment_str, sizeof(user_alignment_str), + "%zd bytes", user_alignment); + internal_snprintf(delete_alignment_str, sizeof(delete_alignment_str), + "%zd bytes", delete_alignment); + static const char *kDefaultAlignment = "default-aligned"; + Printf( + " alignment of the allocated type: %s;\n" + " alignment of the deallocated type: %s.\n", + user_alignment > 0 ? user_alignment_str : kDefaultAlignment, + delete_alignment > 0 ? delete_alignment_str : kDefaultAlignment); + } CHECK_GT(free_stack->size, 0); scariness.Print(); GET_STACK_TRACE_FATAL(free_stack->trace[0], free_stack->top_frame_bp); @@ -152,7 +113,7 @@ void ErrorFreeNotMalloced::Print() { "which was not malloc()-ed: %p in thread T%d%s\n", addr_description.Address(), tid, ThreadNameWithParenthesis(tid, tname, sizeof(tname))); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); CHECK_GT(free_stack->size, 0); scariness.Print(); GET_STACK_TRACE_FATAL(free_stack->trace[0], free_stack->top_frame_bp); @@ -173,7 +134,7 @@ void ErrorAllocTypeMismatch::Print() { scariness.GetDescription(), alloc_names[alloc_type], dealloc_names[dealloc_type], addr_description.addr); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); CHECK_GT(dealloc_stack->size, 0); scariness.Print(); GET_STACK_TRACE_FATAL(dealloc_stack->trace[0], dealloc_stack->top_frame_bp); @@ -192,7 +153,7 @@ void ErrorMallocUsableSizeNotOwned::Print() { "ERROR: AddressSanitizer: attempting to call malloc_usable_size() for " "pointer which is not owned: %p\n", addr_description.Address()); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); stack->Print(); addr_description.Print(); ReportErrorSummary(scariness.GetDescription(), stack); @@ -205,7 +166,7 @@ void ErrorSanitizerGetAllocatedSizeNotOwned::Print() { "ERROR: AddressSanitizer: attempting to call " "__sanitizer_get_allocated_size() for pointer which is not owned: %p\n", addr_description.Address()); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); stack->Print(); addr_description.Print(); ReportErrorSummary(scariness.GetDescription(), stack); @@ -222,7 +183,7 @@ void ErrorStringFunctionMemoryRangesOverlap::Print() { bug_type, addr1_description.Address(), addr1_description.Address() + length1, addr2_description.Address(), addr2_description.Address() + length2); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); scariness.Print(); stack->Print(); addr1_description.Print(); @@ -235,7 +196,7 @@ void ErrorStringFunctionSizeOverflow::Print() { Printf("%s", d.Warning()); Report("ERROR: AddressSanitizer: %s: (size=%zd)\n", scariness.GetDescription(), size); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); scariness.Print(); stack->Print(); addr_description.Print(); @@ -263,7 +224,7 @@ void ErrorODRViolation::Print() { Printf("%s", d.Warning()); Report("ERROR: AddressSanitizer: %s (%p):\n", scariness.GetDescription(), global1.beg); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); InternalScopedString g1_loc(256), g2_loc(256); PrintGlobalLocation(&g1_loc, global1); PrintGlobalLocation(&g2_loc, global2); @@ -292,7 +253,7 @@ void ErrorInvalidPointerPair::Print() { Printf("%s", d.Warning()); Report("ERROR: AddressSanitizer: %s: %p %p\n", scariness.GetDescription(), addr1_description.Address(), addr2_description.Address()); - Printf("%s", d.EndWarning()); + Printf("%s", d.Default()); GET_STACK_TRACE_FATAL(pc, bp); stack.Print(); addr1_description.Print(); @@ -477,9 +438,14 @@ static void PrintShadowMemoryForAddress(uptr addr) { InternalScopedString str(4096 * 8); str.append("Shadow bytes around the buggy address:\n"); for (int i = -5; i <= 5; i++) { + uptr row_shadow_addr = aligned_shadow + i * n_bytes_per_row; + // Skip rows that would be outside the shadow range. This can happen when + // the user address is near the bottom, top, or shadow gap of the address + // space. + if (!AddrIsInShadow(row_shadow_addr)) continue; const char *prefix = (i == 0) ? "=>" : " "; - PrintShadowBytes(&str, prefix, (u8 *)(aligned_shadow + i * n_bytes_per_row), - (u8 *)shadow_addr, n_bytes_per_row); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712201912.vBKJCFMD084901>