HomePhabricator

Fix the processor_tests spurious segmentation fault

Description

Fix the processor_tests spurious segmentation fault

Summary:
Most of the tests create blocks and involve the validation queue. When
the test fixture is destructed at the end of a test, the queue might not
be empty and attempt to access destructed content, leading to the
spurious segfault. This diff fixes the issue by force-waiting for the
queue to clear on fixture destruction.

Test Plan:
With both gcc and clang, but no debug:

ninja check
for i in {1..1000}; do
  ./src/avalanche/test/test-avalanche -t processor_tests || exit 1;
done

Before this patch: about 3% failure rate. After this patch, no issue
during the 1000x loop with both compilers.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Jun 16 2021, 12:37
FabienPushed on Jun 16 2021, 14:08
Reviewer
Restricted Project
Differential Revision
D9687: Fix the processor_tests spurious segmentation fault
Parents
rABCcc8b33ed1642: [avalanche] Check the return value of the delegation addLevel() at startup
Branches
Unknown
Tags
Unknown