Summary: | plasma crashes randomly when folder widget is used (KFileItem::mimeComment()) | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | bartek <b.gedzior> |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED UPSTREAM | ||
Severity: | crash | CC: | bhush94, faure, francesco.caimmi, kde, kdelibs-bugs |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
debud info
more detailed debug info desktop file that causes crash code to reproduce the bug |
Description
bartek
2015-01-30 18:06:12 UTC
Created attachment 90819 [details]
debud info
The last readable hop is QMimeType::comment(). It seems like it's crashing in Qt's MIME type code, so I wonder if you have some sort of system setup problem with your shared-mime-info db (this is the first time this crash has been reported). The backtrace is missing some hops however. Could you install more Qt debug symbols and retrace please? To me backtrace looks more like bug 336493, even if it is not related to Kickoff Firstly, in Arch repos there are no packages with Qt compiled with debug symbols... Secondly, how can I check my shared-mime-info db, If this is a problem? Created attachment 90877 [details]
more detailed debug info
So I've found Qt5 packages with debug symbols. Here's the debug log.
I've found that plasma crashes when I move cursor over a one particular *.desktop icon - it is Heroes III icon running game via wine. Other icons do not cause the crash. Why? I know that this is a problem I can handle my self, however plasma should never crash in such situation... Could you attach the .desktop file here? Created attachment 90952 [details]
desktop file that causes crash
What happens when you run "kmimetypefinder5 <path to file>" on your system? $ kmimetypefinder5 Desktop/Heroes\ 3 application/x-desktop ^ Thanks for your efforts so far. I can't reproduce the crash currently, but I'll continue to investigate. No problem, thank you for your help. bartek, unfortunately I never was able to reproduce this, and it's not been reported again. Is it happening for you lately? Otherwise I'd like to close this ticket to keep the tracker in a state of functional cleanliness - please change to REOPENED if it's still happening. I'm still having that issue and I've found few things. 1. Recently, to start games, I used dolphin to avoid plasma crash. However, after updating to KDE Applications to 15.08, dolphin crashes every time I move cursor over certain *.desktop icons. I've noticed that dolphin was ported to KF5 during this release cycle, so I checked It on Konqueror which is still not ported. And it didn't crash. So first of all, It's something connected with KF5. 2. Dolphin and plasma crash only in certain *.desktop files. I've found file that do not cause the crash and started removing content line by line. Finally, I've found that crash happens when there no line: Comment=some string or the string is empty: Comment= 3. Finally, I've found that crash happens on empty *.desktop files (because there no Comment line) and also on files without .desktop extension If there a line: [Desktop Entry] thanks for reporting back Still not crashing here with that .desktop file, but seems like we have something to go on. Given the trace, it's possibly fixed in Qt. I'll try on an older VM Created attachment 94202 [details]
code to reproduce the bug
Ok, I'm total noob in programming, however I wrote a code, that always reproduce the bug on my machine.
Compile simply with:
qmake
make
If you run the executable, it will crash. Then, if you edit test.desktop and add any string to comment line, there wont be any crash and string will be printed.
Ok, I've got something more. I'm almost sure, that I know which line causes the problem. Look at the file: http://api.kde.org/frameworks-api/frameworks5-apidocs/kio/html/kfileitem_8cpp_source.html I believe lines 810 and 832 are to blame. Here's some code snippet, that shows the problem: #include <kfileitem.h> #include <QDir> #include <QDebug> #include <QUrl> #include <QMimeType> int main(int argc, char *argv[]) { QString filePath = QDir::currentPath() + "/test.desktop"; KFileItem item(QUrl::fromLocalFile(filePath)); QMimeType mime = item.currentMimeType(); const QString comment = mime.comment(); return 0; } It breaks at the line: const QString comment = mime.comment(); Checked on Qt5.5 and kio 5.13. Thank you for an impressive effort. dfaure, thoughts? This test program works for me. $ ./test (9723)/default main: "desktop configuration file" using QtCore 5.5.1, KF 5.15. It's the same backtrace as bug 349295, which puzzles me just as much as this one. Could you try reducing the test program further, to just do QMimeDatabase db; QMimeType mime = db.mimeTypeForName("application/x-desktop"); Q_ASSERT(mime.isValid()); const QString comment = mime.comment(); qDebug() << comment; If this crashes, the next step is to compile Qt in debug mode... Above code still crashes. Here's backtrace: #0 0x00007f1349e263a8 in operator==(QString const&, QString const&) () from /usr/lib/libQt5Core.so.5 #1 0x00007f134a003d04 in ?? () from /usr/lib/libQt5Core.so.5 #2 0x00007f1349ff753a in QMimeType::comment() const () from /usr/lib/libQt5Core.so.5 #3 0x0000000000400e44 in main (argc=1, argv=0x7ffca3875a68) at ../../main.cpp:11 I'll try to compile qt5 and kio with debug symbols. Fortunately, I've got decent machine, so it won't take long. Excuse me for delay, but I have problems with compiling qt and I didn't have enough time resolve them. After all I've got more precise backtrace. It comes from the code suggested by David Faure. Here it goes: #0 0x00007fa6a7d785f8 in raise () from /usr/lib/libc.so.6 #1 0x00007fa6a7d79a7a in abort () from /usr/lib/libc.so.6 #2 0x00007fa6a8f761e6 in qt_message_fatal (context=..., message=<synthetic pointer>) at global/qlogging.cpp:1575 #3 QMessageLogger::fatal (this=this@entry=0x7ffd0f32a650, msg=msg@entry=0x7fa6a91d8b10 "ASSERT: \"%s\" in file %s, line %d") at global/qlogging.cpp:777 #4 0x00007fa6a8f6f3a4 in qt_assert (assertion=assertion@entry=0x7fa6a91d7f9c "!isEmpty()", file=file@entry=0x7fa6a91d6020 "../../include/QtCore/../../src/corelib/tools/qlist.h", line=line@entry=316) at global/qglobal.cpp:2970 #5 0x00007fa6a91b7c65 in QList<QString>::first (this=0xa6db78) at ../../include/QtCore/../../src/corelib/tools/qlist.h:316 #6 QMimeBinaryProvider::loadMimeTypePrivate (this=<optimized out>, data=...) at mimetypes/qmimeprovider.cpp:628 #7 0x00007fa6a91ad273 in QMimeType::comment (this=0x7ffd0f32aa50) at mimetypes/qmimetype.cpp:225 #8 0x0000000000400d14 in main (argc=1, argv=0x7ffd0f32aba8) at ../../main.cpp:11 If you need any additional info, I'll try to provide it. P.S. Qt version 5.5.0 and kio 5.15 At first glance It looks like that: In qmimeprovider.cpp line 628 we have: if (!mainPattern.isEmpty() && data.globPatterns.first() != mainPattern) { I checked it in QtCreator. Problem is that data.globPatterns QStringList is empty, so we try to dereference empty pointer. That's something we could suspect. I don't know what is a globPatterns variable, when it should be populated. But it causes the problem. In all places variable name has value "application/x-desktop" so It's correct. There are two probable solutions, I think: 1. Add some test like if(globPatterns.isEmpty()) 2. Ensure, that globPatterns is populated, but this should do someone, who knows the code. Probably we should report a bug to Qt guys... What do you think? This was indeed a missing data.globPatterns.isEmpty() check in Qt, but this has been already fixed meanwhile, see commit af3152adee2de79c03c0926400e920122b669c4d in qtbase. This commit is in Qt 5.6. As a workaround, find the mimetype with <glob-deleteall/> (might be text-x-objcsrc.xml) and delete it. *** Bug 355930 has been marked as a duplicate of this bug. *** |