I took a brief look at the crashes and I don't have a good theory.
It's crashing in InvalidateWeakPtrs called from here:
void BindingStateBase::Close() {
if (!router_)
return;
weak_ptr_factory_.InvalidateWeakPtrs();
endpoint_client_.reset();
router_->CloseMessagePipe();
router_ = nullptr;
}
Based on this, we can assume `this` in BindingStateBase probably isn't null. And the crash offset is at 0x4, which makes sense if the scoped_refptr<Flag> inside WeakReferenceOwner is somehow null (Flag is refcounted; refcounts are 32-bits, and so the atomic would be at 0x4 offset). But I don't think there's any time where we leave the Flag null anymore in WeakReferenceOwner: it's constructed with a Flag, and if we call Invalidate() explicitly, we reset it with a new Flag object... so I'm at a loss to say how this could happen.
Daniel