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 307138 - leaks in nautilus 2.11.x
leaks in nautilus 2.11.x
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
0.x.x [obsolete]
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-10 12:31 UTC by Kjartan Maraas
Modified: 2005-06-11 11:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
possible patch (916 bytes, patch)
2005-06-10 12:32 UTC, Kjartan Maraas
none Details | Review
updated patch (2.09 KB, patch)
2005-06-11 09:52 UTC, Kjartan Maraas
committed Details | Review

Description Kjartan Maraas 2005-06-10 12:31:04 UTC
==8732== 15 bytes in 1 blocks are definitely lost in loss record 5357 of 20645
==8732==    at 0x1B909222: malloc (vg_replace_malloc.c:130)
==8732==    by 0x1C4E8F55: g_malloc (gmem.c:137)
==8732==    by 0x1C4F974F: g_strconcat (gstrfuncs.c:229)
==8732==    by 0x1B948775: nautilus_file_operations_progress_new_file
(nautilus-file-operations-progress.c:575)
==8732==    by 0x1B948F63: progress_dialog_set_to_from_item_text
(nautilus-file-operations.c:376)
==8732==    by 0x1B94B447: handle_transfer_ok (nautilus-file-operations.c:441)
==8732==    by 0x1C13DD67: dispatch_sync_job_callback (gnome-vfs-job.c:283)
==8732==    by 0x1C4E4FFF: g_idle_dispatch (gmain.c:3812)
==8732==    by 0x1C4E2E5D: g_main_context_dispatch (gmain.c:1933)
==8732==    by 0x1C4E5C2D: g_main_context_iterate (gmain.c:2564)
==8732==    by 0x1C4E612E: g_main_loop_run (gmain.c:2768)
==8732==    by 0x1BDD0464: gtk_main (gtkmain.c:974)
==8732==    by 0x8070E89: main (nautilus-main.c:434)
Comment 1 Kjartan Maraas 2005-06-10 12:32:13 UTC
Created attachment 47537 [details] [review]
possible patch

This looks like it should fix it. I added a call to free the item_markup also
even though that's not in the valgrind backtrace.
Comment 2 Kjartan Maraas 2005-06-11 09:52:09 UTC
Created attachment 47595 [details] [review]
updated patch

Found some more
Comment 3 Kjartan Maraas 2005-06-11 10:06:56 UTC
Another leak:

I see this trace from running nautilus under valgrind:

==8405== 5 bytes in 1 blocks are definitely lost in loss record 180 of 5529
==8405==    at 0x1B909222: malloc (vg_replace_malloc.c:130)
==8405==    by 0x1C4E8F55: g_malloc (gmem.c:137)
==8405==    by 0x1C4F95D6: g_strndup (gstrfuncs.c:125)
==8405==    by 0x1C4F9F38: g_ascii_strdown (gstrfuncs.c:1513)
==8405==    by 0x1C14D96E: get_method_string (gnome-vfs-uri.c:423)
==8405==    by 0x1C14DBE5: gnome_vfs_uri_new_private (gnome-vfs-uri.c:554)
==8405==    by 0x1C14DE3A: gnome_vfs_uri_new (gnome-vfs-uri.c:531)
==8405==    by 0x8081068: nautilus_window_initialize_menus
(nautilus-window-menus.c:232)

It seems the method_string from gnome_vfs_uri_new_private() is not free'd
somewhere along the way:

        /* The toplevel URI element is special, as it also contains host/user
           information.  */
        uri->method = method;
        uri->ref_count = 1;
        uri->method_string = method_string;
        uri->text = NULL;
        uri->fragment_id = NULL;

The only place I see this being freed is in destroy_element() which is called
from gnome_vfs_uri_unref(), so we seem to be missing a gnome_vfs_uri_unref()
call somewhere? maybe in nautilus_window_finalize()? It's allocated here:

static gboolean
have_burn_uri (void)
{
        static gboolean initialized = FALSE;
        static gboolean res;
        GnomeVFSURI *uri;

        if (!initialized) {
                uri = gnome_vfs_uri_new ("burn:///");
                res = uri != NULL;
                if (uri != NULL) {
                        gnome_vfs_uri_unref (uri);
                }
                initialized = TRUE;
        }
        return res;
}
Comment 4 Kjartan Maraas 2005-06-11 10:09:57 UTC
The above code correctly unrefs the uri though. Don't know what's happening here...
Comment 5 Martin Wehner 2005-06-11 10:23:51 UTC
Comment on attachment 47595 [details] [review]
updated patch

Looks fine, please commit on both branches.
Comment 6 Martin Wehner 2005-06-11 10:28:09 UTC
I glanced over the method_string/uri stuff and couldn't spot the leak either.
Comment 7 Kjartan Maraas 2005-06-11 11:18:47 UTC
Commited to HEAD and the relevant bits to stable (the emblem stuff)