! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar utilizes 100%CPU when the parent directory is not readable
Status:
RESOLVED: FIXED

Comments

Description arian 2018-11-24 13:00:13 CET
Thunar utilizes 100%CPU, presumably without doing anything useful, when the parent directory is not readable.

to reproduce:

mkdir -p -- /tmp/--x/rwx
chmod 100 /tmp/--x
cd /tmp/--x/rwx
thunar

observe near 100% cpu utilization. Then, in thunar change to any other directory with a readable parent and watch the cpu load drop
Comment 1 Andre Miranda editbugs 2018-11-24 15:46:22 CET
I can't reproduce, which distribution are you using?
Comment 2 alexxcons editbugs 2018-11-24 21:47:57 CET
As well cannot reproduce.

Possibly related to Bug #10161, which is only for network shares, only tree-view. Possibly you are using both ?
Comment 3 arian 2018-11-25 09:24:19 CET
bug only triggers when the tree-view is enabled - thanks for the hint, alexxcons. But this is not on a network share, nor with any network shares enabled

I'm running on debian buster (current testing)
Comment 4 alexxcons editbugs 2018-11-27 08:18:42 CET
Yes, its the tree-view, now I as well can reproduce it !

Wonder if fixing this one will as well fix Bug #10161,

Will have a look into it, when I have time.

Thanks for reporting by the way !
Comment 5 alexxcons editbugs 2018-12-13 23:35:22 CET
Created attachment 8179 
preleminary fix

The actual problem is, that non-readable folder are not loaded into the model of the tree-view, even if the path of the current working directory contains them.

The bug is triggered when thunar attempts to mark the related folder in the tree as "selected".

Thunar walks through the tree to identify the correct folder starting with the tree-root. If there is a non-readable folder in the way, thunar does not give up the search :) 

The patch stops the search if a non readable folder was found.
This is not a full fix, it just cures the worst symptoms.

Still a problem is, that the complete subtree after a non-readable folder will not be displayed in the tree-view if a sub-directory of the non-readable folder is loaded.
Comment 6 alexxcons editbugs 2018-12-13 23:51:08 CET
A proper fix could be to always force-load the path of the current directory into the tree-model ... will see what I can do.
Comment 7 alexxcons editbugs 2018-12-23 23:51:23 CET
Created attachment 8195 
proper fix

Here a proper fix .. some refactoring was required, since the related method walked the tree in the wrong direction, making things overcomplex.

For me it works well now .. please take a try and let me know if it as well works fine for you !
Comment 8 alexxcons editbugs 2018-12-23 23:57:22 CET
Created attachment 8196 
proper fix

ops, I added some crap into the patch .. fixed
Comment 9 alexxcons editbugs 2018-12-24 00:13:27 CET
Created attachment 8197 
proper fix

.. some more crap removed :/  doh
Comment 10 arian 2018-12-24 11:45:29 CET
Confirm normal cpu usage, looks like this is working. It's like a christmas present, very nice :)

btw, when applying git mentions:
arian@jira:thunar$ git am < attachment.cgi\?id\=8197
Applying: Thunar utilizes 100%CPU when the parent directory is not readable (Bug #14900) - as well fixes tree-view not showing the related folder
.git/rebase-apply/patch:78: trailing whitespace.
 * 
.git/rebase-apply/patch:97: trailing whitespace.
 * Creates a new #ThunarTreeModelItem as a child of @node and stores a reference to the passed @file 
.git/rebase-apply/patch:148: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Comment 11 alexxcons editbugs 2018-12-25 00:45:36 CET
Created attachment 8198 
proper fix

Merry Christmas ! :P  - whitespace errors fixed now.

Will wait for 1-2 other tests/reviews before pusing it.
Comment 12 Andre Miranda editbugs 2018-12-27 02:23:32 CET
The patch looks good, though I didn't review the logic thoroughly, that was quite a change!
All in all, it fixes the bug (which I can reproduce now) and simplifies some parts of the code, thanks!
Comment 13 Git Bot editbugs 2018-12-27 22:42:42 CET
Alexander Schwinn referenced this bugreport in commit 85a79da3f263596c88b0de6098226599b46a6304

Thunar utilizes 100%CPU when the parent directory is not readable (Bug #14900) - as well fixes tree-view not showing the related folder

https://git.xfce.org/xfce/thunar/commit?id=85a79da3f263596c88b0de6098226599b46a6304
Comment 14 Git Bot editbugs 2018-12-27 23:00:42 CET
Alexander Schwinn referenced this bugreport in commit 2963db9bfa7a9305a3f49037e1ed0caa1082e418

Thunar utilizes 100%CPU when the parent directory is not readable Bug #14900 - as well fixes tree-view not showing the related folder

https://git.xfce.org/xfce/thunar/commit?id=2963db9bfa7a9305a3f49037e1ed0caa1082e418
Comment 15 Git Bot editbugs 2018-12-27 23:03:44 CET
Alexander Schwinn referenced this bugreport in commit d75fa9dd5ec3f995551a6d9817e0ffdeeb3b3c5d

Thunar utilizes 100%CPU when the parent directory is not readable (Bug #14900) - as well fixes tree-view not showing the related folder

https://git.xfce.org/xfce/thunar/commit?id=d75fa9dd5ec3f995551a6d9817e0ffdeeb3b3c5d
Comment 16 alexxcons editbugs 2018-12-27 23:07:07 CET
Thanks for testing !  Now pushed to master, 4.12 and 4.14

Will ask other devs for some more testing before releasing it into thunar 1.6.16 and 1.8.3
Comment 17 alexxcons editbugs 2018-12-27 23:16:41 CET
*** Bug 10161 has been marked as a duplicate of this bug. ***

Bug #14900

Reported by:
arian
Reported on: 2018-11-24
Last modified on: 2018-12-27

People

Assignee:
alexxcons
CC List:
5 users

Version

Attachments

preleminary fix (1.11 KB, patch)
2018-12-13 23:35 CET , alexxcons
no flags
proper fix (54.40 KB, patch)
2018-12-23 23:51 CET , alexxcons
no flags
proper fix (17.11 KB, patch)
2018-12-23 23:57 CET , alexxcons
no flags
proper fix (16.54 KB, patch)
2018-12-24 00:13 CET , alexxcons
no flags
proper fix (16.54 KB, patch)
2018-12-25 00:45 CET , alexxcons
no flags

Additional information