After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 614544 - If you delete an empty folder with an emblem, and then try to open your trash nautilus hangs
If you delete an empty folder with an emblem, and then try to open your trash...
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: client module
1.6.x
Other Linux
: Normal normal
: ---
Assigned To: Tomas Bzatek
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2010-04-01 07:39 UTC by Ben
Modified: 2010-09-27 15:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (15.12 KB, text/plain)
2010-04-01 07:45 UTC, Ben
  Details
proposed patch (851 bytes, patch)
2010-04-19 14:27 UTC, Tomas Bzatek
committed Details | Review
Another patch fixing the real issue (1.22 KB, patch)
2010-04-29 14:33 UTC, Tomas Bzatek
committed Details | Review

Description Ben 2010-04-01 07:39:17 UTC
How to reproduce this bug:
* Create new empty folder on desktop
* Click Properties > Emblems on this folder
* Add any emblem (for example "Draft")
* Move this folder to trash
* Click the trash icon on the bottom panel
Nautilus will hang and will not display trash contents
Comment 1 Ben 2010-04-01 07:45:57 UTC
Created attachment 157664 [details]
backtrace
Comment 2 Ben 2010-04-01 08:38:19 UTC
I forgot to add the downstream bug, https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/553082
Comment 3 Tomas Bzatek 2010-04-01 14:44:50 UTC
This is an endless loop in gdaemonfileenumerator.c/ g_daemon_file_enumerator_dbus_filter()

....
  • #3 g_daemon_file_enumerator_dbus_filter
    at gdaemonfileenumerator.c line 330
  • #4 vfs_connection_filter
    at gvfsdaemondbus.c line 182
  • #5 dbus_connection_dispatch
    at dbus-connection.c line 4451
  • #6 dbus_source_dispatch
    at gdbusutils.c line 810
  • #7 g_main_dispatch
    at gmain.c line 1960

Comment 4 Tomas Bzatek 2010-04-19 14:27:57 UTC
Created attachment 159083 [details] [review]
proposed patch

This patch will fix an endless loop by skipping invalid data. Still need to figure out who sends the garbage.
Comment 5 Alexander Larsson 2010-04-26 09:05:07 UTC
commited, but we need to figure out the real reason too
Comment 6 Tomas Bzatek 2010-04-29 14:33:39 UTC
Created attachment 159881 [details] [review]
Another patch fixing the real issue

Ufff, took me really long until I figured this problem. Thanks to Milan Crha for useful clues.
Comment 7 Tomas Bzatek 2010-04-29 14:42:30 UTC
Also a friendly warning - we may need to check for returned error in cases like this:

if (!_g_dbus_message_iter_get_args (&variant_iter, NULL,
                                    DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
                                    &strv, &n_elements,
                                    0))
        goto error;

(notice the NULL for DBusError)

As long as it's a centre of the universe (gvfs) it's important to be notified when we receive unexpected data on dbus. Ignoring the error and jumping out results in the particular file not being listed during enumeration at all. I only spotted this during debugging, the first chunk of the patch fixes the real issue, the second chunk is another fix.
Comment 8 Dmitry Shachnev 2010-06-13 12:22:00 UTC
Because this patch doesn't make nautilus showing files with emblems, we created a new bug #620259 for this issue.
https://bugzilla.gnome.org/show_bug.cgi?id=620259
Comment 9 Tomas Bzatek 2010-06-25 12:59:21 UTC
(In reply to comment #8)
> Because this patch doesn't make nautilus showing files with emblems, we created
> a new bug #620259 for this issue.
> https://bugzilla.gnome.org/show_bug.cgi?id=620259
Have you tried applying both patches? The first one has been already committed and the other is still needed too. Works fine for me for the scenario described in bug 620259.
Comment 10 Ben 2010-06-25 18:31:08 UTC
Could you post a link to this patch, I am not sure what patch you mean.
Comment 11 Tomas Bzatek 2010-06-28 09:24:09 UTC
(In reply to comment #10)
> Could you post a link to this patch, I am not sure what patch you mean.
Please scroll down a little bit and then you'd see the "Attachments" table. The first patch was committed to master as 3d5cae7afed2f93f0c3a61526c2f3bf6a7b73842 some time ago.
Comment 12 Dmitry Shachnev 2010-09-23 15:57:39 UTC
Why don't you apply the second patch?
Comment 13 Tomas Bzatek 2010-09-27 15:22:02 UTC
Committed the second patch to master.

commit a9c0df8ba0c6f3003517c49099b241229f5b755e
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:   Mon Sep 27 17:17:20 2010 +0200

    Fix stringv transfer over dbus
    
    The wrong iterator passed in caused some items to be silently dropped
    plus it led to string dup of wrong pointer.
    
    See bug 614544 for reference.