Bug 358723 - Gwenview, Dolphin, and many other apps crash when clicking 'Network' folder in the dir tree view.
Summary: Gwenview, Dolphin, and many other apps crash when clicking 'Network' folder i...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: remote (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-29 08:08 UTC by Takahiro Hashimoto
Modified: 2016-02-01 16:56 UTC (History)
3 users (show)

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


Attachments
gdb output (62.40 KB, text/plain)
2016-01-29 08:09 UTC, Takahiro Hashimoto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Takahiro Hashimoto 2016-01-29 08:08:40 UTC
-- Information about the crash:
- Environment:
 * Gentoo kernel 4.4.0/Qt 5.6 branch latest self build
 * Fedora 23 Kernel 4.3.3/Qt5.5 branch latest self build 
 * KF5 branch: master

- My investigation

Because of empty UDS_NAME in dir list entry causes crash.
Please review these pactches[1][2] to fix this issue.

[1] https://git.reviewboard.kde.org/r/126892/
[2] https://git.reviewboard.kde.org/r/126893/

Reproducible: Always

Steps to Reproduce:
  The procedure to reproduce
   1. Open Gwenview
   2. Click the folder 'home' or 'Network' folder on the treeview in the left directory tree view.

Actual Results:  
App crash

Expected Results:  
App remains working

gdb log attached.
Comment 1 Takahiro Hashimoto 2016-01-29 08:09:53 UTC
Created attachment 96897 [details]
gdb output
Comment 2 Eike Hein 2016-01-29 11:28:25 UTC
This seems to be kio rather than Plasma?
Comment 3 Takahiro Hashimoto 2016-01-29 11:58:26 UTC
(In reply to Eike Hein from comment #2)
> This seems to be kio rather than Plasma?

I'm sorry if I don't point correct module category for this bug report.
Please let me explain the reason why I think my fixes suits for this bug.

First, certainly, the root cause of crash is the ASSERT, empty check of UDS_NAME in kio/core/kcoredirlister.cpp. UDS_NAME should not be empty, described in kio/core/udsentry.h:177 [1] 

---
175         /// Filename - as displayed in directory listings etc.
176         /// "." has the usual special meaning of "current directory"
177         /// UDS_NAME must always be set and never be empty, neither contain '/'.
178         ///
179         /// Note that KIO will append the UDS_NAME to the url of their
180         /// parent directory, so all kioslaves must use that naming scheme
181         /// ("url_of_parent/filename" will be the full url of that file).
182         /// To customize the appearance of files without changing the url
183         /// of the items, use UDS_DISPLAY_NAME.
184         UDS_NAME = 6 | UDS_STRING,
----

Second, the lack of UDS_NAME in the dirlist is caused by 'remote' kioslave implementation.
In this case, the wrong .desktop name is specified in kioslave/remote/remoteimpl.cpp in plasma-workspace. One of my patches[2] is to fix it.

The last, 'Network' folder is created by createWizardEntry() in kioslave/remote/kio_remote.cpp.
It's my guess, for some situation, for example, of knetattach isn't installed, createWizardEntry() returns bool value. I'd like to add the check of this value if correct dir entry is created or not with my patch.[3]

Of course much better solution makes me happy. Please let me have your comment:)

[1] https://quickgit.kde.org/?p=kio.git&a=blob&h=9b2153061cc3f9552eb18a6dc950a904fb4d4285&hb=7f3dbd33391ca62d9944e00490933f801f555ba2&f=src%2Fcore%2Fudsentry.h
[2] https://git.reviewboard.kde.org/r/126893/diff/1#0
[3] https://git.reviewboard.kde.org/r/126892/diff/1#index_header
Comment 4 Takahiro Hashimoto 2016-02-01 16:56:29 UTC
Git commit 6267c5a24b710bfd431d676c85277cd316b981dd by Takahiro Hashimoto.
Committed on 01/02/2016 at 16:50.
Pushed by hashimoto into branch 'master'.

[kioslave/remote] fix knetattach .desktop filename
REVIEW: 126893

M  +1    -1    kioslave/remote/remoteimpl.cpp

http://commits.kde.org/plasma-workspace/6267c5a24b710bfd431d676c85277cd316b981dd