Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ingnore false positive sigwait at macos and added sanitizers #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'],
Expand All @@ -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': '}',
Expand Down Expand Up @@ -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'
Expand Down
8 changes: 7 additions & 1 deletion core/src/components/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
5 changes: 5 additions & 0 deletions core/src/utils/signal_catcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down