Page MenuHomePhabricator

Fix the processor_tests spurious segmentation fault
ClosedPublic

Authored by Fabien on Jun 16 2021, 13:01.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC1ec2717d4433: 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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable