From 812d78820fe4971b7cd2b8b780a16053f0f8e84b Mon Sep 17 00:00:00 2001 From: Benjamin Bannier Date: Thu, 7 Dec 2023 11:38:51 +0100 Subject: [PATCH 1/2] Silence ASAN warning. ASAN sometimes gets confused in the fiber code. The switch from `std::string` to `std::string_view` in the logging code with d332827aee7d70cdb642631d7a289751e1d8a36a seems to have introduced new false positivies around logging, so this code adds a workaround for another function. Closes #1611. --- hilti/runtime/src/fiber.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hilti/runtime/src/fiber.cc b/hilti/runtime/src/fiber.cc index 2a414e7a5..38f5568b3 100644 --- a/hilti/runtime/src/fiber.cc +++ b/hilti/runtime/src/fiber.cc @@ -363,7 +363,7 @@ void ASAN_NO_OPTIMIZE detail::Fiber::_finishSwitchFiber(const char* tag) { #endif } -void detail::Fiber::_executeSwitch(const char* tag, detail::Fiber* from, detail::Fiber* to) { +void ASAN_NO_OPTIMIZE detail::Fiber::_executeSwitch(const char* tag, detail::Fiber* from, detail::Fiber* to) { HILTI_RT_FIBER_DEBUG(tag, fmt("executing fiber switch from %s to %s", *from, *to)); detail::Fiber::_startSwitchFiber(tag, to); From afd329398cc2230be72f0febfda05b0e2e82af7b Mon Sep 17 00:00:00 2001 From: Benjamin Bannier Date: Thu, 7 Dec 2023 12:19:06 +0100 Subject: [PATCH 2/2] Remove redundant forward decl. --- hilti/runtime/include/fiber-check-stack.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/hilti/runtime/include/fiber-check-stack.h b/hilti/runtime/include/fiber-check-stack.h index 2aca372b3..83cf1f164 100644 --- a/hilti/runtime/include/fiber-check-stack.h +++ b/hilti/runtime/include/fiber-check-stack.h @@ -10,9 +10,6 @@ namespace hilti::rt::detail { -/** Helper recording global stack resource usage. */ -extern void trackStack(); - /** * Checks that the current fiber has sufficient stack space left for executing * a function body. This is called often and should reduce overhead as much as