Modifications for address sanitizer [#METR-2944].

This commit is contained in:
Alexey Milovidov 2016-06-10 21:58:04 +03:00
parent dad7c09a02
commit abbb80ddd9
2 changed files with 16 additions and 0 deletions

View File

@ -90,3 +90,12 @@
#if !defined(__x86_64__) && !defined(__aarch64__)
#error PLATFORM_NOT_SUPPORTED
#endif
/// Проверка наличия address sanitizer
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#define ADDRESS_SANITIZER 1
#endif
#elif defined(__SANITIZE_ADDRESS__)
#define ADDRESS_SANITIZER 1
#endif

View File

@ -686,7 +686,14 @@ void BaseDaemon::initialize(Application& self)
rlim.rlim_cur = config().getUInt64("core_dump.size_limit", 1024 * 1024 * 1024);
if (setrlimit(RLIMIT_CORE, &rlim))
{
#ifndef ADDRESS_SANITIZER
throw Poco::Exception("Cannot setrlimit");
#else
/// Не работает под address sanitizer. http://lists.llvm.org/pipermail/llvm-bugs/2013-April/027880.html
std::cerr << "Cannot setrlimit\n";
#endif
}
}
task_manager.reset(new Poco::TaskManager);