Bug 373213 - Assertion failure "!inputUrl.fileName().isEmpty()" in shell/documentcontroller.cpp, line 226
Summary: Assertion failure "!inputUrl.fileName().isEmpty()" in shell/documentcontrolle...
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: general (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-03 13:51 UTC by Francis Herne
Modified: 2023-09-15 11:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Herne 2016-12-03 13:51:01 UTC
On git master, commit a8cbca4, Arch Linux x86_64.

I was typing something unrelated in the KonsolePart (*not* `open!`) when KDevelop crashed like this:

ASSERT: "!inputUrl.fileName().isEmpty()" in file /home/flh/projects/kdevplatform/shell/documentcontroller.cpp, line 226

Thread 1 "kdevelop" received signal SIGABRT, Aborted.
0x00007ffff021f04f in raise () from /usr/lib/libc.so.6
(gdb) quit
A debugging session is active.

        Inferior 1 [process 29803] will be killed.

Quit anyway? (y or n) n
Not confirmed.
(gdb) bt full
#0  0x00007ffff021f04f in raise () at /usr/lib/libc.so.6
#1  0x00007ffff022047a in abort () at /usr/lib/libc.so.6
#2  0x00007ffff0ec04a1 in  () at /usr/lib/libQt5Core.so.5
#3  0x00007ffff0ebb96e in  () at /usr/lib/libQt5Core.so.5
#4  0x00007ffff7a834e2 in KDevelop::DocumentControllerPrivate::openDocumentInternal(QUrl const&, QString const&, KTextEditor::Range const&, QString const&, QFlags<KDevelop::IDocumentController::DocumentActivation>, KDevelop::IDocument*) (this=0xea4bd0, inputUrl=..., prefName=..., range=..., encoding=..., activationParams=..., buddy=0x0) at /home/flh/projects/kdevplatform/shell/documentcontroller.cpp:226
        _encoding = {static null = {<No data fields>}, d = 0x8}
        url = {d = 0x1}
        doc = 0x7ffff7a4f7e5 <QString::QString(QLatin1String)+65>
        __PRETTY_FUNCTION__ = "KDevelop::IDocument* KDevelop::DocumentControllerPrivate::openDocumentInternal(const QUrl&, const QString&, const KTextEditor::Range&, const QString&, KDevelop::IDocumentController::DocumentActivation"...
#5  0x00007ffff7a7cc8d in KDevelop::DocumentController::openDocument(QUrl const&, KTextEditor::Range const&, QFlags<KDevelop::IDocumentController::DocumentActivation>, QString const&, KDevelop::IDocument*) (this=0x8102b0, inputUrl=..., range=..., activationParams=..., encoding=..., buddy=0x0) at /home/flh/projects/kdevplatform/shell/documentcontroller.cpp:701
#6  0x00007ffff61b0bfa in KDevelop::IDocumentController::openDocument(QUrl const&, KTextEditor::Cursor const&, QFlags<KDevelop::IDocumentController::DocumentActivation>, QString const&) (this=0x8102b0, url=..., cursor=..., activationParams=..., encoding=...) at /home/flh/projects/kdevplatform/interfaces/idocumentcontroller.cpp:33
#7  0x00007ffff7a803df in KDevelop::DocumentController::openDocumentsWithSplitSeparators(Sublime::AreaIndex*, QStringList, bool&) (this=0x8102b0, index=0xc52760, urlsWithSeparators=..., isFirstView=@0x7fffffffb2ef: true)
    at /home/flh/projects/kdevplatform/shell/documentcontroller.cpp:1149
        doc = 0x7fffffffb2a0
        sublimeDoc = 0x2f7a08ef7
        __PRETTY_FUNCTION__ = "bool KDevelop::DocumentController::openDocumentsWithSplitSeparators(Sublime::AreaIndex*, QStringList, bool&)"
        area = 0xc52650
        topLevelSeparators =
            {<QListSpecialMethods<int>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7ffff11612e0 <QListData::shared_null>}, d = 0x7ffff11612e0 <QListData::shared_null>}}
        separators =
              {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x6999000}, d = 0x6999000}}, <No data fields>}
        groups =
            {<QListSpecialMethods<QStringList>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0xde52c50}, d = 0xde52c50}}
        ret = true
        pickSeparator = 32767
        activeViewToSecondChild = 167
        orientation = (unknown: 3355612928)
#8  0x00007ffff7a7f98a in KDevelop::DocumentController::openDocumentsSimple(QStringList) (this=0x8102b0, urls=...) at /home/flh/projects/kdevplatform/shell/documentcontroller.cpp:1076
        area = 0xc52650
        areaIndex = 0xc52760
        topViews =
            {<QListSpecialMethods<Sublime::View*>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x40007e0}, d = 0x40007e0}}
        __PRETTY_FUNCTION__ = "virtual bool KDevelop::DocumentController::openDocumentsSimple(QStringList)"
        isFirstView = true
        ret = false
#9  0x00007ffff7a81723 in KDevelop::DocumentController::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x8102b0, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=0x7fffffffb6d0)
    at /home/flh/projects/kdevplatform/build/shell/moc_documentcontroller.cpp:206
        _r = 255
        _t = 0x8102b0
#10 0x00007ffff7a81c58 in KDevelop::DocumentController::qt_metacall(QMetaObject::Call, int, void**) (this=0x8102b0, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=0x7fffffffb6d0)
    at /home/flh/projects/kdevplatform/build/shell/moc_documentcontroller.cpp:285
#11 0x00007ffff3e622d0 in  () at /usr/lib/libQt5DBus.so.5
#12 0x00007ffff3e661d8 in  () at /usr/lib/libQt5DBus.so.5
#13 0x00007ffff3e665fc in  () at /usr/lib/libQt5DBus.so.5
#14 0x00007ffff3e690ce in  () at /usr/lib/libQt5DBus.so.5
#15 0x00007ffff10e04b9 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#16 0x00007ffff1d93e0c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff1d9b581 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#18 0x00007ffff10b3de0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
#19 0x00007ffff10b656d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#20 0x00007ffff1108303 in  () at /usr/lib/libQt5Core.so.5
#21 0x00007fffe5214587 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#22 0x00007fffe52147f0 in  () at /usr/lib/libglib-2.0.so.0
#23 0x00007fffe521489c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#24 0x00007ffff110870f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#25 0x00007ffff10b223a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#26 0x00007ffff10ba73c in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#27 0x000000000040f1f5 in main ()
Comment 1 Francis Herne 2017-01-06 21:50:36 UTC
This is entirely reproducible by trying to open URLs,

e.g. Ctrl-O 'http://example.org/' -> assert.

In Kate, this opens the returned HTML as a text file.
Comment 2 Sven Brauch 2017-01-08 12:08:31 UTC
Git commit d42d074299295308f22d36fe4ce456e26e4cd398 by Sven Brauch.
Committed on 08/01/2017 at 12:07.
Pushed by brauch into branch 'master'.

Fix opening of remote URLs without filename
Differential Revision: https://phabricator.kde.org/D3999

M  +1    -1    language/backgroundparser/backgroundparser.cpp
M  +2    -2    shell/documentcontroller.cpp
M  +8    -2    sublime/urldocument.cpp

https://commits.kde.org/kdevplatform/d42d074299295308f22d36fe4ce456e26e4cd398
Comment 3 Kevin Funk 2017-01-08 12:11:12 UTC
Git commit 28c38e3b9dd6eda0edb8cfa763db64897314eb4b by Kevin Funk, on behalf of Sven Brauch.
Committed on 08/01/2017 at 12:10.
Pushed by kfunk into branch '5.0'.

Fix opening of remote URLs without filename
Differential Revision: https://phabricator.kde.org/D3999

(cherry picked from commit d42d074299295308f22d36fe4ce456e26e4cd398)

M  +1    -1    language/backgroundparser/backgroundparser.cpp
M  +2    -2    shell/documentcontroller.cpp
M  +8    -2    sublime/urldocument.cpp

https://commits.kde.org/kdevplatform/28c38e3b9dd6eda0edb8cfa763db64897314eb4b
Comment 4 Anton Anikin 2017-01-23 05:06:52 UTC
Git commit 38fa47e9860da2c3c3deb9f4312fa5a4bd343e56 by Anton Anikin.
Committed on 23/01/2017 at 04:49.
Pushed by antonanikin into branch '5.1'.

Fix bug 374921: Tool view grouping no longer works in 5.1 branch

Summary:
This commit fixes view grouping, broken in D3170 revision.

Test Plan: Tested on 5.1 and master branches.

Reviewers: apol, #kdevelop, mwolff

Reviewed By: #kdevelop, mwolff

Subscribers: mwolff, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D4219

M  +1    -30   sublime/idealbuttonbarwidget.cpp
M  +2    -4    sublime/idealbuttonbarwidget.h

https://commits.kde.org/kdevplatform/38fa47e9860da2c3c3deb9f4312fa5a4bd343e56
Comment 5 Igor Kushnir 2023-09-15 11:45:54 UTC
Git commit b213f60eaff583ce2d7b4f468f5ed1522ed7017d by Igor Kushnir.
Committed on 15/09/2023 at 13:45.
Pushed by igorkushnir into branch 'master'.

LanguageController: don't assert that filename is nonempty

I have added this assertion in 59270583c2f1f9bbe30cd24c1fa68229651379b3,
because I was unaware that KDevelop supports an empty file name in a
remote URL. The assertion fails when a remote URL that ends with a slash
is opened in Terminal tool view. For example:
    open! 'http://example.org/'

Early-return from MimeTypeCache::languagesForFileName() when its
fileName argument is empty, because this function's definition does not
support that and MimeTypeCache should not return anything for an empty
file name.

M  +7    -3    kdevplatform/shell/languagecontroller.cpp

https://invent.kde.org/kdevelop/kdevelop/-/commit/b213f60eaff583ce2d7b4f468f5ed1522ed7017d