You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by trironk3 on 1 Oct 42975421 15:49 UTC
I'm encountering a Segmentation Fault during the destruction of CoverTree and BinarySpaceTree. I'm attaching my test code.
The text was updated successfully, but these errors were encountered:
Commented by rcurtin on 9 Aug 42975558 15:28 UTC
The issue was that PrefixedOutStream::operator<<(T) was generating copies. Those objects which were segfaulting are those which do not have proper copy constructors.
The key change is this:
PrefixedOutStream::operator<<(T)
to this:
PrefixedOutStream::operator<<(const T&)
If we were to change it to simply 'T&' and not 'const T&', this would not work for temporaries (i.e. Log::Warn << Range(5, 6);) because temporaries are not functionally equivalent to references. However, temporaries are functionally equivalent to const references, so changing the signature to 'const T&' avoids copies while at the same time not adversely impacting functionality. This change is committed in r14043.
However, the ticket's not quite done yet. Those offending objects (MRKDStatistic, HRectBound, BinarySpaceTree, CoverTree, this and that) should at least have properly-written copy constructors. Otherwise a user will accidentally copy them and then everything goes to hell at destruction time.
Reported by trironk3 on 1 Oct 42975421 15:49 UTC
I'm encountering a Segmentation Fault during the destruction of CoverTree and BinarySpaceTree. I'm attaching my test code.
The text was updated successfully, but these errors were encountered: