Summary: Not sure where or how it happens, but using a recent CircleCI failure I got a reliable db_stress reproducer.
Using std::unique_ptr appropriately for managing them has apparently (and unsurprisingly) fixed the problem without needing to know exactly where the problem was.
Suggested follow-up:
Three or even four levels of pointers is very confusing to work with. Surely this part can be cleaned up to be simpler.
Test Plan: Reproducer passes, plus ASAN test and crash test runs. I don't think it's worth the extra work to track down the details and create a careful unit test.
Summary: Not sure where or how it happens, but using a recent CircleCI failure I got a reliable db_stress reproducer.
Using std::unique_ptr appropriately for managing them has apparently (and unsurprisingly) fixed the problem without needing to know exactly where the problem was.
Suggested follow-up:
Test Plan: Reproducer passes, plus ASAN test and crash test runs. I don't think it's worth the extra work to track down the details and create a careful unit test.