Summary: | KDevelop crash on close [Cpp::MissingDeclarationProblem::~MissingDeclarationProblem / Cpp::MissingDeclarationType::~MissingDeclarationType] | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Manu <manuavazquez> |
Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | aleixpol, benoit.leffray.kde, bugs, dichlofos-mv, glad08, hannu.alamaki, kde, kde, kdebugs, kfunk, l.jirkovsky, lfdominguez, msoos, nhaehnle, stompdagger1, tim, tomek-k, urban82, vdm-photo |
Priority: | HI | ||
Version: | 4.2.2 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi New crash information added by DrKonqi New crash information added by DrKonqi New crash information added by DrKonqi |
Description
Manu
2011-12-15 18:31:36 UTC
*** Bug 311192 has been marked as a duplicate of this bug. *** Please try to reproduce with full debug info and current Git master. IIRC this was a random problem, I'm not able to reproduce it. Hmm, i just experienced this crash after closing KDevelop, using current Git master. Here's the backtrace: [KCrash Handler] #5 0x00007f1eaab1a425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #6 0x00007f1eaab1db8b in __GI_abort () at abort.c:91 #7 0x00007f1eaab5839e in __libc_message (do_abort=2, fmt=0x7f1eaac62028 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:201 #8 0x00007f1eaab62b96 in malloc_printerr (action=3, str=0x7f1eaac5e933 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:5007 #9 0x00007f1ea7d5f679 in KDevelop::ReferenceType::~ReferenceType (this=0x7f1d80fb00a0, __in_chrg=<optimized out>) at /home/krf/devel/src/kdevplatform/language/duchain/types/referencetype.cpp:67 #10 0x00007f1e743f500c in QList<Cpp::OverloadResolver::Parameter>::node_destruct (from=0x7f1d80db8618, to=0x7f1d80db8620, this=<optimized out>) at /home/krf/devel/build/qt4.8-shared-debug/include/QtCore/../../../../src/qt/src/corelib/tools/qlist.h:431 #11 0x00007f1e743f504b in QList<Cpp::OverloadResolver::Parameter>::free (data=0x7f1d80db8600, this=<optimized out>) at /home/krf/devel/build/qt4.8-shared-debug/include/QtCore/../../../../src/qt/src/corelib/tools/qlist.h:757 #12 0x00007f1e743f519b in Cpp::MissingDeclarationType::~MissingDeclarationType (this=0x7f1d803d0f80, __in_chrg=<optimized out>) at /home/krf/devel/src/kdevelop/languages/cpp/cppduchain/missingdeclarationtype.h:33 #13 0x00007f1e743f51c9 in Cpp::MissingDeclarationType::~MissingDeclarationType (this=0x7f1d803d0f80, __in_chrg=<optimized out>) at /home/krf/devel/src/kdevelop/languages/cpp/cppduchain/missingdeclarationtype.h:33 #14 0x00007f1e743f553b in Cpp::MissingDeclarationProblem::~MissingDeclarationProblem (this=0x7f1d80ae41a0, __in_chrg=<optimized out>) at /home/krf/devel/src/kdevelop/languages/cpp/cppduchain/missingdeclarationproblem.h:29 #15 0x00007f1e743f5559 in Cpp::MissingDeclarationProblem::~MissingDeclarationProblem (this=0x7f1d80ae41a0, __in_chrg=<optimized out>) at /home/krf/devel/src/kdevelop/languages/cpp/cppduchain/missingdeclarationproblem.h:29 #16 0x00007f1ea7c9c10c in QList<KSharedPtr<KDevelop::Problem> >::node_destruct (from=0x7f1d80b69d08, to=0x7f1d80b6a118, this=<optimized out>) at /home/krf/devel/build/qt4.8-shared-debug/include/QtCore/../../../../src/qt/src/corelib/tools/qlist.h:431 #17 0x00007f1ea7c9c14b in QList<KSharedPtr<KDevelop::Problem> >::free (data=0x7f1d80b69cf0, this=<optimized out>) at /home/krf/devel/build/qt4.8-shared-debug/include/QtCore/../../../../src/qt/src/corelib/tools/qlist.h:757 #18 0x00007f1ea7ce8a56 in KDevelop::TopDUContextLocalPrivate::~TopDUContextLocalPrivate (this=0x89f2470, __in_chrg=<optimized out>) at /home/krf/devel/src/kdevplatform/language/duchain/topducontext.cpp:129 #19 0x00007f1ea7ce442f in KDevelop::TopDUContext::deleteSelf (this=<optimized out>) at /home/krf/devel/src/kdevplatform/language/duchain/topducontext.cpp:726 #20 0x00007f1ea7cc728e in KDevelop::DUChainPrivate::removeDocumentChainFromMemory (this=this@entry=0x27b5190, context=0x89717f0) at /home/krf/devel/src/kdevplatform/language/duchain/duchain.cpp:410 #21 0x00007f1ea7cc83e3 in KDevelop::DUChainPrivate::clear (this=0x27b5190) at /home/krf/devel/src/kdevplatform/language/duchain/duchain.cpp:373 #22 0x00007f1ea7cb490a in KDevelop::DUChain::aboutToQuit (this=this@entry=0x27ab390) at /home/krf/devel/src/kdevplatform/language/duchain/duchain.cpp:1619 #23 0x00007f1ea7cb4f02 in KDevelop::DUChain::qt_static_metacall (_o=0x27ab390, _c=<optimized out>, _id=7, _a=0x7fff8fc45d30) at /home/krf/devel/build/kdevplatform/language/duchain.moc:146 #24 0x00007f1eac450866 in QMetaObject::activate (sender=0x7fff8fc46210, m=0x7f1eac7f26e0 <QCoreApplication::staticMetaObject>, local_signal_index=0, argv=0x0) at /home/krf/devel/src/qt/src/corelib/kernel/qobject.cpp:3539 #25 0x00007f1eac4b1c29 in QCoreApplication::aboutToQuit (this=0x7fff8fc46210) at .moc/debug-shared/moc_qcoreapplication.cpp:145 #26 0x00007f1eac432167 in QCoreApplication::exec () at /home/krf/devel/src/qt/src/corelib/kernel/qcoreapplication.cpp:1223 #27 0x00007f1eab40b24a in QApplication::exec () at /home/krf/devel/src/qt/src/gui/kernel/qapplication.cpp:3823 #28 0x000000000040d60b in main (argc=<optimized out>, argv=<optimized out>) at /home/krf/devel/src/kdevelop/app/main.cpp:506 Still a problem, reopening *** Bug 313515 has been marked as a duplicate of this bug. *** *** Bug 286093 has been marked as a duplicate of this bug. *** *** Bug 314252 has been marked as a duplicate of this bug. *** Kevin, please leave the title - the duplicates show crashes in other types but the common denominator is the MissingDeclarationProblem. Created attachment 76907 [details]
New crash information added by DrKonqi
kdevelop (4.5.60) on KDE Platform 4.9.5 using Qt 4.8.2
- What I was doing when the application crashed:
I closed a KDevelop session, while another, different session was still open.
-- Backtrace (Reduced):
#6 0x00007fc94a0630c5 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7 0x00007fc94a0661eb in __GI_abort () at abort.c:90
[...]
#9 0x00007fc94a0a9956 in malloc_printerr (action=3, str=0x7fc94a197ff4 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:4902
#10 0x00007fc94a0aa750 in _int_free (av=0x7fc94a3d6640, p=0x7fc83442af4a, have_lock=0) at malloc.c:3758
#11 0x00007fc94774e019 in KDevelop::ReferenceType::~ReferenceType (this=0x7fc8352bb7c0, __in_chrg=<optimized out>) at ../../language/duchain/types/referencetype.cpp:67
*** Bug 319778 has been marked as a duplicate of this bug. *** I have just been hit by this crash as well. In my case, glibc malloc detected an invalid pointer to free. I am running fairly recent kdevplatform and kdevelop from Git master; kdevplatform from June 10th, kdevelop from June 4th. Here's the backtrace: #3 malloc_printerr() at malloc.c:5018 #4 KDevelop::EnumeratorType::~EnumeratorType() at /home/haehnle/software/kdevelop/kdevplatform/language/duchain/types/enumeratortype.h:36 #5 QList<Cpp::OverloadResolver::Parameter>::node_destruct() at /usr/include/qt4/QtCore/qlist.h:431 #6 QList<Cpp::OverloadResolver::Parameter>::free() at /usr/include/qt4/QtCore/qlist.h:757 #7 Cpp::MissingDeclarationType::~MissingDeclarationType() at /home/haehnle/software/kdevelop/kdevelop/languages/cpp/cppduchain/missingdeclarationtype.h:33 #8 Cpp::MissingDeclarationType::~MissingDeclarationType() at /home/haehnle/software/kdevelop/kdevelop/languages/cpp/cppduchain/missingdeclarationtype.h:33 #9 Cpp::MissingDeclarationProblem::~MissingDeclarationProblem() at /home/haehnle/software/kdevelop/kdevelop/languages/cpp/cppduchain/missingdeclarationproblem.h:29 #10 Cpp::MissingDeclarationProblem::~MissingDeclarationProblem() at /home/haehnle/software/kdevelop/kdevelop/languages/cpp/cppduchain/missingdeclarationproblem.h:29 #11 QList<KSharedPtr<KDevelop::Problem> >::node_destruct() at /usr/include/qt4/QtCore/qlist.h:431 #12 QList<KSharedPtr<KDevelop::Problem> >::free() at /usr/include/qt4/QtCore/qlist.h:757 #13 KDevelop::TopDUContextLocalPrivate::~TopDUContextLocalPrivate() at /home/haehnle/software/kdevelop/kdevplatform/language/duchain/topducontext.cpp:129 #14 KDevelop::TopDUContext::deleteSelf() at /home/haehnle/software/kdevelop/kdevplatform/language/duchain/topducontext.cpp:726 #15 KDevelop::DUChainPrivate::removeDocumentChainFromMemory() at /home/haehnle/software/kdevelop/kdevplatform/language/duchain/duchain.cpp:410 #16 KDevelop::DUChainPrivate::clear() at /home/haehnle/software/kdevelop/kdevplatform/language/duchain/duchain.cpp:373 #17 KDevelop::DUChain::shutdown() at /home/haehnle/software/kdevelop/kdevplatform/language/duchain/duchain.cpp:1617 #18 KDevelop::Core::cleanup() at /home/haehnle/software/kdevelop/kdevplatform/shell/core.cpp:421 I have now been able to trigger the same issue while running Valgrind. This is a RelWithDebInfo build, and it looks like parts of the call history are inlined so they don't appear in the call stack. ==2175== Thread 1: ==2175== Invalid free() / delete / delete[] / realloc() ==2175== at 0x4C2A09C: operator delete[](void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2175== by 0xAA5D158: KDevelop::EnumeratorType::~EnumeratorType() (constantintegraltype.h:39) ==2175== by 0x3982ADD6: QList<Cpp::OverloadResolver::Parameter>::~QList() (typepointer.h:81) ==2175== by 0x3982AE6A: Cpp::MissingDeclarationType::~MissingDeclarationType() (missingdeclarationtype.h:33) ==2175== by 0x3982B084: Cpp::MissingDeclarationProblem::~MissingDeclarationProblem() (typepointer.h:81) ==2175== by 0xA9C1056: _ZN5QListI10KSharedPtrIN8KDevelop7ProblemEEE4freeEPN9QListData4DataE.isra.144 (ksharedptr.h:90) ==2175== by 0xA9C4ECC: KDevelop::TopDUContextLocalPrivate::~TopDUContextLocalPrivate() (topducontext.cpp:129) ==2175== by 0xA9C258A: KDevelop::TopDUContext::deleteSelf() (topducontext.cpp:726) ==2175== by 0xA9A8632: KDevelop::DUChainPrivate::clear() (duchain.cpp:410) ==2175== by 0xA996EDD: KDevelop::DUChain::shutdown() (duchain.cpp:1617) ==2175== by 0x55B247C: KDevelop::Core::cleanup() (core.cpp:421) ==2175== by 0x55B258C: KDevelop::Core::shutdown() (core.cpp:382) ==2175== Address 0x43007f5e is 52,894 bytes inside a block of size 65,536 alloc'd ==2175== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2175== by 0xAA69976: KDevelop::TypeRepository::increaseReferenceCount(unsigned int, KDevelop::ReferenceCountManager*) (itemrepository.h:1065) ==2175== by 0xAA4776F: KDevelop::InstantiationInformation::InstantiationInformation(KDevelop::InstantiationInformation const&, bool) (instantiationinformation.h:131) ==2175== by 0xAA4CAEC: KDevelop::ItemRepository<KDevelop::InstantiationInformation, KDevelop::AppendedListItemRequest<KDevelop::InstantiationInformation, 8u>, true, true, 0u, 1048576u>::index(KDevelop::AppendedListItemRequest<KDevelop::InstantiationInformation, 8u> const&) (appendedlist.h:369) ==2175== by 0xAA490F4: KDevelop::InstantiationInformation::indexed() const (instantiationinformation.cpp:190) ==2175== by 0x39897467: Cpp::TemplateDeclaration::instantiate(KDevelop::InstantiationInformation const&, KDevelop::TopDUContext const*, bool) (templatedeclaration.cpp:964) ==2175== by 0x3988B915: Cpp::FindDeclaration::instantiateDeclaration(KDevelop::Declaration*, KDevelop::InstantiationInformation const&) const (cppducontext.cpp:125) ==2175== by 0x3988CC2F: Cpp::FindDeclaration::closeIdentifier(bool) (cppducontext.cpp:273) ==2175== by 0x398C5BE0: _ZN14NameASTVisitor20visitUnqualifiedNameEP18UnqualifiedNameAST.part.60 (name_visitor.cpp:90) ==2175== by 0x39B1F765: DefaultVisitor::visitName(NameAST*) (visitor.h:139) ==2175== by 0x398C440B: NameASTVisitor::run(NameAST*, bool) (name_visitor.cpp:287) ==2175== by 0x398C7CEB: TypeASTVisitor::visitName(NameAST*) (type_visitor.cpp:308) Created attachment 80601 [details]
New crash information added by DrKonqi
kdevelop (4.5.1) on KDE Platform 4.10.4 using Qt 4.8.4
- What I was doing when the application crashed: I do nothing, just leave running kdevelop for 20 min while I drink coffee
- Unusual behavior I noticed: kdevelop crashes without any actions from my side
-- Backtrace (Reduced):
#6 0x0000003467035ba5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:63
#7 0x0000003467037358 in __GI_abort () at abort.c:90
[...]
#9 0x000000346707ca8e in malloc_printerr (ptr=0x7f575c0c1320, str=0x3467179c00 "double free or corruption (fasttop)", action=3) at malloc.c:4969
#10 _int_free (av=0x7f575c000020, p=0x7f575c0c1310, have_lock=0) at malloc.c:3826
#11 0x000000346f0c5318 in QString::free (d=0x7f575c0c1320) at tools/qstring.cpp:1235
Another observation, without knowing how helpful it may be: KDevelop is particularly crashy in my setup when I have recently created a new source file. The crashes do not always look like the one I posted above, in fact, I often just get a crash with obvious stack corruption, which makes this particularly painful to help to track down. However, after removing the DUChain cache and letting KDevelop re-parse everything, things are stable (or at least much more stable). Given the particular error uncovered by Valgrind in comment #12 - attempting to delete[] something far inside a block - it is tempting to suspect that the bug is related to how the DUChain items are migrated to and from the manual memory management, perhaps in combination with some "generic" memory error somewhere else. However, that code looks like not too well documented magic to me, so I have no idea where to even start. Is there a way to turn all that magic *off* completely? I understand that this might cost some performance, but it might help with (a) narrowing down the scope of the bug and (b) using Valgrind to track down any additional memory errors that may contribute to this bug. *** Bug 323329 has been marked as a duplicate of this bug. *** *** Bug 323999 has been marked as a duplicate of this bug. *** *** Bug 324764 has been marked as a duplicate of this bug. *** *** Bug 326359 has been marked as a duplicate of this bug. *** Could someone with code knowledge have a look into this? There are lots of users affected by this. I tried to fix this a lot of times but could not find anything just by looking at the backtraces. And so far no reproducible test case was found :( *** Bug 327236 has been marked as a duplicate of this bug. *** Created attachment 85076 [details]
New crash information added by DrKonqi
kdevelop (4.6.0) on KDE Platform 4.11.5 using Qt 4.8.5
- What I was doing when the application crashed:
KDevelop crashes after several seconds when I exited
-- Backtrace (Reduced):
#6 0x000000324a8359e9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7 0x000000324a8370f8 in __GI_abort () at abort.c:90
[...]
#9 0x000000324a87d0b8 in malloc_printerr (ptr=<optimized out>, str=0x324a97bc75 "free(): invalid pointer", action=3) at malloc.c:4937
#10 _int_free (av=0x324abba780 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3789
#11 0x0000003dab7589d9 in KDevelop::ReferenceType::~ReferenceType (this=0x7ff4a139a540, __in_chrg=<optimized out>) at /usr/src/debug/kdevplatform-1.6.0/language/duchain/types/referencetype.cpp:67
Created attachment 86825 [details]
New crash information added by DrKonqi
kdevelop (4.6.0) on KDE Platform 4.13.0 using Qt 4.8.6
- What I was doing when the application crashed:
Exited KDevelop by clicking the (X) at the top right corner. One (complicated) project was loaded, but nothing else.
-- Backtrace (Reduced):
#6 0x00007fe32c3b8f79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7 0x00007fe32c3bc388 in __GI_abort () at abort.c:89
[...]
#9 0x00007fe32c4024ae in malloc_printerr (ptr=<optimized out>, str=0x7fe32c500b03 "free(): invalid pointer", action=1) at malloc.c:4996
#10 _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
#11 0x00007fe329946b29 in KDevelop::ReferenceType::~ReferenceType (this=0x7fe202e85cc0, __in_chrg=<optimized out>) at /home/soos/downloads/kdevplatform-1.6.0/language/duchain/types/referencetype.cpp:67
*** Bug 332369 has been marked as a duplicate of this bug. *** *** Bug 337701 has been marked as a duplicate of this bug. *** *** Bug 338431 has been marked as a duplicate of this bug. *** Created attachment 91428 [details]
New crash information added by DrKonqi
kdevelop (4.7.0) on KDE Platform 4.14.2 using Qt 4.8.6
I was haved an only project opened and when i closed kdevelop, crash.
-- Backtrace (Reduced):
#6 0x00007f900bc53107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7 0x00007f900bc544e8 in __GI_abort () at abort.c:89
[...]
#9 0x00007f900bc969de in malloc_printerr (action=1, str=0x7f900bd841c8 "double free or corruption (fasttop)", ptr=<optimized out>) at malloc.c:4996
#10 0x00007f900bc976e6 in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
#11 0x00007f900bc55bc9 in __run_exit_handlers (status=0, listp=0x7f900bfc15a8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
Hello! We are working on a new clang-based C/C++ language plugin for KDevelop 5 which supersedes the old C++ plugin in KDevelop 4. See e.g.: https://www.kdevelop.org/news/first-beta-release-kdevelop-500-available Due to a lack of manpower, we cannot fix bugs in the old C++ plugin. We rather want to supply a good Clang based C++ experience for KDevelop 5 than wasting our time on the legacy C++ support for KDevelop 4. With the new clang-based C/C++ language plugin, the bug presented here does not occur. In my testing. For these reasons, I'll close this bug. Please stay tuned for KDevelop 5. If you think this bug is applicable to Clang/KDevelop 5, please reopen the report and add new information on how to reproduce the bug there. Sorry for the inconvenience, I hope you understand the reasoning above. Cheers |