HomePhabricator

Don't use std::quick_exit() as it is poorly supported

Description

Don't use std::quick_exit() as it is poorly supported

Summary:
Despite being standard, it appears that quick_exit() is not available
on most non glibc platforms. In particular it breaks the tests build on
OSX.
This diff reverts D5254 in favor of D5232 (credits to @markblundeberg).
Despite being more hacky, it is more portable in definitive.

Test Plan:
On Linux and OSX:

ninja check

Note that windows is unaffected as the test is not built for this
platform.

valgrind ./src/test/test_bitcoin --logger=JUNIT  -t util_tests

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: markblundeberg

Differential Revision: https://reviews.bitcoinabc.org/D5318

Details

Provenance
FabienAuthored on Feb 24 2020, 10:17
FabienPushed on Feb 24 2020, 13:10
Reviewer
Restricted Project
Differential Revision
D5318: Don't use std::quick_exit() as it is poorly supported
Parents
rABC80dd145c4985: [secp256k1] Allow to use external default callbacks
Branches
Unknown
Tags
Unknown
Reverts
D5254: Fix LockDirectory test failure when the Junit logger is enabled

Event Timeline

I think what you want here is std::_Exit. It's standard and supported on all platforms and is what std::quick_exit ends up calling anyway (after calling the at_quick_exit handlers).

See C++ standard: https://en.cppreference.com/w/cpp/utility/program/quick_exit

(Note: Not sure how that interplays with the valgrind suppressor you wanted here, though).