https://bugs.kde.org/show_bug.cgi?id=360928

            Bug ID: 360928
           Summary: UBSan: util/embeddedfreetree.h:748:24: runtime error:
                    shift exponent 32 is too large for 32-bit type
                    'unsigned int'
           Product: kdevplatform
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: util
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: kf...@kde.org

Looks dangerous enough to report.

/home/kfunk/devel/src/kf5/kdevplatform-stable/util/embeddedfreetree.h:748:24:
runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'
    #0 0x7fc8a9ac28a3 in
KDevelop::EmbeddedTreeRemoveItem<KDevelop::CodeModelItem,
KDevelop::CodeModelItemHandler, 5>::newItemCount() const
/home/kfunk/devel/src/kf5/kdevplatform-stable/util/embeddedfreetree.h:748:24
    #1 0x7fc8a9ab2267 in
KDevelop::CodeModel::removeItem(KDevelop::IndexedString const&,
KDevelop::IndexedQualifiedIdentifier const&)
/home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/codemodel.cpp:336:25
    #2 0x7fc8a9f0172f in KDevelop::Declaration::setInSymbolTable(bool)
/home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/declaration.cpp:630:7
    #3 0x7fc8a9ef1d4f in KDevelop::Declaration::~Declaration()
/home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/declaration.cpp:178:5
    #4 0x7fc8a9ef4176 in KDevelop::Declaration::~Declaration()
/home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/declaration.cpp:165:1
    #5 0x7fc8a9caf886 in KDevelop::DUContext::deleteLocalDeclarations()
/home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/ducontext.cpp:1018:5
    #6 0x7fc8a9cac80b in KDevelop::DUContext::~DUContext()
/home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/ducontext.cpp:442:3
    #7 0x7fc87c9c6360 in ClangDUContext<KDevelop::DUContext,
141>::~ClangDUContext()
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clangducontext.h:29:7
    #8 0x7fc87c9cb5bf in void
qDeleteAll<QTypedArrayData<KDevelop::DUContext*>::const_iterator>(QTypedArrayData<KDevelop::DUContext*>::const_iterator,
QTypedArrayData<KDevelop::DUContext*>::const_iterator)
/usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:317:9
    #9 0x7fc87c9cb1c0 in void qDeleteAll<QVector<KDevelop::DUContext*>
>(QVector<KDevelop::DUContext*> const&)
/usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:325:5
    #10 0x7fc87c942ba9 in (anonymous
namespace)::CurrentContext::~CurrentContext()
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:260:9
    #11 0x7fc87c9379aa in CXChildVisitResult (anonymous
namespace)::Visitor::buildDeclaration<(CXCursorKind)22, KDevelop::Declaration,
true>(CXCursor)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1123:5
    #12 0x7fc87c9379aa in CXChildVisitResult (anonymous
namespace)::Visitor::dispatchCursor<(CXCursorKind)22, (Decision)1, (Decision)0,
(detail::enabler)0>(CXCursor, CXCursor)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:881
    #13 0x7fc87c9379aa in (anonymous namespace)::visitCursor(CXCursor,
CXCursor, void*)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1411
    #14 0x7fc87c40355a in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:208:11
    #15 0x7fc87c4057b4 in
clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:654:9
    #16 0x7fc87c404e12 in
clang::cxcursor::CursorVisitor::VisitLinkageSpecDecl(clang::LinkageSpecDecl*)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:1439:10
    #17 0x7fc87c404e12 in
clang::declvisitor::Base<clang::declvisitor::make_ptr,
clang::cxcursor::CursorVisitor, bool>::Visit(clang::Decl*)
/home/kfunk/devel/build/llvm/tools/clang/include/clang/AST/DeclNodes.inc:83
    #18 0x7fc87c403c66 in
clang::cxcursor::CursorVisitor::VisitChildren(CXCursor)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:497:34
    #19 0x7fc87c40e6b4 in clang_visitChildren
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:4008:10
    #20 0x7fc87c937996 in CXChildVisitResult (anonymous
namespace)::Visitor::buildDeclaration<(CXCursorKind)22, KDevelop::Declaration,
true>(CXCursor)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1121:9
    #21 0x7fc87c937996 in CXChildVisitResult (anonymous
namespace)::Visitor::dispatchCursor<(CXCursorKind)22, (Decision)1, (Decision)0,
(detail::enabler)0>(CXCursor, CXCursor)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:881
    #22 0x7fc87c937996 in (anonymous namespace)::visitCursor(CXCursor,
CXCursor, void*)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1411
    #23 0x7fc87c40355a in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:208:11
    #24 0x7fc87c4057b4 in
clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:654:9
    #25 0x7fc87c404e12 in
clang::cxcursor::CursorVisitor::VisitLinkageSpecDecl(clang::LinkageSpecDecl*)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:1439:10
    #26 0x7fc87c404e12 in
clang::declvisitor::Base<clang::declvisitor::make_ptr,
clang::cxcursor::CursorVisitor, bool>::Visit(clang::Decl*)
/home/kfunk/devel/build/llvm/tools/clang/include/clang/AST/DeclNodes.inc:83
    #27 0x7fc87c403c66 in
clang::cxcursor::CursorVisitor::VisitChildren(CXCursor)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:497:34
    #28 0x7fc87c40e6b4 in clang_visitChildren
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:4008:10
    #29 0x7fc87c937996 in CXChildVisitResult (anonymous
namespace)::Visitor::buildDeclaration<(CXCursorKind)22, KDevelop::Declaration,
true>(CXCursor)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1121:9
    #30 0x7fc87c937996 in CXChildVisitResult (anonymous
namespace)::Visitor::dispatchCursor<(CXCursorKind)22, (Decision)1, (Decision)0,
(detail::enabler)0>(CXCursor, CXCursor)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:881
    #31 0x7fc87c937996 in (anonymous namespace)::visitCursor(CXCursor,
CXCursor, void*)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1411
    #32 0x7fc87c40355a in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:208:11
    #33 0x7fc87c4057b4 in
clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:654:9
    #34 0x7fc87c403fd5 in
clang::cxcursor::CursorVisitor::VisitChildren(CXCursor)
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:529:20
    #35 0x7fc87c40e6b4 in clang_visitChildren
/home/kfunk/devel/src/llvm/tools/clang/tools/libclang/CIndex.cpp:4008:10
    #36 0x7fc87c927420 in (anonymous
namespace)::Visitor::Visitor(CXTranslationUnitImpl*, void*, QHash<void*,
KDevelop::ReferencedTopDUContext> const&, bool)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1325:5
    #37 0x7fc87c927420 in Builder::visit(CXTranslationUnitImpl*, void*,
QHash<void*, KDevelop::ReferencedTopDUContext> const&, bool)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/builder.cpp:1463
    #38 0x7fc87c9fa8d4 in ClangHelpers::buildDUChain(void*, QMultiHash<void*,
Import> const&, ParseSession const&, KDevelop::TopDUContext::Features,
QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*,
std::function<bool ()> const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clanghelpers.cpp:182:5
    #39 0x7fc87c9f97a9 in ClangHelpers::buildDUChain(void*, QMultiHash<void*,
Import> const&, ParseSession const&, KDevelop::TopDUContext::Features,
QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*,
std::function<bool ()> const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clanghelpers.cpp:113:9
    #40 0x7fc87c9f97a9 in ClangHelpers::buildDUChain(void*, QMultiHash<void*,
Import> const&, ParseSession const&, KDevelop::TopDUContext::Features,
QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*,
std::function<bool ()> const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clanghelpers.cpp:113:9
    #41 0x7fc87c9f97a9 in ClangHelpers::buildDUChain(void*, QMultiHash<void*,
Import> const&, ParseSession const&, KDevelop::TopDUContext::Features,
QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*,
std::function<bool ()> const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clanghelpers.cpp:113:9
    #42 0x7fc87c9f97a9 in ClangHelpers::buildDUChain(void*, QMultiHash<void*,
Import> const&, ParseSession const&, KDevelop::TopDUContext::Features,
QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*,
std::function<bool ()> const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clanghelpers.cpp:113:9
    #43 0x7fc87c9f97a9 in ClangHelpers::buildDUChain(void*, QMultiHash<void*,
Import> const&, ParseSession const&, KDevelop::TopDUContext::Features,
QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*,
std::function<bool ()> const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clanghelpers.cpp:113:9
    #44 0x7fc87ce48e9e in
ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>,
ThreadWeaver::Thread*)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/clangparsejob.cpp:316:20
    #45 0x7fc87ce4b91c in non-virtual thunk to
ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>,
ThreadWeaver::Thread*)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/clangparsejob.cpp:215:21
    #46 0x7fc8a7ff364f in
ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>,
ThreadWeaver::Thread*)
(/usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5+0x1664f)
    #47 0x7fc8a7ff3c8f in
ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&,
ThreadWeaver::Thread*)
(/usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5+0x16c8f)
    #48 0x7fc8a7ff27df in
ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&,
ThreadWeaver::Thread*)
(/usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5+0x157df)
    #49 0x7fc8a7ff2289 in ThreadWeaver::Thread::run()
(/usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5+0x15289)
    #50 0x7fc8aeb0a7fd  (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0xa57fd)
    #51 0x7fc8ae1bc6f9 in start_thread
(/lib/x86_64-linux-gnu/libpthread.so.0+0x76f9)
    #52 0x7fc8ad8cf2dc in clone
/build/glibc-ALbY7_/glibc-2.23/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:109

SUMMARY: AddressSanitizer: undefined-behavior
/home/kfunk/devel/src/kf5/kdevplatform-stable/util/embeddedfreetree.h:748:24 in

Reproducible: Always

Steps to Reproduce:
Import heaptrack.git

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to