HomePhabricator

[Chronik] Fix: "Segmentation fault" during shutdown

Description

[Chronik] Fix: "Segmentation fault" during shutdown

Summary: The position of chronik::Stop() makes it so the indexer might still process freed memory. Moving it after GetMainSignals().FlushBackgroundCallbacks() fixes this.

Test Plan:
The functional test should fail if the chronik::Stop() is not moved as in this diff, and should pass if chronik::Stop() is moved as in this diff.

Alternatively, this should also reproduce the bug:

  1. ninja
  2. IBD for a few minutes
  3. Stop the node: Segmentation fault

Reviewers: Fabien, PiRK, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on May 27 2023, 20:37
tobias_ruckPushed on May 28 2023, 10:38
Reviewer
Restricted Project
Differential Revision
D13863: [Chronik] Fix: "Segmentation fault" during shutdown
Parents
rABC5b9472a84807: [Chronik] Add `BitcoinSer::deser` to deserialize messages encoded in theā€¦
Branches
Unknown
Tags
Unknown