Issues compiling with Boost and VC15
Description
Environment
Activity
Scott Cantor December 20, 2016 at 7:26 PM
f685476136a3941272c695c91d72accaa65bdb71
Converted to vector<shared_ptr>.
I assigned this to 1.6.1 for now but I'm guessing that turns into 1.7.0 or 2.0.0, TBD.
Scott Cantor December 20, 2016 at 6:56 PM
OTOH, that doesn't explain why the ChainingAccessControl class in the SP compiles. AccessControl has a pure virtual method. Looking more and more like a compiler bug I guess.
At this point, I think we can switch it back a plain vector<OpenSSLPathValidator*>, or we could switch it to vector<shared_ptr<OpenSSLPathValidator>>.
Scott Cantor December 20, 2016 at 6:06 PM
I think I see what you mean about the different cases. TrustEngine is abstract only in the design sense, there are no pure virtuals, so it's not abstract technically. Whereas PathValidator and so forth are. So I suspect the compiler change is tripping on that.
I really don't like the idea of "fooling" it by plugging in an allocator that works only because of the ptr_vector methods that happen to get used, that's a good way to end up with a bad bug later.
Scott Cantor December 20, 2016 at 3:57 PM
Ah, so look at ChainingTrustEngine. It actually uses multiple ptr_vectors and it uses the view_clone_allocator as intended, to allow some of the vectors to be "views" into the master vector. But the master vector of TrustEngine objects is owning them, and it compiles with no second allocator parameter.
Fun with C++. Why does that build but not the other case?
Also, I think there's a third place, a static vector of Mutex objects that you may have compiled out because the OpenSSL locking stuff doesn't get used in 1.1?
Scott Cantor December 20, 2016 at 3:51 PM
The destructor being empty is really how I know where the ownership was supposed to be, and why a no-op delete call would definitely leak.
That suggestion might work, but there may be simpler ways. Also, I see other ptr_vectors with that allocator so now I'm confused and I need to do a full swap of this back in.
This is the log for one of the two failing files (the other one is StaticPKIXTrustEngine)
1>------ Build started: Project: xmltooling, Configuration: Debug Win32 ------ 1> AbstractPKIXTrustEngine.cpp 1>h:\perforce\devel\boost_1_60_0\boost\ptr_container\clone_allocator.hpp(34): error C2259: 'xmltooling::OpenSSLPathValidator': cannot instantiate abstract class 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\clone_allocator.hpp(34): note: due to following members: 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\clone_allocator.hpp(34): note: 'bool xmltooling::PathValidator::validate(XSECCryptoX509 *,const std::vector<XSECCryptoX509 *,std::allocator<_Ty>> &,const xmltooling::PathValidator::PathValidatorParams &) const': is abstract 1> with 1> [ 1> _Ty=XSECCryptoX509 * 1> ] 1> h:\perforce\devel\cpp-xmltooling\xmltooling\security\pathvalidator.h(71): note: see declaration of 'xmltooling::PathValidator::validate' 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\clone_allocator.hpp(34): note: 'bool xmltooling::OpenSSLPathValidator::validate(X509 *,stack_st_X509 *,const xmltooling::PathValidator::PathValidatorParams &) const': is abstract 1> h:\perforce\devel\cpp-xmltooling\xmltooling\security\opensslpathvalidator.h(59): note: see declaration of 'xmltooling::OpenSSLPathValidator::validate' 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\clone_allocator.hpp(68): note: see reference to function template instantiation 'T *boost::new_clone<U>(const T &)' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> U=xmltooling::OpenSSLPathValidator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\detail\reversible_ptr_container.hpp(110): note: see reference to function template instantiation 'U *boost::heap_clone_allocator::allocate_clone<xmltooling::OpenSSLPathValidator>(const U &)' being compiled 1> with 1> [ 1> U=xmltooling::OpenSSLPathValidator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\detail\reversible_ptr_container.hpp(99): note: while compiling class template member function 'xmltooling::OpenSSLPathValidator *boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>::allocate_clone(const xmltooling::OpenSSLPathValidator *)' 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\detail\reversible_ptr_container.hpp(95): note: see reference to function template instantiation 'xmltooling::OpenSSLPathValidator *boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>::allocate_clone(const xmltooling::OpenSSLPathValidator *)' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\detail\reversible_ptr_container.hpp(57): note: see reference to class template instantiation 'boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\detail\static_move_ptr.hpp(85): note: see reference to function template instantiation 'void boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>>::operator ()<xmltooling::OpenSSLPathValidator>(const T *) const' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\detail\static_move_ptr.hpp(85): note: see reference to function template instantiation 'void boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>>::operator ()<xmltooling::OpenSSLPathValidator>(const T *) const' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\detail\static_move_ptr.hpp(85): note: while compiling class template member function 'boost::ptr_container_detail::static_move_ptr<xmltooling::OpenSSLPathValidator,boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>>>::~static_move_ptr(void)' 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\ptr_sequence_adapter.hpp(248): note: see reference to function template instantiation 'boost::ptr_container_detail::static_move_ptr<xmltooling::OpenSSLPathValidator,boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>>>::~static_move_ptr(void)' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\ptr_sequence_adapter.hpp(248): note: see reference to class template instantiation 'boost::ptr_container_detail::static_move_ptr<xmltooling::OpenSSLPathValidator,boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<T,VoidPtrSeq>,CloneAllocator>::null_clone_allocator<false>>>' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> VoidPtrSeq=std::vector<void *,std::allocator<void *>>, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\ptr_sequence_adapter.hpp(245): note: while compiling class template member function 'void boost::ptr_sequence_adapter<T,std::vector<void *,std::allocator<_Ty>>,CloneAllocator>::push_back(xmltooling::OpenSSLPathValidator *)' 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> _Ty=void *, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\cpp-xmltooling\xmltooling\security\impl\abstractpkixtrustengine.cpp(165): note: see reference to function template instantiation 'void boost::ptr_sequence_adapter<T,std::vector<void *,std::allocator<_Ty>>,CloneAllocator>::push_back(xmltooling::OpenSSLPathValidator *)' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> _Ty=void *, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\boost_1_60_0\boost\ptr_container\ptr_vector.hpp(35): note: see reference to class template instantiation 'boost::ptr_sequence_adapter<T,std::vector<void *,std::allocator<_Ty>>,CloneAllocator>' being compiled 1> with 1> [ 1> T=xmltooling::OpenSSLPathValidator, 1> _Ty=void *, 1> CloneAllocator=boost::heap_clone_allocator 1> ] 1> h:\perforce\devel\cpp-xmltooling\xmltooling\security\abstractpkixtrustengine.h(69): note: see reference to class template instantiation 'boost::ptr_vector<xmltooling::OpenSSLPathValidator,boost::heap_clone_allocator,std::allocator<_Ty>>' being compiled 1> with 1> [ 1> _Ty=void * 1> ] 1>h:\perforce\devel\boost_1_60_0\boost\ptr_container\clone_allocator.hpp(34): error C2248: 'xmltooling::OpenSSLPathValidator::OpenSSLPathValidator': cannot access private member declared in class 'xmltooling::OpenSSLPathValidator'