Bug 310524 - Crash when trying to parse invalid url
Summary: Crash when trying to parse invalid url
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: git master
Platform: unspecified Linux
: NOR crash
Target Milestone: 4.3.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-22 19:09 UTC by Kevin Funk
Modified: 2012-12-01 15:09 UTC (History)
0 users

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 Kevin Funk 2012-11-22 19:09:53 UTC
What I was doing:
Opened the VTK project in KDevelop.

Crash happens when the background parser tries to parse the following file:
(gdb) p url.c_str()
$7 = 0x7ffedc4bb30c "/home/krf/devel/src/VTK/Utilities/vtkhdf5//hl//src/H5LTparse.y"

In this case there it will assert on isValidUrl(url).
(Probably the url is 'unclean' and contains extra slashes).

Backtrace:
#0  0x00007ffff4348425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff434bb8b in __GI_abort () at abort.c:91
#2  0x00007ffff5aa45e3 in qt_message_output (msgType=QtFatalMsg, 
    buf=0x4dc8fa8 "ASSERT: \"isValidURL(url)\" in file /home/krf/devel/src/kdevplatform/language/backgroundparser/backgroundparser.cpp, line 524")
    at /home/krf/devel/src/qt4.8/src/corelib/global/qglobal.cpp:2323
#3  0x00007ffff5aa4779 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, 
    msg=0x7ffff5c6b978 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fffffffc398) at /home/krf/devel/src/qt4.8/src/corelib/global/qglobal.cpp:2369
#4  0x00007ffff5aa4f09 in qFatal (msg=0x7ffff5c6b978 "ASSERT: \"%s\" in file %s, line %d") at /home/krf/devel/src/qt4.8/src/corelib/global/qglobal.cpp:2552
#5  0x00007ffff5aa41a8 in qt_assert (assertion=0x7ffff160961b "isValidURL(url)", 
    file=0x7ffff1609758 "/home/krf/devel/src/kdevplatform/language/backgroundparser/backgroundparser.cpp", line=524)
    at /home/krf/devel/src/qt4.8/src/corelib/global/qglobal.cpp:2018
#6  0x00007ffff14c9ac4 in KDevelop::BackgroundParser::addDocument (this=0xb93700, url=..., features=KDevelop::TopDUContext::VisibleDeclarationsAndContexts, 
    priority=100000, notifyWhenReady=0x4c92fb0, flags=...) at /home/krf/devel/src/kdevplatform/language/backgroundparser/backgroundparser.cpp:524
#7  0x00007ffff14d95d2 in KDevelop::ParseProjectJob::start (this=0x4c92fb0) at /home/krf/devel/src/kdevplatform/language/backgroundparser/parseprojectjob.cpp:90
#8  0x00007ffff744a84d in KDevelop::RunController::registerJob (this=0xb936d0, job=0x4c92fb0) at /home/krf/devel/src/kdevplatform/shell/runcontroller.cpp:566
#9  0x00007ffff7428122 in KDevelop::ProjectController::projectImportingFinished (this=<optimized out>, project=0x301d7a0)
    at /home/krf/devel/src/kdevplatform/shell/projectcontroller.cpp:779
#10 0x00007ffff743089c in KDevelop::ProjectPrivate::importDone (this=0x4126530, job=<optimized out>) at /home/krf/devel/src/kdevplatform/shell/project.cpp:257
#11 0x00007ffff7430291 in KDevelop::Project::qt_static_metacall (_o=0x301d7a0, _c=<optimized out>, _id=<optimized out>, _a=0x7fffffffc9b0)
    at /home/krf/devel/build/kdevplatform/shell/moc_project.cpp:94
#12 0x00007ffff5c06330 in QMetaObject::activate (sender=0x4129570, m=0x7ffff7dcb540 <KJob::staticMetaObject>, local_signal_index=3, argv=0x7fffffffc9b0)
    at /home/krf/devel/src/qt4.8/src/corelib/kernel/qobject.cpp:3539
#13 0x00007ffff7a40ed2 in KJob::result (this=this@entry=0x4129570, _t1=_t1@entry=0x4129570) at ./kjob.moc:208
#14 0x00007ffff7a40f10 in KJob::emitResult (this=0x4129570) at ../../kdecore/jobs/kjob.cpp:318
#15 0x00007ffff5c06330 in QMetaObject::activate (sender=0x4163c10, m=0x7ffff5f9ff20 <QFutureWatcherBase::staticMetaObject>, local_signal_index=1, argv=0x0)
    at /home/krf/devel/src/qt4.8/src/corelib/kernel/qobject.cpp:3539
#16 0x00007ffff5c63af5 in QFutureWatcherBase::finished (this=0x4163c10) at .moc/debug-shared/moc_qfuturewatcher.cpp:141
#17 0x00007ffff5a9c397 in QFutureWatcherBasePrivate::sendCallOutEvent (this=0x40e4e30, event=0x7ffedc002980)
    at /home/krf/devel/src/qt4.8/src/corelib/concurrent/qfuturewatcher.cpp:439
#18 0x00007ffff5a9bee3 in QFutureWatcherBase::event (this=0x4163c10, event=0x7ffedc002980)
    at /home/krf/devel/src/qt4.8/src/corelib/concurrent/qfuturewatcher.cpp:344
#19 0x00007ffff4c3c514 in QApplicationPrivate::notify_helper (this=0x6d1c20, receiver=0x4163c10, e=0x7ffedc002980)
    at /home/krf/devel/src/qt4.8/src/gui/kernel/qapplication.cpp:4562
#20 0x00007ffff4c39b32 in QApplication::notify (this=0x7fffffffd980, receiver=0x4163c10, e=0x7ffedc002980)
    at /home/krf/devel/src/qt4.8/src/gui/kernel/qapplication.cpp:3944
#21 0x00007ffff61d21d6 in KApplication::notify (this=0x7fffffffd980, receiver=0x4163c10, event=0x7ffedc002980) at ../../kdeui/kernel/kapplication.cpp:311
#22 0x00007ffff5be7d12 in QCoreApplication::notifyInternal (this=0x7fffffffd980, receiver=0x4163c10, event=0x7ffedc002980)
    at /home/krf/devel/src/qt4.8/src/corelib/kernel/qcoreapplication.cpp:946
#23 0x00007ffff6c1f971 in QCoreApplication::sendEvent (receiver=0x4163c10, event=0x7ffedc002980)
---Type <return> to continue, or q <return> to quit---
    at ../../include/QtCore/../../../../src/qt4.8/src/corelib/kernel/qcoreapplication.h:231
#24 0x00007ffff5be8d26 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x621670)
    at /home/krf/devel/src/qt4.8/src/corelib/kernel/qcoreapplication.cpp:1570
#25 0x00007ffff5be8947 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0)
    at /home/krf/devel/src/qt4.8/src/corelib/kernel/qcoreapplication.cpp:1463
#26 0x00007ffff5c24b2d in QCoreApplication::sendPostedEvents () at /home/krf/devel/src/qt4.8/src/corelib/kernel/qcoreapplication.h:236
#27 0x00007ffff5c23a9c in postEventSourceDispatch (s=0x6d3310) at /home/krf/devel/src/qt4.8/src/corelib/kernel/qeventdispatcher_glib.cpp:279
#28 0x00007fffee421ab5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fffee421de8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007fffee421ea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007ffff5c2434b in QEventDispatcherGlib::processEvents (this=0x6d1bb0, flags=...)
    at /home/krf/devel/src/qt4.8/src/corelib/kernel/qeventdispatcher_glib.cpp:424
#32 0x00007ffff4d156a8 in QGuiEventDispatcherGlib::processEvents (this=0x6d1bb0, flags=...)
    at /home/krf/devel/src/qt4.8/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#33 0x00007ffff5be524c in QEventLoop::processEvents (this=0x7fffffffd560, flags=...) at /home/krf/devel/src/qt4.8/src/corelib/kernel/qeventloop.cpp:149
#34 0x00007ffff5be53d6 in QEventLoop::exec (this=0x7fffffffd560, flags=...) at /home/krf/devel/src/qt4.8/src/corelib/kernel/qeventloop.cpp:204
#35 0x00007ffff5be8392 in QCoreApplication::exec () at /home/krf/devel/src/qt4.8/src/corelib/kernel/qcoreapplication.cpp:1218
#36 0x00007ffff4c3971c in QApplication::exec () at /home/krf/devel/src/qt4.8/src/gui/kernel/qapplication.cpp:3823
#37 0x000000000040d481 in main (argc=<optimized out>, argv=<optimized out>) at /home/krf/devel/src/kdevelop/app/main.cpp:503
Comment 1 Kevin Funk 2012-12-01 15:08:05 UTC
Git commit 650298928ade0f1ec7bb29d290f2c54862d3abe6 by Kevin Funk.
Committed on 01/12/2012 at 13:52.
Pushed by kfunk into branch 'master'.

Assure we have a clean path in ProjectFileItem

M  +16   -0    project/projectmodel.cpp

http://commits.kde.org/kdevplatform/650298928ade0f1ec7bb29d290f2c54862d3abe6
Comment 2 Kevin Funk 2012-12-01 15:09:46 UTC
Git commit d80532f361251a10d7611368e9a3b3a138d3e320 by Kevin Funk.
Committed on 01/12/2012 at 14:49.
Pushed by kfunk into branch 'master'.

CMake: Do not create file items with unclean path

Fixes a crash later in the pipe in backgroundparser.cpp:

Original backtrace (trimmed):
5 0x00007ffff5aa41a8 in qt_assert (assertion=0x7ffff160961b
"isValidURL(url)", file=0x7ffff1609758
"/home/krf/devel/src/kdevplatform/language/backgroundparser/backgroundparser.cpp",
line=524)
6 0x00007ffff14c9ac4 in KDevelop::BackgroundParser::addDocument
(this=0xb93700, url=...,
features=KDevelop::TopDUContext::VisibleDeclarationsAndContexts,
priority=100000, notifyWhenReady=0x4c92fb0, flags=...) at
/home/krf/devel/src/kdevplatform/language/backgroundparser/backgroundparser.cpp:524
7 0x00007ffff14d95d2 in KDevelop::ParseProjectJob::start
(this=0x4c92fb0) at
/home/krf/devel/src/kdevplatform/language/backgroundparser/parseprojectjob.cpp:90
8 0x00007ffff744a84d in KDevelop::RunController::registerJob
(this=0xb936d0, job=0x4c92fb0) at
/home/krf/devel/src/kdevplatform/shell/runcontroller.cpp:566 #9
0x00007ffff7428122 in
KDevelop::ProjectController::projectImportingFinished (this=<optimized
out>, project=0x301d7a0) at
/home/krf/devel/src/kdevplatform/shell/projectcontroller.cpp:779 #10
0x00007ffff743089c in KDevelop::ProjectPrivate::importDone
(this=0x4126530, job=<optimized out>) at
/home/krf/devel/src/kdevplatform/shell/project.cpp:257 #11
0x00007ffff7430291 in KDevelop::Project::qt_static_metacall
(_o=0x301d7a0, _c=<optimized out>, _id=<optimized out>,
_a=0x7fffffffc9b0) at
/home/krf/devel/build/kdevplatform/shell/moc_project.cpp:94

M  +2    -1    projectmanagers/cmake/cmakemanager.cpp

http://commits.kde.org/kdevelop/d80532f361251a10d7611368e9a3b3a138d3e320