[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#707215: [kdevelop] Crashes when opening some C files



Package: kdevelop
Version: 4:4.3.1-3+b1
Severity: normal

Just updated to new libc+libstdc++ and it now starts to crash everytime I open
a project with many C files. The culprit seems to be the cpp parser:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffb6ffd700 (LWP 25512)]
0x00007ffff507d295 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff507d295 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff5080438 in __GI_abort () at abort.c:90
#2  0x00007ffff545a495 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff5458606 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff5458633 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff545885e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff5458d5d in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007fffbc48ce7d in ?? () from /usr/lib/libkdev4cppparser.so
#8  0x00007fffbc4a0658 in std::_Hashtable<unsigned int, std::pair<unsigned int const, Parser::TokenMarkers>, std::allocator<std::pair<unsigned int const, Parser::TokenMarkers> >, std::_Select1st<std::pair<unsigned int const, Parser::TokenMarkers> >, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, false, false, true>::_M_rehash_aux(unsigned long, std::integral_constant<bool, true>) ()
   from /usr/lib/libkdev4cppparser.so
#9  0x00007fffbc4a0794 in std::__detail::_Node_iterator<std::pair<unsigned int const, Parser::TokenMarkers>, false, false> std::_Hashtable<unsigned int, std::pair<unsigned int const, Parser::TokenMarkers>, std::allocator<std::pair<unsigned int const, Parser::TokenMarkers> >, std::_Select1st<std::pair<unsigned int const, Parser::TokenMarkers> >, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, false, false, true>::_M_insert_bucket<std::pair<unsigned int, Parser::TokenMarkers> >(std::pair<unsigned int, Parser::TokenMarkers>&&, unsigned long, unsigned long) () from /usr/lib/libkdev4cppparser.so
#10 0x00007fffbc48f658 in Parser::addTokenMarkers(unsigned int, Parser::TokenMarkers) () from /usr/lib/libkdev4cppparser.so
#11 0x00007fffbc49314d in Parser::parseUnqualifiedName(UnqualifiedNameAST*&, bool) () from /usr/lib/libkdev4cppparser.so
#12 0x00007fffbc49493b in Parser::parseName(NameAST*&, Parser::ParseNameAcceptTemplate) () from /usr/lib/libkdev4cppparser.so
#13 0x00007fffbc492bcb in Parser::parseSimpleTypeSpecifier(TypeSpecifierAST*&, bool) () from /usr/lib/libkdev4cppparser.so
#14 0x00007fffbc4954df in Parser::parseTypeSpecifier(TypeSpecifierAST*&) () from /usr/lib/libkdev4cppparser.so
#15 0x00007fffbc498547 in Parser::parseCondition(ConditionAST*&, bool) () from /usr/lib/libkdev4cppparser.so
#16 0x00007fffbc49bde3 in Parser::parseIfStatement(StatementAST*&) () from /usr/lib/libkdev4cppparser.so
#17 0x00007fffbc48fbe5 in Parser::parseStatement(StatementAST*&) () from /usr/lib/libkdev4cppparser.so
#18 0x00007fffbc48fdb6 in Parser::parseCompoundStatement(StatementAST*&) () from /usr/lib/libkdev4cppparser.so
#19 0x00007fffbc49950c in Parser::parseFunctionDefinitionInternal(DeclarationAST*&, unsigned int, WinDeclSpecAST*, ListNode<unsigned int> const*, ListNode<unsigned int> const*, TypeSpecifierAST*) () from /usr/lib/libkdev4cppparser.so
#20 0x00007fffbc49984d in Parser::parseDeclarationInternal(DeclarationAST*&) () from /usr/lib/libkdev4cppparser.so
#21 0x00007fffbc49a8ac in Parser::parseDeclaration(DeclarationAST*&) () from /usr/lib/libkdev4cppparser.so
#22 0x00007fffbc49b319 in Parser::parseTranslationUnit(TranslationUnitAST*&) () from /usr/lib/libkdev4cppparser.so
#23 0x00007fffbc49b42b in Parser::parse(ParseSession*) () from /usr/lib/libkdev4cppparser.so
#24 0x00007fffbcc53161 in ?? () from /usr/lib/kde4/kdevcpplanguagesupport.so
#25 0x00007fffedd581ba in ?? () from /usr/lib/libthreadweaver.so.4
#26 0x00007fffedd58331 in ThreadWeaver::Job::execute(ThreadWeaver::Thread*) () from /usr/lib/libthreadweaver.so.4
#27 0x00007fffedd59343 in ?? () from /usr/lib/libthreadweaver.so.4
#28 0x00007fffedd5798f in ?? () from /usr/lib/libthreadweaver.so.4
#29 0x00007fffedd57a4b in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#30 0x00007ffff6435d0b in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#31 0x00007ffff44a8e0e in start_thread (arg=0x7fffb6ffd700) at pthread_create.c:311
#32 0x00007ffff513093d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113


Here the output of valgrind

==25524== Warning: set address range perms: large range [0x3a0a6000, 0x7a0a6000) (defined)
==25524== Invalid read of size 8
==25524==    at 0x6A2FB8A: ??? (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6BFA00C: ??? (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6C03B75: ??? (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6B8666C: QPainter::drawPixmap(QPointF const&, QPixmap const&) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x197F775A: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x197CEA84: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x197CF5BD: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x197CC903: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x6E7BC14: QProgressBar::paintEvent(QPaintEvent*) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6A86DC1: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6E7C6F6: QProgressBar::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6A3770B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==  Address 0x1962ff48 is 0 bytes after a block of size 728 alloc'd
==25524==    at 0x4C2C26B: malloc (vg_replace_malloc.c:270)
==25524==    by 0x6AEE8E5: QImageData::create(QSize const&, QImage::Format, int) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6AEEE1A: QImage::QImage(int, int, QImage::Format) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6B160C6: QRasterPixmapData::resize(int, int) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6B0E67E: QPixmapData::create(int, int, QPixmapData::PixelType) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6B06DE6: QPixmap::init(int, int, int) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x6B08167: QPixmap::QPixmap(QSize const&) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524==    by 0x197F72FD: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x197CEA84: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x197CF5BD: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x197CC903: ??? (in /usr/lib/kde4/plugins/styles/oxygen.so)
==25524==    by 0x6E7BC14: QProgressBar::paintEvent(QPaintEvent*) (in /usr/lib/x86_64-linux-gnu/libQtGui.so.4.8.2)
==25524== 
**25524** new/new[] failed and should throw an exception, but Valgrind
**25524**    cannot throw exceptions and so is aborting instead.  Sorry.
==25524==    at 0x4C2958C: VALGRIND_PRINTF_BACKTRACE (valgrind.h:4550)
==25524==    by 0x4C2BD16: operator new(unsigned long) (vg_replace_malloc.c:298)
==25524==    by 0x7B6FAE7C: ??? (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B70E657: std::_Hashtable<unsigned int, std::pair<unsigned int const, Parser::TokenMarkers>, std::allocator<std::pair<unsigned int const, Parser::TokenMarkers> >, std::_Select1st<std::pair<unsigned int const, Parser::TokenMarkers> >, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, false, false, true>::_M_rehash_aux(unsigned long, std::integral_constant<bool, true>) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B70E793: std::__detail::_Node_iterator<std::pair<unsigned int const, Parser::TokenMarkers>, false, false> std::_Hashtable<unsigned int, std::pair<unsigned int const, Parser::TokenMarkers>, std::allocator<std::pair<unsigned int const, Parser::TokenMarkers> >, std::_Select1st<std::pair<unsigned int const, Parser::TokenMarkers> >, std::equal_to<unsigned int>, std::hash<unsigned int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, false, false, true>::_M_insert_bucket<std::pair<unsigned int, Parser::TokenMarkers> >(std::pair<unsigned int, Parser::TokenMarkers>&&, unsigned long, unsigned long) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B6FD657: Parser::addTokenMarkers(unsigned int, Parser::TokenMarkers) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B70114C: Parser::parseUnqualifiedName(UnqualifiedNameAST*&, bool) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B70293A: Parser::parseName(NameAST*&, Parser::ParseNameAcceptTemplate) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B700BCA: Parser::parseSimpleTypeSpecifier(TypeSpecifierAST*&, bool) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B7034DE: Parser::parseTypeSpecifier(TypeSpecifierAST*&) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B706546: Parser::parseCondition(ConditionAST*&, bool) (in /usr/lib/libkdev4cppparser.so)
==25524==    by 0x7B709DE2: Parser::parseIfStatement(StatementAST*&) (in /usr/lib/libkdev4cppparser.so)

An example C file with this problem is attached (seems to be related to the
if expression parsing).

--- System information. ---
Architecture: amd64
Kernel:       Linux 3.8-1-amd64

Debian Release: jessie/sid
  500 unstable        http.debian.net 
  500 testing         www.deb-multimedia.org 
  500 stable          security.debian.org 
  500 stable          http.debian.net 
    1 experimental    http.debian.net 

--- Package information. ---
Depends                                       (Version) | Installed
=======================================================-+-======================
kde-runtime                                             | 4:4.10.2-2
kdevplatform5-libs                           (>= 1.3.1) | 1.3.1-2
libc6                                          (>= 2.4) | 
libgcc1                                    (>= 1:4.1.1) | 
libkasten1controllers1                     (>= 4:4.8.4) | 
libkasten1core1                            (>= 4:4.8.4) | 
libkasten1okteta1controllers1              (>= 4:4.8.4) | 
libkasten1okteta1core1                     (>= 4:4.8.4) | 
libkasten1okteta1gui1                      (>= 4:4.8.4) | 
libkcmutils4                              (>= 4:4.4.95) | 
libkdecore5                               (>= 4:4.4.95) | 
libkdeui5                                  (>= 4:4.3.4) | 
libkio5                                    (>= 4:4.3.4) | 
libkparts4                                 (>= 4:4.3.4) | 
libktexteditor4                           (>= 4:4.4.95) | 
libplasma3                              (>= 4:4.4.4-2~) | 
libprocessui4a                             (>= 4:4.6.1) | 
libqt4-dbus                                (>= 4:4.6.1) | 
libqt4-help                                (>= 4:4.5.3) | 
libqt4-network                             (>= 4:4.5.3) | 
libqt4-script                              (>= 4:4.5.3) | 
libqtcore4                                 (>= 4:4.8.0) | 
libqtgui4                                  (>= 4:4.5.3) | 
libqtwebkit4                      (>= 2.1.0~2011week13) | 
libstdc++6                                     (>= 4.6) | 
libsublime5                                  (>= 1.3.1) | 
libthreadweaver4                           (>= 4:4.3.4) | 
kdevelop-data                            (>= 4:4.3.1-3) | 


Recommends      (Version) | Installed
=========================-+-===========
gcc                       | 4:4.7.2-1
g++                       | 4:4.7.2-1
make                      | 3.81-8.2
gdb              (>= 7.0) | 7.4.1+dfsg-0.1


Suggests           (Version) | Installed
============================-+-===========
cmake                        | 2.8.9-1
kapptemplate                 | 4:4.8.4+dfsg-1
kdevelop-l10n                | 
int main(int argc, char *argv[])
{
	if (argc < 1)
		return 1;

	return 0;
}

Reply to: