Mismatched free() / delete / delete [] in demangle_cxa
The unique_ptr in demangle_cxa seems to call the wrong deleter on the char array it gets from abi::__cxa_demangle. Stack trace:
==4391== Mismatched free() / delete / delete []
==4391== at 0x4C2B5B3: operator delete (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==4391== by 0x6D3EF8: std::default_delete<char []>::operator()(char*) const (unique_ptr.h:119)
==4391== by 0x6D3D0E: std::unique_ptr<char [], std::default_delete<char []> >::~unique_ptr() (unique_ptr.h:484)
==4391== by 0x6D3918: xerus::demangle_cxa(std::string const&) (stringUtilities.cpp:33)
==4391== by 0x6EE331: xerus::bfdResolver::resolve(void*) (callStack.cpp:104)
==4391== by 0x6EDB7A: xerus::get_call_stack() (callStack.cpp:140)
==4391== by 0x66EBFE: xerus::TensorNetwork::add_network_to_network(xerus::IndexedTensorWritable<xerus::TensorNetwork, 0>&, xerus::IndexedTensorReadOnly<xerus::TensorNetwork, 0> const&) (tensorNetwork.hpp:492)
==4391== by 0x67D836: xerus::operator*(xerus::IndexedTensorMoveable<xerus::TensorNetwork, 0>&&, xerus::IndexedTensorReadOnly<xerus::TensorNetwork, 0> const&) (indexedTensor_TN_operators.hpp:148)
==4391== by 0x416B4A: operator* (indexedTensor_TN_operators.h:39)
==4391== by 0x416B4A: {lambda()#6 (closed)}::operator()() const (sparseTensor_arithmetic_cpy.hxx:23)
==4391== by 0x511C37: _ZNSt17_Function_handlerIFbvEUlvE4_E9_M_invokeERKSt9_Any_data (functional:2025)
==4391== by 0x614FF7: std::function<bool ()>::operator()() const (functional:2439)
==4391== by 0x612F81: ___test(std::pair<std::string, std::function<bool ()> > const&) (test.cpp:46)