Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 259094 - dev-util/kdevelop-3.5.4 freezes when loading a C++ project
Summary: dev-util/kdevelop-3.5.4 freezes when loading a C++ project
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-15 14:23 UTC by Albert Zeyer
Modified: 2009-05-02 17:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gdb backtrace of all threads (kdevelop freezes,30.20 KB, text/plain)
2009-02-15 14:27 UTC, Albert Zeyer
Details
gdb backtrace of all threads (kdevelop freezes 2,32.72 KB, text/plain)
2009-02-15 14:35 UTC, Albert Zeyer
Details
console output up to freeze (kdevelop freezes stdout,218.97 KB, text/plain)
2009-02-15 15:10 UTC, Albert Zeyer
Details
kdevelop-3.5.0-lexer.patch (kdevelop-3.5.0-lexer.patch,509 bytes, patch)
2009-02-15 18:24 UTC, Albert Zeyer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Zeyer 2009-02-15 14:23:56 UTC
I was just loading some of my C++ projects and kdevelop freezes, e.g. did not respond anymore.
Comment 1 Albert Zeyer 2009-02-15 14:24:12 UTC
acompneu ~ # emerge --info
Portage 2.2_rc23 (default/linux/x86/2008.0/desktop, gcc-4.3.2, glibc-2.6.1-r0, 2.6.27-gentoo-r8 i686)
=================================================================
System uname: Linux-2.6.27-gentoo-r8-i686-Intel-R-_Core-TM-2_CPU_E8500_@_3.16GHz-with-glibc2.0
Timestamp of tree: Sun, 15 Feb 2009 12:10:03 +0000
distcc 3.0 i686-pc-linux-gnu [disabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
dev-util/cmake:      2.4.8
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -ggdb -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=nocona -ggdb -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="candy distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/mpd /usr/portage/local/private"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="GAPING_SECURITY_HOLE X X509 a52 aac aalib acl acpi acpi4linux adns agg aiglx alsa amd amuled ao aqua_theme archive ares asf asm async asyncns atm auctex automount avahi bash-completion berkdb bidi binary binary-drivers bindist bittorrent bl bonjour bookmarks bootsplash branding bzip2 bzlib cairo captury cdda cddb cdio cdparanoia cdr cdrom cgi cli clisp clucene cmake codecs corba cracklib crypt cups curl custreloc d daap dbus dedicated dga dhcp dirac disk-partition divx4linux dlopen dmi dnd dri dts dv dvd dvdnav dvdr dvdread eds emboss encode esd evo exif faad fam fame ffmpeg firefox flac flash font-server foomaticdb fortran fpx freetype ftp fuse galago gcj gcl gd gdbm ggi gif gimp gl glib glitz glslideshow glut gnome gnutls gphoto2 gpm gprof graphviz gs gsm gstreamer gtk gtk2 gzip h323 hal haskell howl howl-compat html httpd hyperestraier iconv icq id3 id3tag imagemagick imap imlib imlib2 inotify insecure-drivers ipv6 isdnlog ithreads jack java jbig jikes jit jpeg jpeg2k kde kde4 kerberos lame latex lcms ldap libcaca libffi libnotify libwww linuxthreads-tls live lzo mad matroska mbox mdnsresponder-compat midi mikmod mjpeg mmx mmxext mng mod modplug mozbranding mozcalendar mozilla mp2 mp3 mp4 mp4live mpeg mpeg2 mpeg4 mplayer mppe-mppc mudflap multislot musepack musicbrainz mysql nautilus ncurses nemesi nepomuk net network njb nls nntp nptl nptlonly nsplugin ntfs objc offensive ogg oggvorbis openal opengl openmp oss pam pascal pch pcre pdf perl php plasma png pop posix ppds pppd prebuilt-system pthreads pulseaudio python qt qt3 qt3support qt4 quicktime rar rdesktop readline realmedia reflection rogue rplay rtc rtsp ruby samba sasl schroedinger screen sdl semantic-desktop server session shorten shout silvercity silverxp skins slp sndfile sockets socks5 solver speedo speex spell spl sqlite srt sse sse2 ssh ssl ssse3 startup-notification stream subversion svg sysfs tagwriting tcltk tcpd teamarena teletext tetex tga themes theora threads threadsafe thumbnail tiff transcode truetype type1 unicode unzip urandom usb v4l v4l2 vcd vdr vidix visualization vlm vorbis win32codecs wma wmf wxwindows x264 x86 xanim xatrix xattr xcb xcomposite xext xface xforms xine xml xorg xosd xpm xprint xrandr xrender xscreensaver xsettings xterm xulrunner xv xvid xvmc zeroconf zip zlib zvbi" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="nvidia nv apm"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 2 Albert Zeyer 2009-02-15 14:27:34 UTC
Created attachment 182130 [details]
gdb backtrace of all threads

GDB backtrace when I attach to the hanging process.
Comment 3 Albert Zeyer 2009-02-15 14:35:04 UTC
Created attachment 182132 [details]
gdb backtrace of all threads

Tried it again with the same project. This time it loaded fine and I started a build, though after perhaps 10 seconds it was hanging again.
Comment 4 Albert Zeyer 2009-02-15 14:36:22 UTC
I think the hanging thread is the one with the Lexer and the Lexer is stucked.
Comment 5 Albert Zeyer 2009-02-15 14:46:00 UTC
kdevelop is also consuming 100% CPU while it hangs.
Comment 6 Albert Zeyer 2009-02-15 15:10:22 UTC
Created attachment 182134 [details]
console output up to freeze

This is the console output up to the point where it freezes.

Note that it loads first another C++ project which loads fine. Then I try to load the problematic C++ project (openlierox/Project.kdevelop) and it hangs.

Note also that the loading bar gets always stucked at about 30%-50% in the problematic project. Mostly it freezes when I type anything in the editor or when a tooltip tries to pop up in the editor or something like this (probably it is waiting for the lexer at this point).
Comment 7 Albert Zeyer 2009-02-15 15:15:49 UTC
Note that I tried to disable any option with code completion in KDevelop and I also edited the project file with a text editor and set everything I found to disabled. But it seems that KDevelop is still always parsing the project after I loaded it.
Comment 8 Albert Zeyer 2009-02-15 15:20:46 UTC
I tried kdevelop-3.5.2-r1 and it is just exactly the same behaviour there.
Comment 9 Albert Zeyer 2009-02-15 15:55:26 UTC
I made an upstream bug report:
https://bugs.kde.org/show_bug.cgi?id=184420
Comment 10 Albert Zeyer 2009-02-15 18:06:34 UTC
I fixed the problem:

az@acompneu ~/Programmierung/kdevelop-3.5 $ svn diff
Index: lib/cppparser/lexer.cpp
===================================================================
--- lib/cppparser/lexer.cpp	(revision 926528)
+++ lib/cppparser/lexer.cpp	(working copy)
@@ -241,7 +241,7 @@
         m_startLine = false;
         int ppe = preprocessorEnabled();
 	setPreprocessorEnabled( false );
-	while( currentChar() && currentChar() != '\n' ){
+	while( !currentChar().isNull() && currentChar() != '\n' ){
             Token tok(m_source);
             nextToken( tok, true );
         }

It always occurs while parsing any C++ file with some unicode characters. (bool)currentChar() is false in that case, so it never proceed further at this character.
Comment 11 Albert Zeyer 2009-02-15 18:24:49 UTC
Created attachment 182145 [details, diff]
kdevelop-3.5.0-lexer.patch
Comment 12 Albert Zeyer 2009-02-15 20:07:43 UTC
upstream applied the patch:
http://websvn.kde.org/?view=rev&revision=926595
Comment 13 Theo Chatzimichos (RETIRED) archtester gentoo-dev Security 2009-05-02 17:13:21 UTC
Patch applied in kdevelop-3.5.4-r1 in kde3 overlay, it will hit tree in the next days