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

wallet: disable core dumps on startup in release mode #4136

Merged
merged 1 commit into from
Aug 15, 2018

Conversation

moneromooo-monero
Copy link
Collaborator

No description provided.

@@ -51,6 +51,9 @@ bool isAddressLocal(const std::string &address)
void onStartup()
{
tools::on_startup();
#ifdef NDEBUG
tools::disable_core_dumps();
#endif
Copy link
Contributor

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()?

Copy link
Collaborator Author

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).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok

struct rlimit rlimit;
rlimit.rlim_cur = rlimit.rlim_max = 0;
if (setrlimit(RLIMIT_CORE, &rlimit))
MWARNING("Failed to disable core dumps");
Copy link
Contributor

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?

@@ -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()
Copy link
Contributor

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).

@luigi1111 luigi1111 merged commit 4307489 into monero-project:master Aug 15, 2018
luigi1111 added a commit that referenced this pull request Aug 15, 2018
4307489 wallet: disable core dumps on startup in release mode (moneromooo-monero)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants