gcc/libsanitizer/sanitizer_common
Jakub Jelinek d9f462fb37 sanitizer: Fix asan against glibc 2.34 [PR100114]
As mentioned in the PR, SIGSTKSZ is no longer a compile time constant in
glibc 2.34 and later, so
static const uptr kAltStackSize = SIGSTKSZ * 4;
needs dynamic initialization, but is used by a function called indirectly
from .preinit_array and therefore before the variable is constructed.
This results in using 0 size instead and all asan instrumented programs
die with:
==91==ERROR: AddressSanitizer failed to allocate 0x0 (0) bytes of SetAlternateSignalStack (error code: 22)

Here is a cherry-pick from upstream to fix this.

2021-04-17  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/100114
	* sanitizer_common/sanitizer_posix_libcdep.cpp: Cherry-pick
	llvm-project revisions 82150606fb11d28813ae6da1101f5bda638165fe
	and b93629dd335ffee2fc4b9b619bf86c3f9e6b0023.
2021-04-17 11:27:14 +02:00
..
Makefile.am libsanitizer: use gnu++14 2020-06-09 10:07:24 +02:00
Makefile.in libsanitizer: Tie the hwasan library into our build system 2020-11-25 16:35:33 +00:00
sancov_flags.cpp
sancov_flags.h
sancov_flags.inc
sanitizer_addrhashmap.h
sanitizer_allocator_bytemap.h
sanitizer_allocator_checks.cpp
sanitizer_allocator_checks.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_combined.h
sanitizer_allocator_interface.h
sanitizer_allocator_internal.h
sanitizer_allocator_local_cache.h
sanitizer_allocator_primary32.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_primary64.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_report.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_allocator_report.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_allocator_secondary.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_size_class_map.h
sanitizer_allocator_stats.h
sanitizer_allocator.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_asm.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_atomic_clang_mips.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic_clang_other.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_atomic_clang_x86.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic_clang.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic_msvc.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_bitvector.h
sanitizer_bvgraph.h
sanitizer_common_interceptors_format.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common_interceptors_ioctl.inc
sanitizer_common_interceptors_netbsd_compat.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_common_interceptors_vfork_aarch64.inc.S
sanitizer_common_interceptors_vfork_arm.inc.S
sanitizer_common_interceptors_vfork_i386.inc.S
sanitizer_common_interceptors_vfork_riscv64.inc.S libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common_interceptors_vfork_x86_64.inc.S
sanitizer_common_interceptors.inc libsanitizer: cherry-pick ad294e572bc5c16f9dc420cc994322de6ca3fbfb 2021-03-08 15:55:27 +01:00
sanitizer_common_interface_posix.inc
sanitizer_common_interface.inc Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_common_libcdep.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common_nolibc.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_common_syscalls.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_common.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_coverage_fuchsia.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_coverage_interface.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_coverage_libcdep_new.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_coverage_win_dll_thunk.cpp
sanitizer_coverage_win_dynamic_runtime_thunk.cpp
sanitizer_coverage_win_sections.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_coverage_win_weak_interception.cpp
sanitizer_dbghelp.h
sanitizer_deadlock_detector1.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_deadlock_detector2.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_deadlock_detector_interface.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_deadlock_detector.h
sanitizer_errno_codes.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_errno.cpp
sanitizer_errno.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_file.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_file.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_flag_parser.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_flag_parser.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.inc libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_freebsd.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_fuchsia.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_fuchsia.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_getauxval.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_glibc_version.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_hash.h
sanitizer_interceptors_ioctl_netbsd.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_interface_internal.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_internal_defs.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_lfstack.h
sanitizer_libc.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_libc.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_libignore.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_libignore.h
sanitizer_linux_libcdep.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_linux_s390.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_linux.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_linux.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_list.h
sanitizer_local_address_space_view.h
sanitizer_mac_libcdep.cpp
sanitizer_mac.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_mac.h libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_malloc_mac.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_mutex.h
sanitizer_netbsd.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_openbsd.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_persistent_allocator.cpp
sanitizer_persistent_allocator.h
sanitizer_placement_new.h
sanitizer_platform_interceptors.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_platform_limits_freebsd.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_freebsd.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_platform_limits_linux.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_platform_limits_netbsd.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_netbsd.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_openbsd.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_platform_limits_openbsd.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_platform_limits_posix.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_posix.h libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_platform_limits_solaris.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_solaris.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_platform.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_posix_libcdep.cpp sanitizer: Fix asan against glibc 2.34 [PR100114] 2021-04-17 11:27:14 +02:00
sanitizer_posix.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_posix.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_printf.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_procmaps_bsd.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_procmaps_common.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_procmaps_fuchsia.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_procmaps_linux.cpp
sanitizer_procmaps_mac.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_procmaps_solaris.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_procmaps.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_ptrauth.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_quarantine.h
sanitizer_report_decorator.h
sanitizer_ring_buffer.h
sanitizer_rtems.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_rtems.h
sanitizer_signal_interceptors.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_solaris.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stackdepot.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stackdepot.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stackdepotbase.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_libcdep.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_printer.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_printer.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_sparc.cpp
sanitizer_stacktrace.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_stacktrace.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_fuchsia.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_fuchsia.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_linux_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_mac.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_netbsd_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_suppressions.cpp
sanitizer_suppressions.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_symbolizer_fuchsia.h
sanitizer_symbolizer_internal.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_libbacktrace.cpp
sanitizer_symbolizer_libbacktrace.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_mac.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_mac.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_markup.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_symbolizer_posix_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_report.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_symbolizer_rtems.h
sanitizer_symbolizer_win.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_symbolizer.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_syscall_generic.inc libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_syscall_linux_aarch64.inc
sanitizer_syscall_linux_arm.inc
sanitizer_syscall_linux_riscv64.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_syscall_linux_x86_64.inc
sanitizer_syscalls_netbsd.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_termination.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_thread_registry.cpp
sanitizer_thread_registry.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_tls_get_addr.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_tls_get_addr.h
sanitizer_type_traits.cpp
sanitizer_type_traits.h
sanitizer_unwind_linux_libcdep.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_unwind_win.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_vector.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_defs.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_dll_thunk.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_dll_thunk.h
sanitizer_win_dynamic_runtime_thunk.cpp
sanitizer_win_weak_interception.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_weak_interception.h
sanitizer_win.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_win.h