CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2024-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 25 01:12:16 UTC 2024

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl.h

Log Message:
add some missing alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2024-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 25 01:12:16 UTC 2024

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl.h

Log Message:
add some missing alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h:1.3 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h:1.3	Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h	Sun Feb 25 01:12:16 2024
@@ -132,7 +132,7 @@ struct ScopedGlobalProcessor {
 
 // This struct is stored in TLS.
 struct ThreadState {
-  FastState fast_state;
+  FastState fast_state ALIGNED(SANITIZER_CACHE_LINE_SIZE);
   // Synch epoch represents the threads's epoch before the last synchronization
   // action. It allows to reduce number of shadow state updates.
   // For example, fast_synch_epoch=100, last write to addr X was at epoch=150,



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-10-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 22 00:08:50 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_asm.h

Log Message:
enable NO_EXEC_STACK_DIRECTIVE on netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-10-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 22 00:08:50 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_asm.h

Log Message:
enable NO_EXEC_STACK_DIRECTIVE on netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h:1.3	Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h	Sun Oct 22 00:08:50 2023
@@ -59,7 +59,8 @@
 #endif
 
 #if defined(__ELF__) && (defined(__GNU__) || defined(__FreeBSD__) || \
- defined(__Fuchsia__) || defined(__linux__))
+ defined(__Fuchsia__) || defined(__linux__) || \
+			 defined(__NetBSD__))
 // clang-format off
 #define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
 // clang-format on



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:25:17 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
make this more like the old lsan_allocator.h change.

adds sh3 and vax build support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2023-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 06:25:17 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
make this more like the old lsan_allocator.h change.

adds sh3 and vax build support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.9 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.9	Fri Aug  4 19:25:06 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h	Fri Aug 11 06:25:17 2023
@@ -51,10 +51,14 @@ struct ChunkMetadata {
 
 #if defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \
 defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__) || \
-((defined(__hppa__) || defined(__sparc__)) && !defined(_LP64)) || \
-defined(__mips_o32) || defined(__mips_n32) || defined(__m68k__) || \
-(defined(__riscv__) && !defined(_LP64)) || \
-(defined(__powerpc__) && !defined(__powerpc64__))
+((defined(__sparc__) || \
+  defined(__powerpc__) || \
+  defined(__m68k__) || \
+  defined(__hppa__) || \
+  defined(__sh3__) || \
+  defined(__vax__) || \
+  defined(__riscv) || \
+  defined(__mips__)) && !defined(_LP64))
 template 
 struct AP32 {
   static const uptr kSpaceBeg = 0;
@@ -70,8 +74,8 @@ template 
 using PrimaryAllocatorASVT = SizeClassAllocator32>;
 using PrimaryAllocator = PrimaryAllocatorASVT;
 #elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__) || \
-  defined(__alpha__) || defined(__sparc64__) || defined(__ia64__) || \
-  defined(__powerpc64__) || (defined(__riscv__) && !defined(_LP64))
+  defined(__sparc64__) || defined(__ia64__) || defined(__alpha__) || \
+  defined(__mips64) || defined(__riscv)
 # if SANITIZER_FUCHSIA
 const uptr kAllocatorSpace = ~(uptr)0;
 const uptr kAllocatorSize  =  0x400ULL;  // 4T.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2023-08-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  4 19:25:06 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
allow this to build on powerpc*.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.8 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.8	Fri Aug  4 07:40:04 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h	Fri Aug  4 19:25:06 2023
@@ -53,7 +53,8 @@ struct ChunkMetadata {
 defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__) || \
 ((defined(__hppa__) || defined(__sparc__)) && !defined(_LP64)) || \
 defined(__mips_o32) || defined(__mips_n32) || defined(__m68k__) || \
-(defined(__riscv__) && !defined(_LP64))
+(defined(__riscv__) && !defined(_LP64)) || \
+(defined(__powerpc__) && !defined(__powerpc64__))
 template 
 struct AP32 {
   static const uptr kSpaceBeg = 0;
@@ -70,7 +71,7 @@ using PrimaryAllocatorASVT = SizeClassAl
 using PrimaryAllocator = PrimaryAllocatorASVT;
 #elif defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__) || \
   defined(__alpha__) || defined(__sparc64__) || defined(__ia64__) || \
-  (defined(__riscv__) && !defined(_LP64))
+  defined(__powerpc64__) || (defined(__riscv__) && !defined(_LP64))
 # if SANITIZER_FUCHSIA
 const uptr kAllocatorSpace = ~(uptr)0;
 const uptr kAllocatorSize  =  0x400ULL;  // 4T.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2023-08-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  4 19:25:06 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
allow this to build on powerpc*.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2023-07-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 31 01:44:58 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer: configure.ac merge.sh
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_activation.h
asan_activation_flags.inc asan_allocator.h asan_descriptions.h
asan_errors.h asan_fake_stack.h asan_flags.h asan_flags.inc
asan_init_version.h asan_interceptors_memintrinsics.h
asan_interface.inc asan_interface_internal.h asan_mapping_sparc64.h
asan_premap_shadow.h asan_report.h asan_scariness_score.h
asan_stats.h asan_suppressions.h
src/external/gpl3/gcc/dist/libsanitizer/builtins: assembly.h
src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer:
allocator_interface.h coverage_interface.h linux_syscall_hooks.h
lsan_interface.h msan_interface.h scudo_interface.h
src/external/gpl3/gcc/dist/libsanitizer/interception: Makefile.am
interception_linux.h interception_mac.h interception_win.h
src/external/gpl3/gcc/dist/libsanitizer/lsan: libtool-version lsan.h
lsan_flags.inc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sancov_flags.h sancov_flags.inc sanitizer_addrhashmap.h
sanitizer_allocator_checks.h sanitizer_allocator_interface.h
sanitizer_allocator_internal.h sanitizer_allocator_local_cache.h
sanitizer_allocator_primary32.h sanitizer_allocator_report.h
sanitizer_allocator_size_class_map.h sanitizer_allocator_stats.h
sanitizer_atomic.h sanitizer_atomic_clang.h
sanitizer_atomic_clang_mips.h sanitizer_atomic_clang_other.h
sanitizer_atomic_clang_x86.h sanitizer_atomic_msvc.h
sanitizer_bitvector.h sanitizer_bvgraph.h
sanitizer_common_interceptors_format.inc
sanitizer_common_interceptors_ioctl.inc
sanitizer_common_interceptors_netbsd_compat.inc
sanitizer_common_interface.inc sanitizer_common_interface_posix.inc
sanitizer_coverage_interface.inc sanitizer_dbghelp.h
sanitizer_deadlock_detector.h
sanitizer_deadlock_detector_interface.h sanitizer_errno.h
sanitizer_errno_codes.h sanitizer_file.h sanitizer_flags.h
sanitizer_flags.inc sanitizer_freebsd.h sanitizer_fuchsia.h
sanitizer_interface_internal.h sanitizer_lfstack.h sanitizer_libc.h
sanitizer_libignore.h sanitizer_list.h sanitizer_malloc_mac.inc
sanitizer_persistent_allocator.h sanitizer_placement_new.h
sanitizer_platform_limits_netbsd.h
sanitizer_platform_limits_solaris.h sanitizer_quarantine.h
sanitizer_report_decorator.h sanitizer_ring_buffer.h
sanitizer_signal_interceptors.inc sanitizer_stackdepot.h
sanitizer_stackdepotbase.h sanitizer_stacktrace.h
sanitizer_stacktrace_printer.h sanitizer_stoptheworld.h
sanitizer_suppressions.h sanitizer_symbolizer.h
sanitizer_symbolizer_fuchsia.h sanitizer_symbolizer_libbacktrace.h
sanitizer_symbolizer_mac.h sanitizer_syscall_generic.inc
sanitizer_syscall_linux_aarch64.inc sanitizer_syscall_linux_arm.inc
sanitizer_syscall_linux_x86_64.inc sanitizer_tls_get_addr.h
sanitizer_vector.h sanitizer_win.h sanitizer_win_defs.h
sanitizer_win_dll_thunk.h sanitizer_win_weak_interception.h
src/external/gpl3/gcc/dist/libsanitizer/tsan: libtool-version
tsan_clock.h tsan_defs.h tsan_dense_alloc.h tsan_fd.h tsan_flags.h
tsan_ignoreset.h tsan_interface_ann.h tsan_interface_java.h
tsan_mutexset.h tsan_report.h tsan_rtl_aarch64.S tsan_rtl_amd64.S
tsan_rtl_ppc64.S tsan_stack_trace.h tsan_suppressions.h
tsan_symbolize.h tsan_sync.h tsan_trace.h
src/external/gpl3/gcc/dist/libsanitizer/ubsan: Makefile.am
libtool-version ubsan_diag.h ubsan_flags.h ubsan_flags.inc
ubsan_handlers_cxx.h ubsan_init.h ubsan_interface.inc
ubsan_monitor.h ubsan_platform.h ubsan_signals_standalone.h
ubsan_type_hash.h ubsan_value.h
Added Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_activation.cpp
asan_allocator.cpp asan_debugging.cpp asan_descriptions.cpp
asan_errors.cpp asan_fake_stack.cpp asan_flags.cpp asan_fuchsia.cpp
asan_globals.cpp asan_globals_win.cpp asan_interceptors.cpp
asan_interceptors_memintrinsics.cpp asan_linux.cpp asan_mac.cpp
asan_malloc_linux.cpp asan_malloc_mac.cpp asan_malloc_win.cpp
asan_memory_profile.cpp asan_new_delete.cpp asan_poisoning.cpp
asan_posix.cpp asan_preinit.cpp asan_premap_shadow.cpp
asan_report.cpp asan_rtl.cpp asan_shadow_setup.cpp asan_stack.cpp
asan_stats.cpp 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2023-07-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 31 01:44:58 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer: configure.ac merge.sh
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_activation.h
asan_activation_flags.inc asan_allocator.h asan_descriptions.h
asan_errors.h asan_fake_stack.h asan_flags.h asan_flags.inc
asan_init_version.h asan_interceptors_memintrinsics.h
asan_interface.inc asan_interface_internal.h asan_mapping_sparc64.h
asan_premap_shadow.h asan_report.h asan_scariness_score.h
asan_stats.h asan_suppressions.h
src/external/gpl3/gcc/dist/libsanitizer/builtins: assembly.h
src/external/gpl3/gcc/dist/libsanitizer/include/sanitizer:
allocator_interface.h coverage_interface.h linux_syscall_hooks.h
lsan_interface.h msan_interface.h scudo_interface.h
src/external/gpl3/gcc/dist/libsanitizer/interception: Makefile.am
interception_linux.h interception_mac.h interception_win.h
src/external/gpl3/gcc/dist/libsanitizer/lsan: libtool-version lsan.h
lsan_flags.inc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sancov_flags.h sancov_flags.inc sanitizer_addrhashmap.h
sanitizer_allocator_checks.h sanitizer_allocator_interface.h
sanitizer_allocator_internal.h sanitizer_allocator_local_cache.h
sanitizer_allocator_primary32.h sanitizer_allocator_report.h
sanitizer_allocator_size_class_map.h sanitizer_allocator_stats.h
sanitizer_atomic.h sanitizer_atomic_clang.h
sanitizer_atomic_clang_mips.h sanitizer_atomic_clang_other.h
sanitizer_atomic_clang_x86.h sanitizer_atomic_msvc.h
sanitizer_bitvector.h sanitizer_bvgraph.h
sanitizer_common_interceptors_format.inc
sanitizer_common_interceptors_ioctl.inc
sanitizer_common_interceptors_netbsd_compat.inc
sanitizer_common_interface.inc sanitizer_common_interface_posix.inc
sanitizer_coverage_interface.inc sanitizer_dbghelp.h
sanitizer_deadlock_detector.h
sanitizer_deadlock_detector_interface.h sanitizer_errno.h
sanitizer_errno_codes.h sanitizer_file.h sanitizer_flags.h
sanitizer_flags.inc sanitizer_freebsd.h sanitizer_fuchsia.h
sanitizer_interface_internal.h sanitizer_lfstack.h sanitizer_libc.h
sanitizer_libignore.h sanitizer_list.h sanitizer_malloc_mac.inc
sanitizer_persistent_allocator.h sanitizer_placement_new.h
sanitizer_platform_limits_netbsd.h
sanitizer_platform_limits_solaris.h sanitizer_quarantine.h
sanitizer_report_decorator.h sanitizer_ring_buffer.h
sanitizer_signal_interceptors.inc sanitizer_stackdepot.h
sanitizer_stackdepotbase.h sanitizer_stacktrace.h
sanitizer_stacktrace_printer.h sanitizer_stoptheworld.h
sanitizer_suppressions.h sanitizer_symbolizer.h
sanitizer_symbolizer_fuchsia.h sanitizer_symbolizer_libbacktrace.h
sanitizer_symbolizer_mac.h sanitizer_syscall_generic.inc
sanitizer_syscall_linux_aarch64.inc sanitizer_syscall_linux_arm.inc
sanitizer_syscall_linux_x86_64.inc sanitizer_tls_get_addr.h
sanitizer_vector.h sanitizer_win.h sanitizer_win_defs.h
sanitizer_win_dll_thunk.h sanitizer_win_weak_interception.h
src/external/gpl3/gcc/dist/libsanitizer/tsan: libtool-version
tsan_clock.h tsan_defs.h tsan_dense_alloc.h tsan_fd.h tsan_flags.h
tsan_ignoreset.h tsan_interface_ann.h tsan_interface_java.h
tsan_mutexset.h tsan_report.h tsan_rtl_aarch64.S tsan_rtl_amd64.S
tsan_rtl_ppc64.S tsan_stack_trace.h tsan_suppressions.h
tsan_symbolize.h tsan_sync.h tsan_trace.h
src/external/gpl3/gcc/dist/libsanitizer/ubsan: Makefile.am
libtool-version ubsan_diag.h ubsan_flags.h ubsan_flags.inc
ubsan_handlers_cxx.h ubsan_init.h ubsan_interface.inc
ubsan_monitor.h ubsan_platform.h ubsan_signals_standalone.h
ubsan_type_hash.h ubsan_value.h
Added Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_activation.cpp
asan_allocator.cpp asan_debugging.cpp asan_descriptions.cpp
asan_errors.cpp asan_fake_stack.cpp asan_flags.cpp asan_fuchsia.cpp
asan_globals.cpp asan_globals_win.cpp asan_interceptors.cpp
asan_interceptors_memintrinsics.cpp asan_linux.cpp asan_mac.cpp
asan_malloc_linux.cpp asan_malloc_mac.cpp asan_malloc_win.cpp
asan_memory_profile.cpp asan_new_delete.cpp asan_poisoning.cpp
asan_posix.cpp asan_preinit.cpp asan_premap_shadow.cpp
asan_report.cpp asan_rtl.cpp asan_shadow_setup.cpp asan_stack.cpp
asan_stats.cpp 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-04-06 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Apr  6 09:49:12 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_mutex.h

Log Message:
Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.2	Sun Apr 11 23:54:27 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h	Thu Apr  6 09:49:12 2023
@@ -39,7 +39,7 @@ class StaticSpinMutex {
   }
 
   void CheckLocked() {
-CHECK_EQ(atomic_load(_, memory_order_relaxed), 1);
+CHECK_NE(atomic_load(_, memory_order_relaxed), 0);
   }
 
  private:



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-04-06 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Apr  6 09:49:12 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_mutex.h

Log Message:
Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-11-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 15 12:38:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Remove extra _, thanks RVP


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.43 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.44
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.43	Sat Nov 13 10:34:39 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Nov 15 07:38:41 2021
@@ -830,10 +830,10 @@ int internal_fork() {
 
 #if SANITIZER_NETBSD
 #include 
-extern "C" int __sigaction__siginfo(int, const struct sigaction *, struct sigaction *);
+extern "C" int __sigaction_siginfo(int, const struct sigaction *, struct sigaction *);
 int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {
 
-return __sigaction__siginfo(signum,
+return __sigaction_siginfo(signum,
 	reinterpret_cast(act),
 	reinterpret_cast(oldact));
 }



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-11-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 15 12:38:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Remove extra _, thanks RVP


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2021-11-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Nov 13 15:34:39 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/interception:
interception_linux.cc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_platform_limits_netbsd.h
sanitizer_signal_interceptors.inc

Log Message:
fix the remaining vestiges of __sigaction14; now the tsan signal tests work.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc
cvs rdiff -u -r1.42 -r1.43 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2021-11-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Nov 13 15:34:39 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/interception:
interception_linux.cc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_platform_limits_netbsd.h
sanitizer_signal_interceptors.inc

Log Message:
fix the remaining vestiges of __sigaction14; now the tsan signal tests work.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc
cvs rdiff -u -r1.42 -r1.43 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc:1.8 src/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc:1.8	Sun Apr 11 19:54:26 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc	Sat Nov 13 10:34:39 2021
@@ -26,7 +26,7 @@ bool GetRealFunctionAddress(const char *
 uptr real, uptr wrapper) {
 #if SANITIZER_NETBSD
   // XXX: Find a better way to handle renames
-  if (internal_strcmp(func_name, "sigaction") == 0) func_name = "__sigaction14";
+  if (internal_strcmp(func_name, "sigaction") == 0) func_name = "__sigaction_siginfo";
 #endif
   *func_addr = (uptr)dlsym(RTLD_NEXT, func_name);
   if (!*func_addr) {

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.42 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.43
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.42	Thu Oct 28 10:31:20 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Nov 13 10:34:39 2021
@@ -830,10 +830,10 @@ int internal_fork() {
 
 #if SANITIZER_NETBSD
 #include 
-extern "C" int __sigaction14(int, const struct sigaction *, struct sigaction *);
+extern "C" int __sigaction__siginfo(int, const struct sigaction *, struct sigaction *);
 int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {
 
-return __sigaction14(signum,
+return __sigaction__siginfo(signum,
 	reinterpret_cast(act),
 	reinterpret_cast(oldact));
 }

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.6 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h:1.6	Sun Apr 11 19:54:27 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.h	Sat Nov 13 10:34:39 2021
@@ -2410,7 +2410,7 @@ struct __sanitizer_cdbw {
   COMPILER_CHECK(offsetof(struct __sanitizer_##CLASS, MEMBER) == \
  offsetof(struct CLASS, MEMBER))
 
-#define SIGACTION_SYMNAME __sigaction14
+#define SIGACTION_SYMNAME __sigaction_siginfo
 
 // Compat with 9.0
 extern unsigned struct_statvfs90_sz;

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc:1.2	Sun Apr 11 19:54:27 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_signal_interceptors.inc	Sat Nov 13 10:34:39 2021
@@ -17,7 +17,7 @@
 using namespace __sanitizer;
 
 #if SANITIZER_NETBSD
-#define sigaction_symname __sigaction14
+#define sigaction_symname __sigaction_siginfo
 #else
 #define sigaction_symname sigaction
 #endif



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 14:31:20 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
more underscore


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.41 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.42
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.41	Thu Oct 28 07:22:41 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Thu Oct 28 10:31:20 2021
@@ -2041,8 +2041,8 @@ static void GetPcSpBp(void *context, upt
   *pc = ucontext->uc_mcontext.gregs[REG_PC];
   *sp = ucontext->uc_mcontext.gregs[REG_O6] + STACK_BIAS;
 # elif SANITIZER_NETBSD
-  *pc = ucontext->uc_mcontext.__gregs[REG_PC];
-  *sp = ucontext->uc_mcontext.__gregs[REG_O6] + STACK_BIAS;
+  *pc = ucontext->uc_mcontext.__gregs[_REG_PC];
+  *sp = ucontext->uc_mcontext.__gregs[_REG_O6] + STACK_BIAS;
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)context;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 14:31:20 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
more underscore


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 11:22:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix sparc: use mcontext to fetch pc and sp


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.40 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.41
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.40	Sun Apr 11 19:54:27 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Thu Oct 28 07:22:41 2021
@@ -1930,12 +1930,12 @@ SignalContext::WriteFlag SignalContext::
   // From OpenSolaris $SRC/uts/sun4/os/trap.c (get_accesstype).
 # if SANITIZER_SOLARIS
   uptr pc = ucontext->uc_mcontext.gregs[REG_PC];
+# elif SANITIZER_NETBSD
+  uptr pc = ucontext->uc_mcontext.__gregs[_REG_PC];
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)ucontext;
-#  if SANITIZER_NETBSD
-  uptr pc = scontext->sc_pc;
-#  elif defined(__arch64__)
+#  if defined(__arch64__)
   uptr pc = scontext->sigc_regs.tpc;
 #  else
   uptr pc = scontext->si_regs.pc;
@@ -2040,6 +2040,9 @@ static void GetPcSpBp(void *context, upt
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.gregs[REG_PC];
   *sp = ucontext->uc_mcontext.gregs[REG_O6] + STACK_BIAS;
+# elif SANITIZER_NETBSD
+  *pc = ucontext->uc_mcontext.__gregs[REG_PC];
+  *sp = ucontext->uc_mcontext.__gregs[REG_O6] + STACK_BIAS;
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)context;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 11:22:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix sparc: use mcontext to fetch pc and sp


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread Kamil Rytarowski
On 05.09.2020 15:35, matthew green wrote:
> Module Name:  src
> Committed By: mrg
> Date: Sat Sep  5 13:35:55 UTC 2020
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_linux.cc sanitizer_linux.h sanitizer_linux_libcdep.cc
>   sanitizer_platform_limits_netbsd.cc sanitizer_syscall_generic.inc
> 
> Log Message:
> fix various merge botches; we may need to re-port the ThreadLister code.
> 


LSan was ported and upstreamed post GCC-9:

https://github.com/llvm/llvm-project/commit/1b58389428ed07a7322ba9c2bcaeec99807f9457

https://github.com/llvm/llvm-project/commit/5fe1e55d35413b1904cfcf16ec15495398921fe5

https://github.com/llvm/llvm-project/commit/8827047551570b7ed7088765c3de2a8cce6823b8

https://github.com/llvm/llvm-project/commit/983d7ddd0b278b45d815cbac9197205b39c4860a

https://github.com/llvm/llvm-project/commit/fc356dcc11c10003ff22acff667b0a9f5e6c1e0f

https://github.com/llvm/llvm-project/commit/3a189bac9bb111c9a59339015ab0d4e2fed735f4

https://github.com/llvm/llvm-project/commit/02519fc7a6f8c528f67975a9f78ce64dabf402b4

And possibly something else:

https://github.com/llvm/llvm-project/commits?author=krytarowski

> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.33 -r1.34 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
> cvs rdiff -u -r1.9 -r1.10 \
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
> cvs rdiff -u -r1.12 -r1.13 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
> cvs rdiff -u -r1.1.1.2 -r1.2 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
> cvs rdiff -u -r1.8 -r1.9 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 
> 
> Modified files:
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33
>  
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34
> --- 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33
>   Sat Sep  5 09:12:32 2020
> +++ 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   
> Sat Sep  5 13:35:55 2020
> @@ -41,8 +41,6 @@
>  #undef stat
>  #endif
>  
> -#endif // SANITIZER_LINUX
> -
>  #if SANITIZER_NETBSD
>  #include 
>  #endif
> @@ -980,7 +978,6 @@ ThreadLister::ThreadLister(pid_t pid) : 
>if (internal_iserror(descriptor_)) {
>  Report("Can't open /proc/%d/task for reading.\n", pid);
>}
> -#endif
>  }
>  
>  ThreadLister::Result ThreadLister::ListThreads(
> @@ -1055,10 +1052,8 @@ bool ThreadLister::IsAlive(int tid) {
>  }
>  
>  ThreadLister::~ThreadLister() {
> -#ifndef SANITIZER_NETBSD
>if (!internal_iserror(descriptor_))
>  internal_close(descriptor_);
> -#endif
>  }
>  #endif
>  
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9
>  
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10
> --- 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9
> Sat Sep  5 09:12:32 2020
> +++ 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
> Sat Sep  5 13:35:55 2020
> @@ -69,6 +69,8 @@ uptr internal_clone(int (*fn)(void *), v
>  #endif
>  #elif SANITIZER_FREEBSD
>  void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
> +#elif SANITIZER_NETBSD
> +uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
>  #endif  // SANITIZER_LINUX
>  
>  #ifdef SANITIZER_NETBSD
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12
>  
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13
> --- 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12
>   Sat Sep  5 09:12:32 2020
> +++ 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
>Sat Sep  5 13:35:55 2020
> @@ -72,6 +72,10 @@ struct __sanitizer::linux_dirent {
>  #include 
>  #endif
>  
> +#if SANITIZER_NETBSD
> +#include 
> +#endif
> +
>  namespace __sanitizer {
>  
>  SANITIZER_WEAK_ATTRIBUTE int
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2
>  
> 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 18:36:25 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
add some more machines to the 32 bit part


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.2	Fri Oct  4 04:51:33 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h	Sat Oct 26 14:36:25 2019
@@ -51,6 +51,10 @@ struct ChunkMetadata {
 #if defined(__aarch64__) || defined(__i386__) || defined(__arm__) || \
 ((defined(__sparc__) || \
   defined(__powerpc__) || \
+  defined(__m68k__) || \
+  defined(__hppa__) || \
+  defined(__sh3__) || \
+  defined(__vax__) || \
   defined(__mips__)) && !defined(_LP64))
 static const uptr kRegionSizeLog = 20;
 static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog;
@@ -68,7 +72,7 @@ struct AP32 {
 };
 typedef SizeClassAllocator32 PrimaryAllocator;
 #elif defined(__x86_64__) || defined(__powerpc64__) || defined(__sparc64__) || \
-  (defined(__mips64) && defined(_LP64))
+  defined(__alpha__) || (defined(__mips64) && defined(_LP64))
 struct AP64 {  // Allocator64 parameters. Deliberately using a short name.
   static const uptr kSpaceBeg = 0x6000ULL;
   static const uptr kSpaceSize =  0x400ULL; // 4T.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/asan

2019-10-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 25 18:03:59 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_mapping.h

Log Message:
Unbreak the sanitizers for gcc. The sanitizer offset defined in
libsanitizer needs to match with the compiler concept of
TARGET_ASAN_SHADOW_OFFSET, since the compiler generates instructions
to access memory at that offset in the code, and expects the
sanitizer library to have mapped something there. If there is
disagreement, Mr. Segmentation Fault comes and resolves it for you.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/asan

2019-10-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 25 18:03:59 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_mapping.h

Log Message:
Unbreak the sanitizers for gcc. The sanitizer offset defined in
libsanitizer needs to match with the compiler concept of
TARGET_ASAN_SHADOW_OFFSET, since the compiler generates instructions
to access memory at that offset in the code, and expects the
sanitizer library to have mapped something there. If there is
disagreement, Mr. Segmentation Fault comes and resolves it for you.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h:1.6 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h:1.6	Tue Oct  1 06:38:23 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_mapping.h	Fri Oct 25 14:03:59 2019
@@ -185,8 +185,10 @@ static const u64 kWindowsShadowOffset32 
 #define SHADOW_OFFSET kSystemZ_ShadowOffset64
 #  elif SANITIZER_FREEBSD
 #define SHADOW_OFFSET kFreeBSD_ShadowOffset64
-#  elif SANITIZER_NETBSD
-#define SHADOW_OFFSET kNetBSD_ShadowOffset64
+// XXX: see TARGET_ASAN_SHADOW_OFFSET in gcc.
+// for example ix86_asan_shadow_offset() in i386.c 
+// #  elif SANITIZER_NETBSD
+// #define SHADOW_OFFSET kNetBSD_ShadowOffset64
 #  elif SANITIZER_MAC
 #   define SHADOW_OFFSET kDefaultShadowOffset64
 #  elif defined(__mips64)



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct  1 21:13:44 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_allocator.h
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.cc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_internal_defs.h

Log Message:
final GCC 8.3 sanitizer merge, untested.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_allocator.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc
cvs rdiff -u -r1.10 -r1.11 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_allocator.h:1.1.1.5 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_allocator.h:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_allocator.h:1.1.1.5	Tue Oct  1 09:36:38 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_allocator.h	Tue Oct  1 21:13:43 2019
@@ -140,8 +140,13 @@ const uptr kAllocatorSpace = ~(uptr)0;
 const uptr kAllocatorSize  =  0x80ULL;  // 500G
 typedef DefaultSizeClassMap SizeClassMap;
 # else
+#if _LP64
 const uptr kAllocatorSpace = 0x6000ULL;
 const uptr kAllocatorSize  =  0x400ULL;  // 4T.
+#else
+const uptr kAllocatorSpace = 0x6000UL;
+const uptr kAllocatorSize  =  0x4000ULL; // 2G.
+#endif
 typedef DefaultSizeClassMap SizeClassMap;
 # endif
 struct AP64 {  // Allocator64 parameters. Deliberately using a short name.

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc:1.3	Sat Jan 19 12:10:11 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc	Tue Oct  1 21:13:44 2019
@@ -13,7 +13,9 @@
 #include "lsan_allocator.h"
 
 #include "sanitizer_common/sanitizer_allocator.h"
+#include "sanitizer_common/sanitizer_allocator_checks.h"
 #include "sanitizer_common/sanitizer_allocator_interface.h"
+#include "sanitizer_common/sanitizer_errno.h"
 #include "sanitizer_common/sanitizer_internal_defs.h"
 #include "sanitizer_common/sanitizer_stackdepot.h"
 #include "sanitizer_common/sanitizer_stacktrace.h"
@@ -22,64 +24,30 @@
 extern "C" void *memset(void *ptr, int value, uptr num);
 
 namespace __lsan {
-
-struct ChunkMetadata {
-  u8 allocated : 8;  // Must be first.
-  ChunkTag tag : 2;
-#ifdef _LP64
-  uptr requested_size : 54;
-#else
-  uptr requested_size : 30;
-#endif
-  u32 stack_trace_id;
-};
-
-#if defined(__mips64) || defined(__aarch64__)
+#if defined(__i386__) || defined(__arm__)
+static const uptr kMaxAllowedMallocSize = 1UL << 30;
+#elif defined(__mips64) || defined(__aarch64__)
 static const uptr kMaxAllowedMallocSize = 4UL << 30;
-static const uptr kRegionSizeLog = 20;
-static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog;
-typedef TwoLevelByteMap<(kNumRegions >> 12), 1 << 12> ByteMap;
-typedef CompactSizeClassMap SizeClassMap;
-typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE,
-sizeof(ChunkMetadata), SizeClassMap, kRegionSizeLog, ByteMap>
-PrimaryAllocator;
 #else
 #if _LP64
 static const uptr kMaxAllowedMallocSize = 8UL << 30;
 #else
 static const uptr kMaxAllowedMallocSize = 8UL << 20;
 #endif
-
-struct AP64 {  // Allocator64 parameters. Deliberately using a short name.
-#if _LP64
-  static const uptr kSpaceBeg = 0x6000ULL;
-  static const uptr kSpaceSize =  0x400ULL; // 4T.
-#else
-  static const uptr kSpaceBeg = 0x6000UL;
-  static const uptr kSpaceSize =  0x4000ULL; // 2G.
-#endif
-  static const uptr kMetadataSize = sizeof(ChunkMetadata);
-  typedef DefaultSizeClassMap SizeClassMap;
-  typedef NoOpMapUnmapCallback MapUnmapCallback;
-  static const uptr kFlags = 0;
-};
-
-typedef SizeClassAllocator64 PrimaryAllocator;
-#endif
-typedef SizeClassAllocatorLocalCache AllocatorCache;
 typedef LargeMmapAllocator<> SecondaryAllocator;
 typedef CombinedAllocator Allocator;
 
 static Allocator allocator;
-static THREADLOCAL AllocatorCache cache;
 
 void InitializeAllocator() {
-  allocator.InitLinkerInitialized(common_flags()->allocator_may_return_null);
+  SetAllocatorMayReturnNull(common_flags()->allocator_may_return_null);
+  allocator.InitLinkerInitialized(
+  common_flags()->allocator_release_to_os_interval_ms);
 }
 
 void AllocatorThreadFinish() {
-  allocator.SwallowCache();
+  allocator.SwallowCache(GetAllocatorCache());
 }
 
 static ChunkMetadata *Metadata(const void *p) {
@@ -109,9 +77,9 @@ void *Allocate(const StackTrace , 
 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2019-10-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Oct  1 21:13:44 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_allocator.h
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.cc
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_internal_defs.h

Log Message:
final GCC 8.3 sanitizer merge, untested.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_allocator.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.cc
cvs rdiff -u -r1.10 -r1.11 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Kamil Rytarowski
On 01.06.2019 21:04, Christos Zoulas wrote:
> On Jun 1,  8:48pm, n...@gmx.com (Kamil Rytarowski) wrote:
> -- Subject: Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan
> 
> | There is some overlap, but not full.
> 
> I understand.
> 
> | https://github.com/llvm-mirror/compiler-rt/blob/master/lib/tsan/rtl/tsan_rt=
> | l_amd64.S
> | 
> | Each call of this code was verified and it passed regression suite.
> | 
> | There is also need to handle NetBSD specific renaming of symbols in this
> | file and in .c file.
> 
> I also said that the NetBSD symbols are not handled. Newer gcc will fix it.
> I just wanted to make it compile.
> 
> christos
> 

I see, thank you! I'm doing it in the way that code flows with new
upstream versions into the basesystem. Cherry picking TSan support
shouldn't be that difficult probably.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Christos Zoulas
On Jun 1,  8:48pm, n...@gmx.com (Kamil Rytarowski) wrote:
-- Subject: Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

| There is some overlap, but not full.

I understand.

| https://github.com/llvm-mirror/compiler-rt/blob/master/lib/tsan/rtl/tsan_rt=
| l_amd64.S
| 
| Each call of this code was verified and it passed regression suite.
| 
| There is also need to handle NetBSD specific renaming of symbols in this
| file and in .c file.

I also said that the NetBSD symbols are not handled. Newer gcc will fix it.
I just wanted to make it compile.

christos


Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Kamil Rytarowski
On 01.06.2019 20:38, Christos Zoulas wrote:
> I just checked and the offsets are correct (we are the same as FreeBSD).
> We are missing support for the the names of the functions __setjmp14 etc.
> 
> Thanks,
> 

There is some overlap, but not full.

https://github.com/llvm-mirror/compiler-rt/blob/master/lib/tsan/rtl/tsan_rtl_amd64.S

Each call of this code was verified and it passed regression suite.

There is also need to handle NetBSD specific renaming of symbols in this
.S file and in .c file.

> christos
> 
>> On Jun 1, 2019, at 1:52 PM, Kamil Rytarowski  wrote:
>>
>> On 01.06.2019 19:22, Christos Zoulas wrote:
>>> Module Name:src
>>> Committed By:   christos
>>> Date:   Sat Jun  1 17:22:58 UTC 2019
>>>
>>> Modified Files:
>>> src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S
>>>
>>> Log Message:
>>> Do as FreeBSD does now (I have not checked that the offsets are correct)
>>>
>>
>> These values differ on NetBSD.
>>
>> There is upstreamed support into upstream repository here:
>>
>> https://github.com/llvm-mirror/compiler-rt/tree/master/lib/tsan/rtl
>>
>> Please grep for NetBSD specific code. We will get it with GCC9, maybe
>> GCC8.. but I would need to check.
>>
>> 
> 




signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Christos Zoulas
I just checked and the offsets are correct (we are the same as FreeBSD).
We are missing support for the the names of the functions __setjmp14 etc.

Thanks,

christos

> On Jun 1, 2019, at 1:52 PM, Kamil Rytarowski  wrote:
> 
> On 01.06.2019 19:22, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sat Jun  1 17:22:58 UTC 2019
>> 
>> Modified Files:
>>  src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S
>> 
>> Log Message:
>> Do as FreeBSD does now (I have not checked that the offsets are correct)
>> 
> 
> These values differ on NetBSD.
> 
> There is upstreamed support into upstream repository here:
> 
> https://github.com/llvm-mirror/compiler-rt/tree/master/lib/tsan/rtl
> 
> Please grep for NetBSD specific code. We will get it with GCC9, maybe
> GCC8.. but I would need to check.
> 
> 



Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Kamil Rytarowski
On 01.06.2019 19:22, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sat Jun  1 17:22:58 UTC 2019
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S
> 
> Log Message:
> Do as FreeBSD does now (I have not checked that the offsets are correct)
> 

These values differ on NetBSD.

There is upstreamed support into upstream repository here:

https://github.com/llvm-mirror/compiler-rt/tree/master/lib/tsan/rtl

Please grep for NetBSD specific code. We will get it with GCC9, maybe
GCC8.. but I would need to check.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:24:20 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Don't require procfs to be mounted with linux so that /task is available
and explain why.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:24:20 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Don't require procfs to be mounted with linux so that /task is available
and explain why.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.31
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30	Fri Apr 26 20:23:17 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Jun  1 13:24:20 2019
@@ -854,6 +854,18 @@ ThreadLister::ThreadLister(int pid)
 error_(true),
 entry_((struct linux_dirent *)buffer_.data()),
 bytes_read_(0) {
+#if SANITIZER_NETBSD
+  /*
+   * netbsd does not have "tasks". Our lwp's are not like processes, 
+   * and this is used to suspend each task by attaching to them and stopping
+   * them. We do this at the process level, so we hijack the descriptor to
+   * permanently store our pid (the pid to trace and stop), and bytes_read_
+   * to store a copy of it, that we set to -1 once we read it.
+   */
+  descriptor_ = pid;
+  bytes_read_ = pid;
+  error_ = false;
+#else
   char task_directory_path[80];
   internal_snprintf(task_directory_path, sizeof(task_directory_path),
 "/proc/%d/task/", pid);
@@ -865,9 +877,15 @@ ThreadLister::ThreadLister(int pid)
 error_ = false;
 descriptor_ = openrv;
   }
+#endif
 }
 
 int ThreadLister::GetNextTID() {
+#if SANITIZER_NETBSD
+  int tid = bytes_read_;
+  bytes_read_ = -1;
+  return tid;
+#else
   int tid = -1;
   do {
 if (error_)
@@ -882,17 +900,25 @@ int ThreadLister::GetNextTID() {
 entry_ = (struct linux_dirent *)(((char *)entry_) + entry_->d_reclen);
   } while (tid < 0);
   return tid;
+#endif
 }
 
 void ThreadLister::Reset() {
+#if SANITIZER_NETBSD
+  bytes_read_ = descriptor_;
+  error_ = false;
+#else
   if (error_ || descriptor_ < 0)
 return;
   internal_lseek(descriptor_, 0, SEEK_SET);
+#endif
 }
 
 ThreadLister::~ThreadLister() {
+#ifndef SANITIZER_NETBSD
   if (descriptor_ >= 0)
 internal_close(descriptor_);
+#endif
 }
 
 bool ThreadLister::error() { return error_; }



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:23:29 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Add defines so this compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:23:29 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Add defines so this compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.6 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.6	Sat Jan 19 07:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc	Sat Jun  1 13:23:29 2019
@@ -44,7 +44,7 @@ using namespace __tsan;  // NOLINT
 #define mallopt(a, b)
 #endif
 
-#if SANITIZER_LINUX || SANITIZER_FREEBSD
+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
 #define PTHREAD_CREATE_DETACHED 1
 #elif SANITIZER_MAC
 #define PTHREAD_CREATE_DETACHED 2
@@ -2020,7 +2020,7 @@ TSAN_INTERCEPTOR(int, sigaction, int sig
   sigactions[sig].sa_flags = *(volatile int*)>sa_flags;
   internal_memcpy([sig].sa_mask, >sa_mask,
   sizeof(sigactions[sig].sa_mask));
-#if !SANITIZER_FREEBSD && !SANITIZER_MAC
+#if !SANITIZER_FREEBSD && !SANITIZER_MAC && !SANITIZER_NETBSD
   sigactions[sig].sa_restorer = act->sa_restorer;
 #endif
   sigaction_t newact;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:22:58 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S

Log Message:
Do as FreeBSD does now (I have not checked that the offsets are correct)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:22:58 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S

Log Message:
Do as FreeBSD does now (I have not checked that the offsets are correct)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.5 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.5	Sat Jan 19 07:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S	Sat Jun  1 13:22:58 2019
@@ -186,7 +186,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp):
   CFI_ADJUST_CFA_OFFSET(8)
   CFI_REL_OFFSET(%rdi, 0)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 8(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -227,7 +227,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp):
   CFI_ADJUST_CFA_OFFSET(8)
   CFI_REL_OFFSET(%rdi, 0)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 8(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -275,7 +275,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp):
   sub $8, %rsp
   CFI_ADJUST_CFA_OFFSET(8)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 24(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -331,7 +331,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp)
   sub $8, %rsp
   CFI_ADJUST_CFA_OFFSET(8)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 24(%rsp), %rdi
   mov %rdi, %rsi
 #else



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2019-05-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 25 15:18:52 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_common.h
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_linux_libcdep.cc

Log Message:
Undo previous (disable lsan), and instead fix it by passing 1 instead of 0
to the address argument in detach. Apparently linux ignores the address
argument for detach (or treats 0 as 'do not set').


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h:1.4 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h:1.5
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h:1.4	Sat May 25 09:54:37 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h	Sat May 25 11:18:52 2019
@@ -20,7 +20,7 @@
 #include "sanitizer_common/sanitizer_stoptheworld.h"
 #include "sanitizer_common/sanitizer_symbolizer.h"
 
-#if (SANITIZER_LINUX) && !SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64) \
+#if (SANITIZER_NETBSD || SANITIZER_LINUX) && !SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64) \
  && (defined(__x86_64__) ||  defined(__mips64) ||  defined(__aarch64__))
 #define CAN_SANITIZE_LEAKS 1
 #else

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.6 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.6	Thu Jan 31 03:44:14 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc	Sat May 25 11:18:52 2019
@@ -164,7 +164,7 @@ bool ThreadSuspender::SuspendThread(Susp
 // doesn't hurt to report it.
 VReport(1, "Waiting on thread %d failed, detaching (errno %d).\n",
 tid, wperrno);
-internal_ptrace(PTRACE_DETACH, tid, nullptr, nullptr);
+internal_ptrace(PTRACE_DETACH, tid, (void*)(uptr)1, nullptr);
 return false;
   }
   if (WIFSTOPPED(status) && WSTOPSIG(status) != SIGSTOP) {
@@ -183,7 +183,7 @@ void ThreadSuspender::ResumeAllThreads()
   for (uptr i = 0; i < suspended_threads_list_.thread_count(); i++) {
 pid_t tid = suspended_threads_list_.GetThreadID(i);
 int pterrno;
-if (!internal_iserror(internal_ptrace(PTRACE_DETACH, tid, nullptr, nullptr),
+if (!internal_iserror(internal_ptrace(PTRACE_DETACH, tid, (void*)(uptr)1, nullptr),
   )) {
   VReport(2, "Detached from thread %d.\n", tid);
 } else {



CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2019-05-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 25 15:18:52 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_common.h
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_linux_libcdep.cc

Log Message:
Undo previous (disable lsan), and instead fix it by passing 1 instead of 0
to the address argument in detach. Apparently linux ignores the address
argument for detach (or treats 0 as 'do not set').


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2019-05-25 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat May 25 13:54:37 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_common.h

Log Message:
don't claim lsan support on netbsd.

PR toolchain/54226: address sanitizer doesn't work


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/lsan

2019-05-25 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat May 25 13:54:37 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_common.h

Log Message:
don't claim lsan support on netbsd.

PR toolchain/54226: address sanitizer doesn't work


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h:1.3 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h:1.3	Sat Jan 19 12:10:11 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_common.h	Sat May 25 13:54:37 2019
@@ -20,7 +20,7 @@
 #include "sanitizer_common/sanitizer_stoptheworld.h"
 #include "sanitizer_common/sanitizer_symbolizer.h"
 
-#if (SANITIZER_NETBSD || SANITIZER_LINUX) && !SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64) \
+#if (SANITIZER_LINUX) && !SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64) \
  && (defined(__x86_64__) ||  defined(__mips64) ||  defined(__aarch64__))
 #define CAN_SANITIZE_LEAKS 1
 #else



Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer

2018-02-05 Thread Kamil Rytarowski
On 05.02.2018 23:04, matthew green wrote:
> Module Name:  src
> Committed By: mrg
> Date: Mon Feb  5 22:04:54 UTC 2018
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_linux.cc sanitizer_platform_limits_posix.cc
>   src/external/gpl3/gcc/dist/libsanitizer/ubsan: ubsan_platform.h
> 
> Log Message:
> - enable powerpc and arm support.
> - port GetPcSpBp() to netbsd/powerpc* and netbsd/arm.
> 
> 

Upstream for the sanitizers is located in LLVM compiler-rt/lib (it's
equivalent to libsanitier in GCC with added wrappers for GCC).

https://github.com/llvm-mirror/compiler-rt

8snapshot contains a decent part of the upstreamed NetBSD work (at least
ASan, UBSan, partial TSan).

I think that we should upgrade libsanitizer to 8snapshot as-is, instead
of repeating the porting effort for 6.x. Or even better upgrade to HEAD
from LLVM directly (TSan, MSan + other fixes).

I will pickup the !amd64 patches added here and upstream to LLVM directly.



signature.asc
Description: OpenPGP digital signature


re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-22 Thread Christos Zoulas
On Sep 22,  4:02pm, m...@eterna.com.au (matthew green) wrote:
-- Subject: re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer

| sorry to bug you again, but... ;)
| 
| > Modified Files:
| > src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
| > sanitizer_platform_limits_posix.h
| > 
| > Log Message:
| > Check the NetBSD version
| 
| ! # ifdef __NetBSD__
| 
| hmmm, shouldn't that be SANITZIER_NETBSD or whatever it is?

Could be... I've changed it.

christos


re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-22 Thread matthew green
sorry to bug you again, but... ;)

> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_platform_limits_posix.h
> 
> Log Message:
> Check the NetBSD version

! # ifdef __NetBSD__

hmmm, shouldn't that be SANITZIER_NETBSD or whatever it is?


re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Wed Sep 21 19:18:01 UTC 2016
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_platform_limits_posix.h
> 
> Log Message:
> add new field

+ #ifdef __NetBSD__
+ unsigned int ifa_addrflags;
+ #endif

thanks for cleaning up :-)

can you make this version specific so that we can upstream this
change?  the above only works on todays netbsd.

thanks.


.mrg.


Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-06-10 Thread Rin Okuyama

On 2016/06/09 23:37, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Thu Jun  9 14:37:06 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_syscall_generic.inc

Log Message:
Fix syscall argument passing from Ryn Okuyama (with minor changes; hope I did
not make it worse :-)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


Thank you very much for refinement and commit my patch. Let me add
few comments:

* internal_ptrace()

   As usage of ptrace(2) is quite different for Linux and us, we need
   additional work to get it working. At this moment, this function is
   used only within "#if SANITIZER_LINUX && defined(__x86_64__)" block
   in sanitizer_stoptheworld_linux_libcdep.cc. This is why I disabled
   it in my previous patch. I've added a brief comment.

* internal_wait4()

   The last argument of wait4(2) should be NULL, not 0. This may
   cause troubles for LP64.

* internal_getdents()

   Sorry, my previous patch for this function was completely wrong.
   But your version is also incomplete:

 - structure dirent is different for Linux and us; we need to
   declare linux_dirent in the same way as our native dirent.

 - The last argument of getdents(2) should be size_t (aka uptr),
   not u_int.

* sanitizer_syscall_generic.inc

   Sorry, this is also my careless mistake. Two #if blocks should
   be combined to avoid possible redefinition of internal_syscall.

Thanks,
Rin

--- 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc.orig
2016-06-10 06:14:51.159752456 +0900
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc 
2016-06-10 09:16:19.561985484 +0900
@@ -56,6 +56,7 @@
  extern char **environ;  // provided by crt1
  #endif  // SANITIZER_FREEBSD
  #if SANITIZER_NETBSD
+#include  // for NAME_MAX
  #include 
  extern char **environ;  // provided by crt1
  #endif  // SANITIZER_NETBSD
@@ -491,6 +492,17 @@
  }
  
  // - sanitizer_linux.h

+#if SANITIZER_NETBSD
+// struct dirent is different for Linux and us. At this moment, we use only
+// d_fileno (Linux call this d_ino), d_reclen, and d_name.
+struct linux_dirent {
+  u64  d_ino; // d_fileno
+  u16  d_reclen;
+  u16  d_namlen;  // not used
+  u8   d_type;// not used
+  char d_name[NAME_MAX + 1];
+};
+#else
  // The actual size of this structure is specified by d_reclen.
  // Note that getdents64 uses a different structure format. We only provide the
  // 32-bit syscall here.
@@ -505,10 +517,18 @@
unsigned short d_reclen;
char   d_name[256];
  };
+#endif
  
  // Syscall wrappers.

  uptr internal_ptrace(int request, int pid, void *addr, void *data) {
  #if SANITIZER_NETBSD
+// XXX We need additional work for ptrace:
+//   - for request, we use PT_FOO whereas Linux uses PTRACE_FOO
+//   - data is int for us, but void * for Linux
+//   - Linux sometimes uses data in the case where we use addr instead
+// At this moment, this function is used only within
+// "#if SANITIZER_LINUX && defined(__x86_64__)" block in
+// sanitizer_stoptheworld_linux_libcdep.cc.
return internal_syscall_ptr(SYSCALL(ptrace), request, pid, (uptr)addr,
(uptr)data);
  #else
@@ -518,8 +538,13 @@
  }
  
  uptr internal_waitpid(int pid, int *status, int options) {

+#if SANITIZER_NETBSD
+  return internal_syscall(SYSCALL(wait4), pid, status, options,
+  NULL /* rusage */);
+#else
return internal_syscall(SYSCALL(wait4), pid, (uptr)status, options,
0 /* rusage */);
+#endif
  }
  
  uptr internal_getpid() {

@@ -531,7 +556,9 @@
  }
  
  uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {

-#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
+#if SANITIZER_NETBSD
+  return internal_syscall(SYSCALL(getdents), fd, dirp, (uptr)count);
+#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count);
  #else
return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);
--- 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc.orig
 2016-06-10 07:09:34.310819833 +0900
+++ 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc
  2016-06-10 07:09:51.201896163 +0900
@@ -38,9 +38,7 @@
  # else
  #  define internal_syscall_ptrsyscall
  # endif
-#endif
-
-#if (SANITIZER_FREEBSD && defined(__x86_64__))
+#elif (SANITIZER_FREEBSD && defined(__x86_64__))
  # define internal_syscall __syscall
  #