With the current state of the master branch I tried to parse CodeCompass itself (the same state of the master branch).
I get the following segfault:
[INFO] (21/138) Parsing /home/mate/cc/sources/CodeCompass/parser/src/pluginhandler.cpp
Segmentation fault (core dumped)
I have debugged that the segfault occurs in the getMangledName() function, here, when fileLoc_.file.object_id() gets evaluated:
else if (llvm::isa<clang::NamespaceDecl>(nd_))
{
const clang::NamespaceDecl* na_ = llvm::dyn_cast<clang::NamespaceDecl>(nd_);
return na_->isAnonymousNamespace()
? "anonymous-ns:" + std::to_string(fileLoc_.file.object_id())
: nd_->getQualifiedNameAsString();
}
https://codecompass.net/demo/#wsid=CodeCompass&fid=5704517689050331186&select=117|1|118|1¢er=text
This can be followed to ODB's lazy_ptr implementation, where i_.template object_id<O> () yields the segfault:
template <class T>
template <class O>
inline typename object_traits<O>::id_type lazy_shared_ptr<T>::
object_id () const
{
typedef typename object_traits<T>::object_type object_type;
return p_
? object_traits<object_type>::id (*p_)
: i_.template object_id<O> ();
}
https://codecompass.net/demo/#wsid=CodeCompass&fid=12316403250594715644&select=1351|1|1352|1¢er=text
Which finally ends up here (with r being the culprit):
template <typename T>
template <typename O>
inline typename object_traits<O>::id_type lazy_ptr_impl<T>::
object_id () const
{
typedef typename object_traits<T>::id_type id_type;
const id_type& id (*static_cast<const id_type*> (id_));
// Make sure that O' and T's object id types are the same
// (or implicit-convertible). If you get a compile error
// pointing here, then you most likely used a wrong type
// as a template argument in the object_id() call.
//
const typename object_traits<O>::id_type& r (id);
return r;
}
https://codecompass.net/demo/#wsid=CodeCompass&fid=9722353701976068959&select=395|1|397|1¢er=text
I tried and can parse some other projects, e.g. TinyXML and the first 23 TU's were parsed correctly even for CodeCompass.
With the current state of the
masterbranch I tried to parse CodeCompass itself (the same state of the master branch).I get the following segfault:
I have debugged that the segfault occurs in the
getMangledName()function, here, whenfileLoc_.file.object_id()gets evaluated:https://codecompass.net/demo/#wsid=CodeCompass&fid=5704517689050331186&select=117|1|118|1¢er=text
This can be followed to ODB's
lazy_ptrimplementation, wherei_.template object_id<O> ()yields the segfault:https://codecompass.net/demo/#wsid=CodeCompass&fid=12316403250594715644&select=1351|1|1352|1¢er=text
Which finally ends up here (with
rbeing the culprit):https://codecompass.net/demo/#wsid=CodeCompass&fid=9722353701976068959&select=395|1|397|1¢er=text
I tried and can parse some other projects, e.g. TinyXML and the first 23 TU's were parsed correctly even for CodeCompass.