-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
wallet: disable core dumps on startup in release mode #4136
Conversation
@@ -51,6 +51,9 @@ bool isAddressLocal(const std::string &address) | |||
void onStartup() | |||
{ | |||
tools::on_startup(); | |||
#ifdef NDEBUG | |||
tools::disable_core_dumps(); | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just bring this into tools::on_startup()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd disable for every program, and I want to disable it just for wallets (for secret keys).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok
src/common/util.cpp
Outdated
struct rlimit rlimit; | ||
rlimit.rlim_cur = rlimit.rlim_max = 0; | ||
if (setrlimit(RLIMIT_CORE, &rlimit)) | ||
MWARNING("Failed to disable core dumps"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe return false in case of failure?
src/common/util.cpp
Outdated
@@ -677,6 +678,17 @@ std::string get_nix_version_display_string() | |||
signal(SIGILL, posix_crash_handler); | |||
signal(SIGFPE, posix_crash_handler); | |||
} | |||
bool disable_core_dumps() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be defined outside the #ifdef STACK_TRACE
section, otherwise the symbol will be undefined when STACK_TRACE
is not defined (buildbot is failing due to this).
066ca23
to
4307489
Compare
4307489 wallet: disable core dumps on startup in release mode (moneromooo-monero)
No description provided.