Bug 355390 - Localized Dolphin crashes when I try to create new folder
Summary: Localized Dolphin crashes when I try to create new folder
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 356155 358169 361759 362458 364787 364961 365223 366129 371972 389293 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-15 19:09 UTC by Yurii Kolesnykov
Modified: 2018-01-21 19:29 UTC (History)
30 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22


Attachments
Crash backtrace (19.11 KB, text/plain)
2015-11-16 14:09 UTC, Dmitry Osipenko
Details
popup menu in dolphin with double items (53.88 KB, image/jpeg)
2015-11-25 13:05 UTC, Dmitry
Details
A hacky workaround patch (1.55 KB, patch)
2015-12-14 22:57 UTC, Alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yurii Kolesnykov 2015-11-15 19:09:15 UTC
Dolphin 15.08.3

Using:
KDE Frameworks 5.16.0
Qt 5.5.1 (built against 5.5.1)
The xcb windowing system

Reproducible: Always

Steps to Reproduce:
1. Create new -> Folder


Actual Results:  
Crash

Expected Results:  
New folder

Starting program: /usr/bin/dolphin 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe0457700 (LWP 20075)]
[New Thread 0x7fffdc838700 (LWP 20076)]
[New Thread 0x7fffd491e700 (LWP 20077)]
"Trying to convert empty KLocalizedString to QString."
KSambaShare: Could not find smb.conf!
The desktop entry file "/home/yurikoles/.directory" has Type= "Application" but no Exec line
[New Thread 0x7fffcee99700 (LWP 20084)]
[Thread 0x7fffcee99700 (LWP 20084) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6d1d4e3 in KNewFileMenuPrivate::_k_slotActionTriggered(QAction*) () from /usr/lib/libKF5KIOFileWidgets.so.5
Comment 1 Yurii Kolesnykov 2015-11-15 19:11:52 UTC
It works fine when launch it with LC_ALL=C.
Comment 2 Dmitry Osipenko 2015-11-16 14:09:15 UTC
Created attachment 95534 [details]
Crash backtrace

Same issue for me here.
Comment 3 Nirvandil 2015-11-16 23:28:46 UTC
I can confirm this on Gentoo ~amd64. At this time from dmesg:
[ 9223.452840] dolphin[13195]: segfault at 1500000000 ip 00007f770a9d062c sp 00007ffe92ec7410 error 4 in libKF5KIOFileWidgets.so.5.16.0[7f770a94a000+c8000]
libKF5KIOFileWidgets.so.5.16.0 belongs to kde-frameworks/kio-5.16.0. 
Also, I see two options for create folder in context menu - localized and not localized. Crash happens at not localized, with localized all works as expected.
Comment 4 Dmitry Osipenko 2015-11-17 14:46:51 UTC
I just noticed that there are actually two options in context menu: localized and non-localized. Non-localized is on top, so I just always clicked it and crash happened. Localized menu works fine.
Comment 5 Dmitry 2015-11-25 13:05:06 UTC
Created attachment 95729 [details]
popup menu in dolphin with double items

I've doubles in localized dolphin's popup menu (see attached image). Confirm crash on select "Создать -> Folder..." ("Создать" is meaning "Create"). No crash on select localized item "Папку...", same as "Text file...", "HTML file" and localized doubles "Текстовый файл...", "Страницу HTML"

Distribution: ArchLinux 64 with latest updates of Plasma 5 & Dolphin
Comment 6 Frank Reininghaus 2015-12-01 19:45:20 UTC
Marking as duplicate of bug 356155, which has a backtrace.

*** This bug has been marked as a duplicate of bug 356155 ***
Comment 7 Yurii Kolesnykov 2015-12-01 20:20:19 UTC
Frank, please eplain your decision why this report this report form 2015-11-15 was marked as duplicate of report from 2015-12-01. This report has more comments and relevant information.
Comment 8 Frank Reininghaus 2015-12-01 20:55:26 UTC
(In reply to Yuriy Kolesnikov from comment #7)
> Frank, please eplain your decision why this report this report form
> 2015-11-15 was marked as duplicate of report from 2015-12-01. 

In the future, please just add a comment to the other report which contains the information that you think is missing there. Reopening reports and demanding explanations is a huge waste of everyone's time, and lack of time is the main reason for the sad state of bugs.kde.org. Thanks!

> This report has more comments and relevant information.

The backtrace is the most relevant information. The other report has one pasted inline, which means that one can search for its contents with the advanced search. this one only has an attached backtrace, which means that searches will not find anything in it.

Yes, I could have copied the attached backtrace and pasted it in a new comment and then marked the other report as a duplicate of this one. However, I thought that the solution which I chose (namely, to mark your report as a duplicate) takes less time. Note that there is no rule that says that newer reports must be marked as duplicates of older ones.
Comment 9 Frank Reininghaus 2015-12-01 20:57:22 UTC
Backtrace from comment 2:

Thread 1 (Thread 0x7f93f97b27c0 (LWP 18647)):
[KCrash Handler]
#6  QString::QString (other=..., this=0x7ffc32b88350) at /usr/include/qt5/QtCore/qstring.h:877
#7  KNewFileMenuSingleton::Entry::Entry (this=0x7ffc32b88350) at /var/tmp/portage/kde-frameworks/kio-5.16.0/work/kio-5.16.0/src/filewidgets/knewfilemenu.cpp:111
#8  KNewFileMenuPrivate::_k_slotActionTriggered (this=0x734520, action=<optimized out>) at /var/tmp/portage/kde-frameworks/kio-5.16.0/work/kio-5.16.0/src/filewidgets/knewfilemenu.cpp:778
#9  0x00007f940aeffc60 in KNewFileMenu::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /var/tmp/portage/kde-frameworks/kio-5.16.0/work/kio-5.16.0_build/src/filewidgets/moc_knewfilemenu.cpp:136
#10 0x00007f940760a6a4 in QMetaObject::activate (sender=0x722c40, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffc32b88530) at kernel/qobject.cpp:3713
#11 0x00007f940760ad97 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f94085689c0 <QActionGroup::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffc32b88530) at kernel/qobject.cpp:3578
#12 0x00007f94080418bf in QActionGroup::triggered (this=<optimized out>, _t1=0xd60d90) at .moc/moc_qactiongroup.cpp:239
#13 0x00007f9408041af8 in QActionGroupPrivate::_q_actionTriggered (this=<optimized out>) at kernel/qactiongroup.cpp:85
#14 0x00007f94080425e9 in QActionGroup::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at .moc/moc_qactiongroup.cpp:117
#15 0x00007f940760a6a4 in QMetaObject::activate (sender=sender@entry=0xd60d90, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc32b886b0) at kernel/qobject.cpp:3713
#16 0x00007f940760ad97 in QMetaObject::activate (sender=sender@entry=0xd60d90, m=m@entry=0x7f94085688c0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc32b886b0) at kernel/qobject.cpp:3578
#17 0x00007f940803e252 in QAction::triggered (this=this@entry=0xd60d90, _t1=false) at .moc/moc_qaction.cpp:365
#18 0x00007f9408040898 in QAction::activate (this=0xd60d90, event=<optimized out>) at kernel/qaction.cpp:1162
#19 0x00007f94081c786a in QMenuPrivate::activateCausedStack (this=this@entry=0x733fa0, causedStack=..., action=action@entry=0xd60d90, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1130
#20 0x00007f94081cde24 in QMenuPrivate::activateAction (this=this@entry=0x733fa0, action=action@entry=0xd60d90, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1207
#21 0x00007f94081d2702 in QMenu::mouseReleaseEvent (this=<optimized out>, e=0x7ffc32b88cf0) at widgets/qmenu.cpp:2536
#22 0x00007f940808bf38 in QWidget::event (this=this@entry=0x733e10, event=event@entry=0x7ffc32b88cf0) at kernel/qwidget.cpp:9044
#23 0x00007f94081d3133 in QMenu::event (this=0x733e10, e=0x7ffc32b88cf0) at widgets/qmenu.cpp:2650
#24 0x00007f94080486bc in QApplicationPrivate::notify_helper (this=this@entry=0x689770, receiver=receiver@entry=0x733e10, e=e@entry=0x7ffc32b88cf0) at kernel/qapplication.cpp:3716
#25 0x00007f940804e5c8 in QApplication::notify (this=<optimized out>, receiver=0x733e10, e=0x7ffc32b88cf0) at kernel/qapplication.cpp:3276
#26 0x00007f94075e246d in QCoreApplication::notifyInternal (this=0x7ffc32b8b0e0, receiver=receiver@entry=0x733e10, event=event@entry=0x7ffc32b88cf0) at kernel/qcoreapplication.cpp:965
#27 0x00007f940804cf1a in QCoreApplication::sendSpontaneousEvent (event=0x7ffc32b88cf0, receiver=0x733e10) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:227
#28 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x733e10, event=event@entry=0x7ffc32b88cf0, alienWidget=alienWidget@entry=0x0, nativeWidget=0x733e10, buttonDown=buttonDown@entry=0x7f9408598720 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:2770
#29 0x00007f94080a73e2 in QWidgetWindow::handleMouseEvent (this=this@entry=0x6aa040, event=event@entry=0x7ffc32b89100) at kernel/qwidgetwindow.cpp:452
#30 0x00007f94080a99db in QWidgetWindow::event (this=0x6aa040, event=0x7ffc32b89100) at kernel/qwidgetwindow.cpp:210
#31 0x00007f94080486bc in QApplicationPrivate::notify_helper (this=this@entry=0x689770, receiver=receiver@entry=0x6aa040, e=e@entry=0x7ffc32b89100) at kernel/qapplication.cpp:3716
#32 0x00007f940804db30 in QApplication::notify (this=0x7ffc32b8b0e0, receiver=0x6aa040, e=0x7ffc32b89100) at kernel/qapplication.cpp:3499
#33 0x00007f94075e246d in QCoreApplication::notifyInternal (this=0x7ffc32b8b0e0, receiver=receiver@entry=0x6aa040, event=event@entry=0x7ffc32b89100) at kernel/qcoreapplication.cpp:965
#34 0x00007f9407b20853 in QCoreApplication::sendSpontaneousEvent (event=0x7ffc32b89100, receiver=0x6aa040) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:227
#35 QGuiApplicationPrivate::processMouseEvent (e=0xd44a70) at kernel/qguiapplication.cpp:1789
#36 0x00007f9407b22505 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0xd44a70) at kernel/qguiapplication.cpp:1581
#37 0x00007f9407b07234 in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:625
#38 0x00007f93f93e81a0 in userEventSourceDispatch (source=<optimized out>) at eventdispatchers/qeventdispatcher_glib.cpp:70
#39 0x00007f9402e498ed in g_main_dispatch (context=0x7f93f00016f0) at /var/tmp/portage/dev-libs/glib-2.44.1-r1/work/glib-2.44.1/glib/gmain.c:3122
#40 g_main_context_dispatch (context=context@entry=0x7f93f00016f0) at /var/tmp/portage/dev-libs/glib-2.44.1-r1/work/glib-2.44.1/glib/gmain.c:3737
#41 0x00007f9402e49bd0 in g_main_context_iterate (context=context@entry=0x7f93f00016f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.44.1-r1/work/glib-2.44.1/glib/gmain.c:3808
#42 0x00007f9402e49c7c in g_main_context_iteration (context=0x7f93f00016f0, may_block=1) at /var/tmp/portage/dev-libs/glib-2.44.1-r1/work/glib-2.44.1/glib/gmain.c:3869
#43 0x00007f940762fe37 in QEventDispatcherGlib::processEvents (this=0x6c5fc0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#44 0x00007f94075e108a in QEventLoop::exec (this=this@entry=0x7ffc32b894a0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#45 0x00007f94081ccae0 in QMenu::exec (this=this@entry=0xee0a30, p=..., action=action@entry=0x0) at widgets/qmenu.cpp:2307
#46 0x00007f940c90b60b in DolphinContextMenu::openViewportContextMenu (this=0xee0a30) at /var/tmp/portage/kde-apps/dolphin-15.08.2/work/dolphin-15.08.2/src/dolphincontextmenu.cpp:366
#47 0x00007f940c90b9b3 in DolphinContextMenu::open (this=0xee0a30) at /var/tmp/portage/kde-apps/dolphin-15.08.2/work/dolphin-15.08.2/src/dolphincontextmenu.cpp:116
#48 0x00007f940c9013fa in DolphinMainWindow::openContextMenu (this=0x73d920, pos=..., item=..., url=..., customActions=...) at /var/tmp/portage/kde-apps/dolphin-15.08.2/work/dolphin-15.08.2/src/dolphinmainwindow.cpp:758
Comment 10 Frank Reininghaus 2015-12-01 20:57:50 UTC
*** Bug 356155 has been marked as a duplicate of this bug. ***
Comment 11 Yurii Kolesnykov 2015-12-02 08:57:44 UTC
Huge waste of time (2 weeks) is not saying just simple comment "Please add backtrace".
Comment 12 Frank Reininghaus 2015-12-02 09:40:37 UTC
(In reply to Yuriy Kolesnikov from comment #11)

What I meant was: If you thought that this report has important information that is missing from bug 356155, then you could have added this information as a new comment to that bug. This would have taken less time overall than reopening this report, demanding explanations and forcing me to provide the explanation, do new duplicate marking, and copy and paste the backtrace. It's maybe just 10 minutes, so you may disagree with my wording "huge waste of time", but if you handle many bug reports, then these minutes add up and take hours that could have been spent debugging and possibly fixing problems.

Let's not get angry at each other - I fully acknowledge that you have provided useful information about the bug. Your help is much appreciated.

About the 2 week delay: I fully agree that it's sad that it often takes long (sometimes even much longer) until bug reporters get feedback. The only thing that helps is new volunteers who help to triage incoming bug reports :-)

I'll reasign the report to KIO because this is where the crash happens. I currently do not have the time for analyzing this problem, but maybe someone else does.
Comment 13 Dmitry Osipenko 2015-12-02 10:30:51 UTC
I confirm that downgrading kde-frameworks/kio 5.16 => 5.15 fixes issue.
Comment 14 David Faure 2015-12-12 22:33:25 UTC
Hmm, with 5.16 or 5.17 I don't get doubled entries in the Create New menu, when starting dolphin with LC_ALL=fr.

And I can't test LC_ALL=ru because... there's no [ru] translation in kio/src/new_file_templates/*.desktop. The string Папку appears nowhere in there.
Is there a ru-specific patch/hack of some sort? Or is "ru" not the actual language name?
Something's very odd...

Can you guys test with LC_ALL=fr, so we can find out if this is ru-specific?
Comment 15 Dmitry Osipenko 2015-12-12 22:50:17 UTC
"ru" is the language name. String "Папку..." is in "/usr/share/templates/Directory.desktop", belongs to kde-apps/libkonq-15.08.3 package, no additional patches.
Comment 16 Dmitry Osipenko 2015-12-12 22:54:25 UTC
LC_ALL=fr works fine here, no doubled entries.
Comment 17 Alex 2015-12-13 21:07:31 UTC
(In reply to David Faure from comment #14)
> Hmm, with 5.16 or 5.17 I don't get doubled entries in the Create New menu,
> when starting dolphin with LC_ALL=fr.
> 
> And I can't test LC_ALL=ru because... there's no [ru] translation in
> kio/src/new_file_templates/*.desktop. The string Папку appears nowhere in
> there.

The are some missing translation strings in kio/src/new_file_templates/*.desktop. Adding those strings and rebuilding the package solves the problem (i.e. there are no duplicate entries in menu any more).
List of affected languages: [ar], [ast], [bs], [hi], [is], [ja], [ka], [km], [ko], [lt], [lv], [ru], [se], [tr], [ug].
Comment 18 David Faure 2015-12-14 08:17:23 UTC
I see. Could you try this patch (for kio) ?

http://www.davidfaure.fr/2015/knewfilemenu.cpp.diff
Comment 19 Dmitry Osipenko 2015-12-14 16:36:20 UTC
(In reply to David Faure from comment #18)
> I see. Could you try this patch (for kio) ?
> 
> http://www.davidfaure.fr/2015/knewfilemenu.cpp.diff

Doesn't help.
Comment 20 Alex 2015-12-14 22:57:21 UTC
Created attachment 96072 [details]
A hacky workaround patch
Comment 21 Alex 2015-12-14 23:00:09 UTC
(In reply to David Faure from comment #18)
> I see. Could you try this patch (for kio) ?
> 
> http://www.davidfaure.fr/2015/knewfilemenu.cpp.diff

The patch above doesn't solve the problem. I guess the "contains" line doesn't work because the names of entries aren't equal.
Comparing URLs seems like a better idea to me.
Add-if-not-exists-already approach leaves the untranslated strings only, so I rewrote that in a "hacky" way.
I have attached an ugly patch I wrote (just for reference). It helps btw.

As I have mentioned previously, the simple fix is to add the missing translation strings. The strings are present in /lib/konq/Templates/*.desktop (kde-baseapps source).
Comment 22 David Faure 2015-12-15 07:51:58 UTC
Comment on attachment 96072 [details]
A hacky workaround patch

Ah I thought my patch would compare filenames (of desktop files). If it compares full paths that can't work indeed. Your patch compares URL values, but I still think it would be simpler to compare filenames of desktop files (i.e. Directory.desktop).

There are two desktop files: one in the .qrc resource (i.e. built into the library) and one installed on the filesystem (by libkonq, for historical reasons -- the next libkonq release won't have that anymore). My idea was that I want the builtin one (from the .qrc) to be preferred in such a case, even if right now that is missing a few translations. But thinking about it again, if we prefer the ones installed on the filesystem then we allow users to make more customizations than if we always prefer the builtin ones. Not sure there's really a use case for that though, but who knows. A sysadmin could hide specific entries by installing Hidden=true desktop files for instance (I didn't test this).

Adding missing translations just hides the fact that this code is collecting templates both from the resource and from the filesystem, which wasn't the intention (we want to look at the filesystem for additional templates, not to create duplicates with those provided in the .qrc resource). That's why I'm looking for a fix for that.

The alternative is to just treat this as a temporary issue and wait for the next libkonq release, but I'm wondering if a kde4 installation could, too, install conflicting templates, hence the idea of avoiding duplicates.
Comment 23 David Faure 2016-01-14 08:09:29 UTC
Can someone test the patch I posted in my previous comment?
Comment 24 Dmitry Osipenko 2016-01-14 13:06:17 UTC
Hi David,

(In reply to David Faure from comment #23)
> Can someone test the patch I posted in my previous comment?

I guess nobody, including me, noticed that your message included the attachment. Just tested it, works fine - no dups, only localized menu entries. Thanks!
Comment 25 Frank Reininghaus 2016-01-18 20:40:25 UTC
*** Bug 358169 has been marked as a duplicate of this bug. ***
Comment 26 Alex Frolov 2016-02-19 09:44:53 UTC
Ugly workaround: remove file /usr/share/templates/Directory.desktop
After this you'll have only Create...>Folder... menu entry w/o its localized duplicate and it'll work.
Comment 27 Dominik Haumann 2016-04-30 20:39:06 UTC
*** Bug 362458 has been marked as a duplicate of this bug. ***
Comment 28 Dominik Haumann 2016-04-30 20:39:35 UTC
*** Bug 361759 has been marked as a duplicate of this bug. ***
Comment 29 Dominik Haumann 2016-04-30 20:41:31 UTC
I looks like a solution does exist, but noone committed it, right? Could someone take care of this? It seems this is still an issue, see duplicates.
Comment 30 David Faure 2016-05-01 08:57:09 UTC
Git commit 487c83920761ac76451d9bbb33ee39990395c40f by David Faure.
Committed on 01/05/2016 at 08:56.
Pushed by dfaure into branch 'master'.

New file menu: filter out duplicates (e.g. between .qrc and system files)
FIXED-IN: 5.22

M  +17   -1    src/filewidgets/knewfilemenu.cpp

http://commits.kde.org/kio/487c83920761ac76451d9bbb33ee39990395c40f
Comment 31 Elvis Angelaccio 2016-10-25 09:40:15 UTC
*** Bug 365223 has been marked as a duplicate of this bug. ***
Comment 32 Elvis Angelaccio 2016-10-25 09:45:53 UTC
*** Bug 364961 has been marked as a duplicate of this bug. ***
Comment 33 Elvis Angelaccio 2016-10-25 09:46:53 UTC
*** Bug 366129 has been marked as a duplicate of this bug. ***
Comment 34 Elvis Angelaccio 2016-10-25 09:48:10 UTC
*** Bug 364787 has been marked as a duplicate of this bug. ***
Comment 35 Vincas Dargis 2016-10-25 15:39:55 UTC
Has anyone idea, will this fix land in Kubuntu 16.04?
Comment 36 Elvis Angelaccio 2016-11-03 14:13:08 UTC
*** Bug 371972 has been marked as a duplicate of this bug. ***
Comment 37 Elvis Angelaccio 2018-01-21 19:29:12 UTC
*** Bug 389293 has been marked as a duplicate of this bug. ***