Back when we were using the upstream https://github.com/zenhack/go.notmuch, the backend would frequently segfault and crash aerc. Reto ripped out a lot of memory-related code in his fork, which fixed the problem. However, I'm not sure what the deal was - we can't be the only ones using the library and coming across the issue.
This ticket is to keep in mind that we should explore this issue in more detail, and see whether we need to continue using a fork, or we're doing something else wrong and can go back to using upstream (preferable).