This commit is contained in:
Alexey Milovidov 2022-05-11 03:16:10 +02:00
parent a8506f6604
commit 7536e0cd25

View File

@ -455,6 +455,11 @@ int main(int argc_, char ** argv_)
inside_main = true; inside_main = true;
SCOPE_EXIT({ inside_main = false; }); SCOPE_EXIT({ inside_main = false; });
/// PHDR cache is required for query profiler to work reliably
/// It also speed up exception handling, but exceptions from dynamically loaded libraries (dlopen)
/// will work only after additional call of this function.
updatePHDRCache();
/// Drop privileges if needed. /// Drop privileges if needed.
try try
{ {
@ -468,16 +473,10 @@ int main(int argc_, char ** argv_)
checkHarmfulEnvironmentVariables(); checkHarmfulEnvironmentVariables();
/// Reset new handler to default (that throws std::bad_alloc) /// Reset new handler to default (that throws std::bad_alloc)
/// It is needed because LLVM library clobbers it. /// It is needed because LLVM library clobbers it.
std::set_new_handler(nullptr); std::set_new_handler(nullptr);
/// PHDR cache is required for query profiler to work reliably
/// It also speed up exception handling, but exceptions from dynamically loaded libraries (dlopen)
/// will work only after additional call of this function.
updatePHDRCache();
std::vector<char *> argv(argv_, argv_ + argc_); std::vector<char *> argv(argv_, argv_ + argc_);
/// Print a basic help if nothing was matched /// Print a basic help if nothing was matched