From 0a59e69fd922b02d9e3b5b043ee7f891061df7be Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Wed, 19 Jul 2023 15:01:00 +0000 Subject: Fix problem with exception handling in CPPScheduler If an exception was thrown in the main thread, the child threads were not being synchronised, leading to undefined behaviour (and probably the program crashing instead of correctly propagating the exception). Add support to the build system for enabling ThreadSanitizer. This needs a build system option rather than simply passing extra_cxx/link_flags because the sanitizer options are incompatible with -Wl,-undefined,error. Add a unit test for throwing an exception within a CPPScheduler workload. Signed-off-by: Matthew Bentham Change-Id: I7638272a5d43a24a861f3e6d63f3ee7b099483b5 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/538048 Comments-Addressed: bsgcomp Tested-by: bsgcomp Reviewed-by: Viet-Hoa Do Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9957 Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins --- SConscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'SConscript') diff --git a/SConscript b/SConscript index b5ef6db067..da7683ed6c 100644 --- a/SConscript +++ b/SConscript @@ -534,7 +534,8 @@ arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSI # Don't allow undefined references in the libraries: undefined_flag = '-Wl,-undefined,error' if 'macos' in arm_compute_env["os"] else '-Wl,--no-undefined' -arm_compute_env.Append(LINKFLAGS=[undefined_flag]) +if not env['thread_sanitizer']: + arm_compute_env.Append(LINKFLAGS=[undefined_flag]) arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] ) if env['os'] != 'openbsd': -- cgit v1.2.1