! 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 !
Crash in tree-view when multiple windows are open
Status:
RESOLVED: FIXED

Comments

Description alexxcons editbugs 2018-09-23 23:44:49 CEST
Most times thunar only emits  "thunar-CRITICAL " messages into the console and draws a blanc tree-view in all open thunar windows. Occasionally it as well crashes.

To reproduce I do the following:
1. Open fresh thunar:  thunar -q; thunar
2. Switch to tree view if not already visible: View --> SidePane --> Tree ( CTRL + E )
3. Open new window: File --> New Window  ( CTRL + N )
4. Close the new window ( CTRL + Q )
5. Toggle View-->"show hidden files" ( CTRL + H )

Hidden files should not be visible when the first window is created.

Here the CRITICAL Message I get:
(thunar:12720): thunar-CRITICAL **: thunar_tree_view_visible_func: assertion '(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((user_data)); GType __t = ((thunar_tree_view_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))' failed
Comment 1 alexxcons editbugs 2018-10-02 22:23:11 CEST
Created attachment 8011 
patch

The problem is, that thunar-tree-model is implemented as singleton.  

When a new thunar-tree-view is created, the tree-view registers itself in the single thunar-tree-model.
The tree-view will be used by tree-model to decide if specific hidden files should be displayed.

Since each thunar-window creates a fresh tree-view, the reference in tree-model will be overwritten by the tree-view of the new window.

If the new window is closed, the reference will point to nowhere. An update of the tree on the old window may now result in a crash.

According to gtk-doc, the tree-model seems to be the place where tree-items can be added / removed. And it does not make sense to register multiple tree-views in one tree-model (IMO each tree-view should have its own show/hide toggle)

This fix just removes the singleton nature from the tree-model, so that each tree-view has its own tree-model.

I checked all tree-model methods to see if this could have negative side-effects, and I as well did some testing. For me everything works fine.

However I would be happy if someone else as well could test the patch before I push it.
Comment 2 alexxcons editbugs 2018-10-02 22:30:32 CEST
*** Bug 14423 has been marked as a duplicate of this bug. ***
Comment 3 alexxcons editbugs 2018-10-02 22:36:26 CEST
*** Bug 11903 has been marked as a duplicate of this bug. ***
Comment 4 alexxcons editbugs 2018-10-03 21:55:46 CEST
Created attachment 8016 
patch

just fixed a comment
Comment 5 Git Bot editbugs 2018-10-06 21:56:26 CEST
Alexander Schwinn referenced this bugreport in commit 5d6b51a21a1466c2e8b8a3b2dec273ed23bec563

Crash in tree-view when multiple windows are open (Bug #14714)

https://git.xfce.org/xfce/thunar/commit?id=5d6b51a21a1466c2e8b8a3b2dec273ed23bec563
Comment 6 Git Bot editbugs 2018-10-06 22:00:06 CEST
Alexander Schwinn referenced this bugreport in commit 59bad0ce5de26d117dc9350d78fbb67bb4735faf

Crash in tree-view when multiple windows are open (Bug #14714)

https://git.xfce.org/xfce/thunar/commit?id=59bad0ce5de26d117dc9350d78fbb67bb4735faf
Comment 7 alexxcons editbugs 2018-10-06 22:06:04 CEST
Patch considered to be fine after some more testing by me and Andre Miranda ( thanks alot for that! )

Applied to master and 4.14 branch. Will be released in thunar 1.8.3
Comment 8 alexxcons editbugs 2018-10-13 21:02:15 CEST
*** Bug 14640 has been marked as a duplicate of this bug. ***
Comment 9 Git Bot editbugs 2018-10-13 21:12:28 CEST
Alexander Schwinn referenced this bugreport in commit 42bfa0dc3be571cf8677ac350d115528597f899b

Crash in tree-view when multiple windows are open (Bug #14714)

https://git.xfce.org/xfce/thunar/commit?id=42bfa0dc3be571cf8677ac350d115528597f899b
Comment 10 alexxcons editbugs 2018-10-13 21:13:45 CEST
^^ as well pushed to 4.12 branch, to be released as 1.6.16
Comment 11 alexxcons editbugs 2018-12-10 22:58:37 CET
*** Bug 12311 has been marked as a duplicate of this bug. ***

Bug #14714

Reported by:
alexxcons
Reported on: 2018-09-23
Last modified on: 2018-12-10
Duplicates (4):
  • 11903 Opening and closing a new window with a ThunarTreeView will cause invalid unclassed pointer casts
  • 12311 Deleting folder from side pane tree view may crash all instances of Thunar
  • 14423 U18.04 Thunar Hidden files in Tree view visibility only changes from last open window
  • 14640 thunar crashes abruptly

People

Assignee:
alexxcons
CC List:
6 users

Version

Attachments

patch (3.54 KB, patch)
2018-10-02 22:23 CEST , alexxcons
no flags
patch (3.87 KB, patch)
2018-10-03 21:55 CEST , alexxcons
no flags

Additional information