diff --git a/conanfile.py b/conanfile.py index e2a0073f8d75..a6a94052de0a 100644 --- a/conanfile.py +++ b/conanfile.py @@ -31,7 +31,7 @@ def get_userver_version(self) -> str: class UserverConan(ConanFile): name = 'userver' - version = '2.2.4' + version = '2.2.5_sanitizer' description = 'The C++ Asynchronous Framework' topics = ('framework', 'coroutines', 'asynchronous') url = 'https://github.com/userver-framework/userver' @@ -54,6 +54,7 @@ class UserverConan(ConanFile): 'with_rabbitmq': [True, False], 'with_utest': [True, False], 'use_lld': [True, False], + 'use_asan': [True, False], 'namespace': ['ANY'], 'namespace_begin': ['ANY'], 'namespace_end': ['ANY'], @@ -73,6 +74,7 @@ class UserverConan(ConanFile): 'with_rabbitmq': False, 'with_utest': True, 'use_lld': True, + 'use_asan': False, 'namespace': 'userver', 'namespace_begin': 'namespace userver {', 'namespace_end': '}', @@ -221,6 +223,9 @@ def generate(self): tool_ch.variables[ 'USERVER_FEATURE_TESTSUITE' ] = False + + if self.options.use_asan: + tool_ch.variables['USERVER_SANITIZE'] = 'ub addr' if self.options.use_lld: tool_ch.variables['USERVER_USE_LD'] = 'lld' diff --git a/core/src/components/run.cpp b/core/src/components/run.cpp index dac1bc777142..f76ef7339445 100644 --- a/core/src/components/run.cpp +++ b/core/src/components/run.cpp @@ -235,7 +235,13 @@ void DoRun(const PathOrConfig& config, } else if (signum == SIGUSR1 || signum == SIGUSR2) { LOG_INFO() << "Signal caught: " << utils::strsignal(signum); manager->OnSignal(signum); - } else { + } + #ifdef __APPLE__ + else if(signum == -1){ + LOG_WARNING() << "sigwait false positive, ingnoring... "; + } + #endif + else { LOG_WARNING() << "Got unexpected signal: " << signum << " (" << utils::strsignal(signum) << ')'; UASSERT_MSG(false, "unexpected signal"); diff --git a/core/src/utils/signal_catcher.cpp b/core/src/utils/signal_catcher.cpp index b34a5a253aa3..288bc56d6fb5 100644 --- a/core/src/utils/signal_catcher.cpp +++ b/core/src/utils/signal_catcher.cpp @@ -24,7 +24,12 @@ SignalCatcher::~SignalCatcher() noexcept(false) { int SignalCatcher::Catch() { int signum = -1; utils::CheckSyscall(sigwait(&sigset_, &signum), "waiting for signal"); + //https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/sigwait.2.html + //on mac os sigwait sometime returns 0 value(success) and signum -1 + //looks like a bug + #ifndef __APPLE__ UASSERT(signum != -1); + #endif return signum; }