[GTK 3.20] drag & drop segfaults #636

Open
svenXY opened this Issue Apr 12, 2016 · 25 comments

Projects

None yet

7 participants

@svenXY
svenXY commented Apr 12, 2016

Hi,
I'm running Arch here and after the last upgrades (which included a new gtk3 Version), spacefm and spacefm-git both segfault when attempting a drag & drop operation. The segfault is without further information.

spacefm-gtk2 works as expected.

Thanks for checking,
Sven

@IgnorantGuru
Owner

Would be good to include what version of GTK3 is involved, and also the output of 'spacefm --version'

Also, if you are using a 3rd party GTK theme, be sure to test with the default Adwaita theme for comparison, as these kinds of issues are often the result of a 3rd party theme breaking when GTK is updated.

In addition, running spacefm in a terminal and reporting any output which appears before the segfault may be helpful. If this can't be reproduced, a backtrace may also be helpful (see BUILD DEBUG in README).

@svenXY
svenXY commented Apr 13, 2016
 spacefm
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
(spacefm:15441): Gtk-WARNING **: Allocating size to GtkToolItem 0x27cddd0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:15441): Gtk-WARNING **: Allocating size to GtkToolItem 0x27cdf60 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:15441): Gtk-WARNING **: Allocating size to GtkToolItem 0x27f4160 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:15441): Gtk-WARNING **: Allocating size to GtkToolItem 0x27f42f0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:15441): Gtk-WARNING **: Allocating size to GtkToolItem 0x27f4480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:15441): Gtk-WARNING **: Allocating size to GtkToolItem 0x27f4610 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:15441): Gtk-WARNING **: Allocating size to GtkScrolledWindow 0x25bb100 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:15441): Gtk-WARNING **: Allocating size to FMMainWindow 0x249c260 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
[1]    15441 segmentation fault (core dumped)  spacefm

extra/gtk3 3.20.2-1
Theme is Adwaita

aur/spacefm-git 20160403-1 (17, 0,51)

spacefm --version
spacefm 1.0.5+next
GTK3 UDEV INOTIFY DESKTOP SNOTIFY

@svenXY
svenXY commented Apr 13, 2016

if you want me to create a backtrace, I'd need some help.

I'm using Arch Linux spacefm-git, which comes with a PKGBUILD file that has an autogen.sh line:

prepare() {                                                                                                                                                                   cd $srcdir/spacefm"                                                                                 
  ./autogen.sh --prefix=/usr $_opts
}   

Do I have to add the CFLAGS='-ggdb3' STRIP='!strip' there? Or what other option do I have to do this with out leavin Arch package management?

@IgnorantGuru
Owner

It looks like Arch's AUR latest spacefm-git isn't gdb ready, so (contrary to what SpaceFM's README currently says about Arch) you will probably need to add CFLAGS='-ggdb3' STRIP='!strip' before make in PKGBUILD:build():

CFLAGS='-ggdb3' STRIP='!strip' make

Install the debug packages for GTK etc (not sure how this works in Arch, might not need them), and run 'gdb spacefm', following the directions in BUILD DEBUG of README from that point.

Given the output you reported above, and the fact that you're using Adwaita, this problem may indicate some change in the latest GTK which breaks SpaceFM. We'll have to give 3.20 a try to see if its reproducible.

In general GTK3 is prone to this breakage across versions. That's why GTK2 is still and may always be the default for SpaceFM, especially if stability is preferred.

@IgnorantGuru IgnorantGuru changed the title from drag & drop segfaults to [GTK 3.20] drag & drop segfaults Apr 13, 2016
@IgnorantGuru IgnorantGuru added the bug label Apr 13, 2016
@IgnorantGuru
Owner

If you like, you can wait on the backtrace until we have a chance to try to reproduce this - if it's reproducible we won't need the trace. None of SpaceFM's devs are yet using 3.20.

@IgnorantGuru IgnorantGuru added this to the 1.0.6 milestone Apr 13, 2016
@IgnorantGuru
Owner

Also, regarding the theme parsing errors above, I don't see how GTK could have trouble parsing an up-to-date Adwaita theme, as they are developed together. This could indicate you aren't really using Adwaita as the theme, the version of Adwaita installed is somehow out of sync with the installed version of GTK3, or that GTK3 itself is broken with its own default theme.

Those theme parsing errors are much more typical of a 3rd party theme that is not up-to-date with the version of GTK3 installed, fwiw.

@svenXY
svenXY commented Apr 14, 2016
(gdb) run
Starting program: /usr/bin/spacefm 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe1d32700 (LWP 19372)]
[New Thread 0x7fffe1531700 (LWP 19373)]
special mount changed: //some/share (0:39) on /mnt/share
special mount changed: //some/share-media (0:42) on /mnt/share-media

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
[New Thread 0x7fffe09a8700 (LWP 19377)]

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
[New Thread 0x7fffd3fff700 (LWP 19378)]
[Thread 0x7fffe09a8700 (LWP 19377) exited]
[Thread 0x7fffd3fff700 (LWP 19378) exited]

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:19368): Gtk-WARNING **: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
[New Thread 0x7fffd318a700 (LWP 19379)]

(spacefm:19368): Gtk-WARNING **: Allocating size to GtkToolItem 0xdd0df0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:19368): Gtk-WARNING **: Allocating size to GtkToolItem 0xdd0f80 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:19368): Gtk-WARNING **: Allocating size to GtkToolItem 0xdf8170 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:19368): Gtk-WARNING **: Allocating size to GtkToolItem 0xdf8300 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:19368): Gtk-WARNING **: Allocating size to GtkToolItem 0xdf8490 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:19368): Gtk-WARNING **: Allocating size to GtkToolItem 0xdf8620 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:19368): Gtk-WARNING **: Allocating size to GtkScrolledWindow 0xbb3120 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
[New Thread 0x7fffe09a8700 (LWP 19380)]
[New Thread 0x7fffd3fff700 (LWP 19381)]
[Thread 0x7fffd3fff700 (LWP 19381) exited]
[Thread 0x7fffe09a8700 (LWP 19380) exited]

(spacefm:19368): Gtk-WARNING **: Allocating size to FMMainWindow 0xade240 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

Thread 1 "spacefm" received signal SIGSEGV, Segmentation fault.
0x00007ffff7888f33 in gtk_drag_dest_find_target () from /usr/lib/libgtk-3.so.0
(gdb) thread apply all bt full
Couldn't get registers: Kein passender Prozess gefunden.
(gdb) quit
A debugging session is active.

        Inferior 1 [process 19368] will be killed.

This is all I got. The bug froze my X session, so I had to go to a different TTY and kill spacefm from there. But maybe this already helps?

@IgnorantGuru
Owner
IgnorantGuru commented Apr 14, 2016 edited

No backtrace there - it looks like the freeze in X killed the thread or something before gdb could get it. However it does give some info.

The crash is occurring in GTK's code in gtk_drag_dest_find_target(). The first two arguments to that function are passed to the handler by GTK so are likely to be valid. The third argument (target_list) is likely created and passed here. The original author who wrote that code has a FIXME note there regarding the method he used. It could be that code is passing a NULL target list under that version of GTK, but gtk_drag_dest_find_target() accepts a NULL for that argument and GTK usually tests for NULL arguments sent to the API anyway. This indicates a likely bug in GTK or the theme.

Given all the theme parse warnings in addition to where the crash is occurring, this still looks like a theme malfunction. A misfit theme can often trigger crashes, hangs, or memory leaks in GTK's code. You might try reinstalling GTK libs and Adwaita, just to see if they are somehow damaged on your system (it does happen), and also then rebuild spacefm as well.

Fwiw that DnD code in SpaceFM hasn't changed anytime recently - it applies to GTK 2 and 3. At this point I doubt this can be corrected by a change in SpaceFM's code - the info thus far (including the X freeze) points to a GTK malfunction.

@ckol
ckol commented Apr 15, 2016 edited

I am running into the same issues here on Arch Linux.

gdb spacefm and drag&dropping a file leads to:


(spacefm:11300): Gtk-WARNING **: Allocating size to FMMainWindow 0xa4c280 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

Thread 1 "spacefm" received signal SIGSEGV, Segmentation fault.
0x00007ffff7888f33 in gtk_drag_dest_find_target () from /usr/lib/libgtk-3.so.0
(gdb) Exception ignored in: <gdb.GdbOutputFile object at 0x7f4efd64ac50>
Traceback (most recent call last):
File "/usr/share/gdb/python/gdb/init.py", line 43, in flush
def flush(self):
Keyboard Interrupt


(I had to kill gdb from the console as X stopped to respond at all.)

I've then tried to roll back gtk3:
gtk3-3.20.3-1 (latest as of today) exposes:
Thread 1 "spacefm" received signal SIGSEGV, Segmentation fault.
0x00007ffff7888f33 in gtk_drag_dest_find_target () from /usr/lib/libgtk-3.so.0

gtk3-3.20.2-1 exposes:
Thread 1 "spacefm" received signal SIGSEGV, Segmentation fault.
0x00007ffff7888f23 in gtk_drag_dest_find_target () from /usr/lib/libgtk-3.so.0

(no other version in between on my system)

gtk3-3.18.9-1 works fine!

So, it seems it's an issue in gtk3.
Who is going to contact them?

@ckol
ckol commented Apr 15, 2016 edited

I've cloned git://git.gnome.org/gtk+
and dived a bit into gtk/gtkdragtest.c
The latest commit in this area was:


commit 6ac7b54378ad1a8468df889744321bd61ab9e565
Author: Matthias Clasen xxxxxxx@redhat.com Mon Dec 14 00:43:10 2015
Committer: Matthias Clasen xxxxxxx@redhat.com Fri Mar 25 20:37:20 2016

dnd: Move GtkDragDest to a separate file

This follows what was done for GtkDragSource in
415030d25f2552d3937ee3c394c50d22c5382982 and shaves another 500 lines off gtkdnd.c.


So, I'll contact Matthias Clasen (mclasen@ ... email removed above) to
see if he can help.
Regards,
Clemens

@ckol
ckol commented Apr 15, 2016

I've contacted Matthias Clasen to see if he can help...

@IgnorantGuru
Owner

@ckol Thanks for the upstream info. You might also file a bug with Arch's spacefm package, as this could be a problem with how GTK3 or Adwaita is buildling on Arch. You could also inquire in SpaceFM's Arch thread.

@bradst
bradst commented Apr 19, 2016

FYI, those theme parsing errors are caused by SpaceFM itself. There is some custom CSS being applied in src/main-window.c in lines 2895-2910 (as of commit d75271e):

#if GTK_CHECK_VERSION (3, 0, 0)
            /* Code modified from gedit: gedit-close-button.c */
            static const gchar button_style[] =
                  "* {\n"
                  "-GtkButton-default-border : 0;\n"
                  "-GtkButton-default-outside-border : 0;\n"
                  "-GtkButton-inner-border: 0;\n"
                  "-GtkWidget-focus-line-width : 0;\n"
                  "-GtkWidget-focus-padding : 0;\n"
                  "padding: 0;\n"
                "}"; 
            GtkCssProvider *css_prov = gtk_css_provider_new ();
            gtk_css_provider_load_from_data(css_prov, button_style, -1, NULL);
            GtkStyleContext *ctx = gtk_widget_get_style_context( close_btn );
            gtk_style_context_add_provider( ctx, GTK_STYLE_PROVIDER( css_prov ), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION );
#endif
@IgnorantGuru
Owner
IgnorantGuru commented Apr 19, 2016 edited

I tested next on Archbang live ISO with gtk3 updated to 3.20.3-1.

The theme parse warnings were reproduced and have been corrected - it now omits that code for GTK >= 3.20.0 (this may affect the size of the close buttons on tabs, in case anyone wants to propose a 3.20-compatible alternative). Thanks for the tip @bradst.

I was not able to reproduce any segfault re gtk_drag_dest_find_target, nor did I see any warning for that. Are there particular DnD steps required to reproduce, or a particular view style or panel view required?

For DnD in Icons view style, I saw this warning (no crash):

Gtk-CRITICAL **: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed

That seems to come from here. Apparently exo-icon-view.c's check_model_dnd() function is returning an invalid result for GTK 3.20? Not sure offhand how to correct this, apparently they've changed something. But I doubt that's causing a functional problem, just a warning. Probably just need to test for NULL instead of merely the type check.

I also saw some of these warnings for various widgets, not sure why these are appearing:

Gtk-WARNING **: Allocating size to GtkToolItem 0x2b2aac0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

So overall they've definitely broken or changed something in GTK 3.20 which is causing some warnings in SpaceFM, though I personally couldn't get it to crash or say anything about gtk_drag_dest_find_target, and everything I tested was working normally despite the warnings.

@IgnorantGuru
Owner
IgnorantGuru commented Apr 20, 2016 edited

Also, just a thought, but it may be possible to avoid this problem by using a 3rd party theme instead of Adwaita? It could be the problem is in the updated Adwaita theme (they likely updated it extensively for the new theme API). I say this because in the past, broken themes can cause serious crashes. Also, I noticed less warnings on Archbang when using their default dark theme. When I switch to Adwaita, it seemed to have more issues. (This is the opposite of what i usually advise, Adwaita being the control and default, but it might be worth trying another theme in this case.)

Also, there is an Arch thread detailing issues with GTK 3.20. Included are DnD crashes in SpaceFM as well as Firefox and other apps, so this crash (or a similar DnD-related one) doesn't seem limited to SpaceFM.

@ckol
ckol commented Apr 20, 2016

Hi, there!

I was never using the Adwaita theme. The Segafult in libgtk-3.so.0.2000.3 happens
with the Clearlooks and/or my personal scheme as well as my own one.

Greets,

Clemens

On 2016-04-20 17:10, IgnorantGuru wrote:

Also, just a thought, but it may be possible to avoid this problem by using a 3rd party theme instead of Adwaita? It could be the problem is in the updated Adwaita theme (they likely updated it extensively for the new theme API). I say this because in the past, broken themes can cause serious crashes. Also, I noticed less warnings on Archbang when using their default dark theme. When I switch to Adwaita, it seemed to have more issues. (This is the opposite of what i usually advise, Adwaita being the control and default, but it might be worth trying another theme in this case.)

Also, there is an Arch thread https://bbs.archlinux.org/viewtopic.php?id=210815 detailing issues with GTK 3.20. Included are DnD crashes in SpaceFM as well as Firefox and other apps.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #636 (comment)

@IgnorantGuru
Owner
IgnorantGuru commented May 1, 2016 edited

GTK+ developer Matthias Clasen has provided a more detailed explanation and documentation links for the changes in 3.20, and asks for feedback. I don't think much of that applies to SpaceFM, but he does mention DnD changes.

Also, this paragraph may explain some of the warnings on allocate:
A problem that we’ve seen in some applications is the interaction between size_allocate() and draw(). GTK+’s CSS boxes need to know their size before they can draw. If you derive from a GTK+ widget and override size_allocate without chaining up, then GTK+ does not get a chance to assign sizes to the boxes. This will lead to critical warnings from GTK+’s draw() function if you don’t override it. The possible solutions to this problem are either to chain up in size_allocate or to provide your own draw implementation.

@OmegaPhil
Collaborator

Debian Testing has had 3.20 for a bit now - I have tested under my normal Xfce-basic and Adwaita themes, and the three view styles, dragging and dropping into the same window and other windows, without segfaults. The following was output during testing:

(spacefm:2230): Gtk-WARNING **: Theme parsing error: gtk.css:6:27: The style property GtkNotebook:initial-gap is deprecated and shouldn't be used anymore. It will be removed in a future version

(spacefm:2230): Gtk-CRITICAL **: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed

(spacefm:2230): Gtk-CRITICAL **: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed

(spacefm:2230): Gtk-WARNING **: Allocating size to FMMainWindow 0x25dc250 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:2230): Gtk-CRITICAL **: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed
EXEC(/home/omega/.local/share/applications/geeqie.desktop)=geeqie %F

(spacefm:2230): Gtk-WARNING **: Allocating size to FMMainWindow 0x2b90de0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:2230): Gtk-WARNING **: Allocating size to FMMainWindow 0x25dc250 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

(spacefm:2230): Gtk-CRITICAL **: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed
EXEC(/home/omega/.local/share/applications/mpv.desktop)=mpv --really-quiet --force-window -- %F```
@ckol
ckol commented May 16, 2016

Hi!

No change here at all since weeks:
[ 2854.342735] spacefm[3336]: segfault at 401ccbd08 ip 00007f1c1a3fe448 sp 00007ffe56acf7d0 error 4 in libgdk-3.so.0.2000.4[7f1c1a3a3000+d0000]

Greets,

Clemens

On 2016-05-15 14:42, OmegaPhil wrote:

Debian Testing has had 3.20 for a bit now - I have tested under my normal Xfce-basic and Adwaita themes, and the three view styles, dragging and dropping into the same window and other windows, without segfaults. The following was output during testing:

|(spacefm:2230): Gtk-WARNING *: Theme parsing error: gtk.css:6:27: The style property GtkNotebook:initial-gap is deprecated and shouldn't be used anymore. It will be removed in a future version (spacefm:2230): Gtk-CRITICAL *: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed (spacefm:2230): Gtk-CRITICAL *: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed (spacefm:2230): Gtk-WARNING *: Allocating size to FMMainWindow 0x25dc250 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? (spacefm:2230): Gtk-CRITICAL *: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed EXEC(/home/omega/.local/share/applications/geeqie.desktop)=geeqie %F (spacefm:2230): Gtk-WARNING *: Allocating size to FMMainWindow 0x2b90de0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(spacefm:2230): Gtk-WARNING *: Allocating size to FMMainWindow 0x25dc250 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? (spacefm:2230): Gtk-CRITICAL *: gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed EXEC(/home/omega/.local/share/applications/mpv.desktop)=mpv --really-quiet --force-window -- %F``` |


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #636 (comment)

@IgnorantGuru
Owner

@OmegaPhil I saw the "gtk_tree_drag_source_drag_data_delete: assertion 'iface->drag_data_delete != NULL' failed" warning too. This could be the cause of the segfaults. Looks like iface->drag_data_delete isn't being set for the iconview? This appears to be a pointer to one of the DnD handler functions, but instead it seems to be NULL (or perhaps not NULL but invalid/unset in some cases?)

eg this is set for the class here. This test for it may be failing because check_model_dnd isn't detecting the NULL value? Although it shouldn't be NULL in the first place ofc.

@OmegaPhil
Collaborator

OK, will take a look once I've got the next version of the XFCE4 Hardware Monitor plugin pushed out.

@jmcamp
jmcamp commented Jul 3, 2016

I can consistently reproduce the drag and drop segfault by enabling spacefm's tree view and then dragging a file across the tree.

I am using the latest Arch Bang ISO from June 16, 2016 which has gtk 3.20.6 and spacefm 1.0.5.

@OmegaPhil
Collaborator

I've spent a long time on this trying to get a clue - basically the GtkTreeDragSource* from the model in exo_icon_view_drag_data_delete that is passed to gtk_tree_drag_source_drag_data_delete is duff - in gtk_tree_drag_source_drag_data_delete GtkTreeDragSourceIface* is extracted from it, and all associated function pointers are NULL.

Taking the macro-based type mess apart, GTK_TREE_DRAG_SOURCE_GET_IFACE resolves to:

((((GtkTreeDragSourceIface*) g_type_interface_peek (((GTypeInstance*) ((drag_source)))->g_class, ((gtk_tree_drag_source_get_type ()))))));

The drag_source g_class member is PtkFileList, which importantly doesn't have any drag and drop functions - at least, ptk_file_list_drag_source_init and ptk_file_list_drag_dest_init exist but have no contents ('FIXME: Unused. Will this cause any problem?').

When ran under GTK2, no function ending with 'drag_data_delete' is hit at all (not in SpaceFM source or GTK source), so it could be that this is actually a fix in GTK3 somewhere that is actually causing this machinery to be used for the first time?

As an easy way out, shall I just exit the function immediately? This obviously does away with the error message.

@OmegaPhil OmegaPhil removed the need info label Jul 13, 2016
@joejoe31b

I can confirm that this error is still around in both a git build of spacefm, or the latest release 1.0.5-2. As explained above, it happens when dragging a file or folder over the tree view.

@OmegaPhil
Collaborator

Yes, see my last message - the crappy workaround hasn't been committed as I had no feedback from the maintainer. With some luck I'll be able to get onto these tasks regardless within a month or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment