Bug 83035 - PHP parser crashes when changing project
Summary: PHP parser crashes when changing project
Status: RESOLVED INTENTIONAL
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (show other bugs)
Version: 3.0.3
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 130443 148129 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-08 09:45 UTC by Simon Ejsing
Modified: 2008-07-05 21:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Ejsing 2004-06-08 09:45:54 UTC
Version:           3.0.3 (using KDE KDE 3.2.2)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)
 
OS:                Linux

I have a very large PHP project opened in KDevelop (100.000+ lines), which takes around 20 - 30 seconds to parse, when I start up KDevelop, the project is autoloaded, if I wan't to change to another project (a C++ project) before the parser is done, KDevelop crashes. I don't know if this is specific to the PHP parser, because I havn't got a big enough C++ project to test that.

The crash is reproducable, as it happens everytime.

Right now I get a useless backtrace, as the binaries and libs are stripped, but I'll recompile it with debuging enabled, and report the backtrace when it's done.

How to reproduce: Open a large PHP project, switch project before the parser is done (eg. the progressbar is still visible)

Expected behaviour: Please don't crash :)
Comment 1 Simon Ejsing 2004-06-08 15:45:39 UTC
This is what I can get from a backtrace:
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 6911)]
[New Thread 32769 (LWP 6915)]
[New Thread 32770 (LWP 6917)]
0x41a10ceb in waitpid () from /lib/libpthread.so.0
#0  0x41a10ceb in waitpid () from /lib/libpthread.so.0
#1  0x40ff99f4 in __JCR_LIST__ () from /usr/kde/3.2/lib/libkdecore.so.4

Which isn't much... I've compiled both KDevelop and kdelibs with -O0 -g3 and configured with --enable-debug=full, and the libraries + binaries, are not stripped.

Any ideas what to do, to get a better backtrace?
Comment 2 Simon Ejsing 2004-06-08 15:49:15 UTC
Okay, apparently KCrash have problem selecting the right thread or something like that, a backtrace from GDB yields:

(gdb) bt
#0  0x406c1154 in KDevPlugin::codeModel() const (this=0x888d070) at kdevplugin.cpp:153
#1  0x42cb6b28 in PHPSupportPart::maybeParse(QString) (this=0x888d070, fileName=
      {static null = {static null = <same as static member of an already seen type>, d = 0x80a6a18, static shared_null = 0x80a6a18}, d = 0x95fd808, static shared_null = 0x80a6a18})
    at phpsupportpart.cpp:384
#2  0x42cb6f60 in PHPSupportPart::initialParse() (this=0x888d070) at phpsupportpart.cpp:412
#3  0x42cb7af5 in PHPSupportPart::qt_invoke(int, QUObject*) (this=0x888d070, _id=17, _o=0xbfffe9a0) at phpsupportpart.moc:175
#4  0x4131323c in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/qt/3/lib/libqt-mt.so.3
#5  0x4164310a in QSignal::signal(QVariant const&) () from /usr/qt/3/lib/libqt-mt.so.3
#6  0x4132cf9d in QSignal::activate() () from /usr/qt/3/lib/libqt-mt.so.3
#7  0x413346d3 in QSingleShotTimer::event(QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
#8  0x412b7d2f in QApplication::internalNotify(QObject*, QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
#9  0x412b70fb in QApplication::notify(QObject*, QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
#10 0x40eaa7c8 in KApplication::notify(QObject*, QEvent*) (this=0xbffff070, receiver=0x9706e10, event=0xbfffeda0) at kapplication.cpp:507
#11 0x412a7605 in QEventLoop::activateTimers() () from /usr/qt/3/lib/libqt-mt.so.3
#12 0x41263406 in QEventLoop::processEvents(unsigned) () from /usr/qt/3/lib/libqt-mt.so.3
#13 0x412c9d48 in QEventLoop::enterLoop() () from /usr/qt/3/lib/libqt-mt.so.3
#14 0x412c9bf8 in QEventLoop::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#15 0x412b7f81 in QApplication::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#16 0x08064a9d in main (argc=1, argv=0xbffff1e4) at main.cpp:128

Hope this helps more :)
Comment 3 Jens Dagerbo 2004-06-08 19:32:39 UTC
Yes, it does help. :)

From a brief look, this looks like the same problem as I solved for the cppsupport a few months ago. In short: processEvents() is a killer!

What I did in cppsupport was refactor the code to user timer events instead. The resulting code isn't as pretty, but it is stable.

This should be quite solvable, but the code will probably need to be changed too much to go into a 3.0.x bugfix release. While waiting for 3.1, the following applies: "don't do that!" ;)
Comment 4 Simon Ejsing 2004-06-09 09:04:23 UTC
I was looking around in the code, and I found that the KDevPlugin looks like it's not thread safe, at least it references m_api which must be invalid (it's the only line of code in there :), and that's what's killing it.

I don't know if your idea will help solve the problem, but to me it looks like the entire KDevPlugin class is very unsafe, so these kinds of problems are likely to surface again...

Maybe the KDevPlugin class was never meant to be thread-safe?
Comment 5 Jens Dagerbo 2004-06-09 18:02:49 UTC
The PHP parser isn't threaded, so for this discussion, the thread-unsafeness of KDevPlugin is hardly relevant.
Comment 6 Jens Dagerbo 2007-01-14 19:02:22 UTC
These days, the PHP parser IS threaded.

Changing component.
Comment 7 Jens Dagerbo 2007-01-14 19:12:08 UTC
*** Bug 130443 has been marked as a duplicate of this bug. ***
Comment 8 Andreas Pakulat 2007-07-23 12:24:05 UTC
*** Bug 148129 has been marked as a duplicate of this bug. ***
Comment 9 Iulian Nastasache 2007-12-10 10:50:23 UTC
It's there some work in this bug? I have a very similar crashing in big projects but not too much output:

This backtrace appears to be of no use.
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0xb7f8a410 in __kernel_vsyscall ()
#0  0xb7f8a410 in __kernel_vsyscall ()
#1  0xb60392e6 in nanosleep () from /lib/libc.so.6
#2  0xb60390f7 in sleep () from /lib/libc.so.6
#3  0xb6e91828 in KCrash::startDrKonqi () from /usr/kde/3.5/lib/libkdecore.so.4
#4  0x0000541b in ?? ()
#5  0xbf923598 in ?? ()
#6  0x080866d8 in ?? ()
#7  0xbf9235a0 in ?? ()
#8  0xbf9235a0 in ?? ()
#9  0xbf9255aa in ?? ()
#10 0x00000003 in ?? ()
#11 0xb6cfaff4 in ?? () from /usr/qt/3/lib/libqt-mt.so.3
#12 0x0000524d in ?? ()
#13 0x6f6b7264 in ?? ()
#14 0x0069716e in ?? ()
#15 0x7369642d in ?? ()
#16 0x79616c70 in ?? ()
#17 0x2e303a00 in ?? ()
#18 0x2d2d0030 in ?? ()
#19 0x6e707061 in ?? ()
#20 0x00656d61 in ?? ()
#21 0x7665646b in ?? ()
#22 0x706f6c65 in ?? ()
#23 0x732d2d00 in ?? ()
#24 0x616e6769 in ?? ()
#25 0x3131006c in ?? ()
#26 0x702d2d00 in ?? ()
#27 0x32006469 in ?? ()
#28 0x35323031 in ?? ()
#29 0x612d2d00 in ?? ()
#30 0x65767070 in ?? ()
#31 0x6f697372 in ?? ()
#32 0x2e33006e in ?? ()
#33 0x00302e35 in ?? ()
#34 0x72702d2d in ?? ()
#35 0x6172676f in ?? ()
#36 0x6d616e6d in ?? ()
#37 0x444b0065 in ?? ()
#38 0x6c657665 in ?? ()
#39 0x2d00706f in ?? ()
#40 0x6775622d in ?? ()
#41 0x72646461 in ?? ()
#42 0x00737365 in ?? ()
#43 0x6d627573 in ?? ()
#44 0x62407469 in ?? ()
#45 0x2e736775 in ?? ()
#46 0x2e65646b in ?? ()
#47 0x0067726f in ?? ()
#48 0x74732d2d in ?? ()
#49 0x75747261 in ?? ()
#50 0x00646970 in ?? ()
#51 0x696c626f in ?? ()
#52 0x31313b6f in ?? ()
#53 0x38323739 in ?? ()
#54 0x32333636 in ?? ()
#55 0x3931333b in ?? ()
#56 0x3b383338 in ?? ()
#57 0x38333231 in ?? ()
#58 0x49545f37 in ?? ()
#59 0x3637454d in ?? ()
#60 0x31393433 in ?? ()
#61 0x00000038 in ?? ()
#62 0x00000000 in ?? ()
Comment 10 Iulian Nastasache 2007-12-10 12:29:43 UTC
Here is some output when kdevelop crashing:

strace -o kdevelop.log kdevelop

QObject::connect: No such slot MakeWidget::slotDocumentOpened(const KURL&)
QObject::connect:  (sender name:   'unnamed')
QObject::connect:  (receiver name: 'make widget')
QLayout "unnamed" added to IndexView "unnamed", which already has a layout
kdecore (KAction): WARNING: KAction::initPrivate(): trying to assign a shortcut (Alt+Ctrl+Shift+N) to an unnamed action.
QObject::connect: No such signal PHPSupportPart::fileParsed(PHPFile*)
QObject::connect:  (sender name:   'PHPSupportPart')
QObject::connect:  (receiver name: 'PHPSupportPart')
kio (KTrader): WARNING: Parsing ' and [X-KDevelop-Version] == 4' gave syntax error
QObject::connect: No such signal KListBox::clicked(QListBoxItem*item)
QObject::connect:  (sender name:   'srcDistFileListBox')
QObject::connect:  (receiver name: 'dist_widget')
ASSERT: "part && parent" in partwidget.cpp (41)
kio (KTrader): WARNING: Parsing ' and [X-KDevelop-Version] == 4' gave syntax error
kio (KTrader): WARNING: Parsing ' and [X-KDevelop-Version] == 4' gave syntax error
KCrash: Application 'kdevelop' crashing...
kdevelop: Fatal IO error: client killed

and log said (at the end):

select(16, [3 4 5 7 9 11 12 13 15], [], [], {1, 653285}) = 1 (in [5], left {1, 653000})
read(5, "\0", 1)                        = 1
gettimeofday({1197288632, 434959}, NULL) = 0
ioctl(5, FIONREAD, [0])                 = 0
write(6, "\0", 1)                       = 1
gettimeofday({1197288632, 435066}, NULL) = 0
ioctl(3, FIONREAD, [0])                 = -1 EBADF (Bad file descriptor)
--- SIGCHLD (Child exited) @ 0 (0) ---
write(8, "\0", 1)                       = -1 EBADF (Bad file descriptor)
sigreturn()                             = ? (mask now [])
write(2, "kdevelop: Fatal IO error: client"..., 40) = 40
futex(0xb6105120, FUTEX_WAIT, 2, NULL)  = ? ERESTARTSYS (To be restarted)
Comment 11 Andreas Pakulat 2007-12-10 12:51:05 UTC
No, nobody works on the PHP support.
Comment 12 Andreas Pakulat 2008-07-05 21:59:51 UTC
closing as wontfix, php support in kdev3 is dead.