Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

reset the new handler #8307

Merged
merged 4 commits into from
Dec 11, 2019
Merged

reset the new handler #8307

merged 4 commits into from
Dec 11, 2019

Conversation

larryk85
Copy link
Contributor

Change Description

Because LLVM sets the new_handler to abort when new cannot allocate any more memory, we've lost the ability to exit cleanly in some instances and not corrupt the DB. This fix should reset the new_handler to throw std::bad_alloc and use the old behavior of EOSIO.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@larryk85
Copy link
Contributor Author

Want to see if the tests fail with the handler unset and ensure that the tests pass when I uncomment the throw std::bad_alloc line.

Copy link
Contributor

@heifner heifner left a comment

Choose a reason for hiding this comment

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

Don't forget to create a PR to develop as well.

@@ -304,6 +315,8 @@ struct controller_impl {
read_mode( cfg.read_mode ),
thread_pool( "chain", cfg.thread_pool_size )
{

// reset the
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this was added unintentionally and also the newline below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha

@larryk85 larryk85 merged commit 3bd3713 into release/2.0.x Dec 11, 2019
@larryk85 larryk85 deleted the fix/reset-new-handler branch December 11, 2019 20:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants