When a validationinterface has itself unregistered in one thread, but is about to get executed in another thread [1], there is a race:
- The validationinterface destructing itself
- The validationinterface getting dereferenced for execution
This happens in the miner. More generally it happens everywhere where at least one thread is generating notifications and another one is unregistering a validationinterface.
This issue has been fixed in commit ab31b9d6fe7b39713682e3f52d11238dbe042c16, but the fix has not been applied to the miner.
Example where this happened in practice: https://travis-ci.org/github/bitcoin/bitcoin/jobs/675322230#L4414