Bug 130673 - Leaks and other problems in desktop-file-utils
Leaks and other problems in desktop-file-utils
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gnome-vfs2 (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Blandford
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-23 12:57 EDT by Kjartan Maraas
Modified: 2013-04-02 00:19 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-25 18:27:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to clean up some issues (1.95 KB, patch)
2004-08-23 12:58 EDT, Kjartan Maraas
no flags Details | Diff
updated patch (1.95 KB, patch)
2004-08-23 13:02 EDT, Kjartan Maraas
no flags Details | Diff
updated updated patch (1.87 KB, patch)
2004-08-23 13:05 EDT, Kjartan Maraas
no flags Details | Diff
I think this is the patch for the other leak you point out (493 bytes, patch)
2004-08-25 18:24 EDT, Mark McLoughlin
no flags Details | Diff

  None (edit)
Description Kjartan Maraas 2004-08-23 12:57:53 EDT
Description of problem:

Valgrind reports a bunch of leaks and other problems in the menu
method. I've tried to patch some of them in the attached patch.

Please review and give feedback on the patch, since I have no idea
what the code is really doing :-)

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Kjartan Maraas 2004-08-23 12:58:52 EDT
Created attachment 102988 [details]
patch to clean up some issues
Comment 2 Kjartan Maraas 2004-08-23 13:02:30 EDT
Comment on attachment 102988 [details]
patch to clean up some issues

Found some spurious changes attaching a new one.
Comment 3 Kjartan Maraas 2004-08-23 13:02:59 EDT
Created attachment 102990 [details]
updated patch
Comment 4 Kjartan Maraas 2004-08-23 13:04:13 EDT
Damn. Some days I shouldn't be let near a computer. Attaching the
right patch now.
Comment 5 Kjartan Maraas 2004-08-23 13:05:04 EDT
Created attachment 102991 [details]
updated updated patch
Comment 6 Kjartan Maraas 2004-08-24 17:15:34 EDT
After applying this patch and running valgrind on the panel I still
see this leak:

==19085== 5549 bytes in 942 blocks are definitely lost in loss record
167 of 189
==19085==    at 0x1B902A9C: malloc (vg_replace_malloc.c:131)
==19085==    by 0xBA6922: g_malloc (in /usr/lib/libglib-2.0.so.0.400.6)
==19085==    by 0xBB52A5: g_strdup (in /usr/lib/libglib-2.0.so.0.400.6)
==19085==    by 0x1C17DB12: ??? (menu-process.c:1354)
==19085==    by 0x1C1720C6: ??? (menu-method.c:923)
==19085==    by 0x1C172F06: ??? (menu-method.c:1149)
==19085==    by 0x2C6A761: gnome_vfs_get_file_info_uri_cancellable (in
/usr/lib/libgnomevfs-2.so.0.791.0)
==19085==    by 0x2C853C0: gnome_vfs_get_file_info_uri (in
/usr/lib/libgnomevfs-2.so.0.791.0)
==19085==    by 0x2C85415: gnome_vfs_get_file_info (in
/usr/lib/libgnomevfs-2.so.0.791.0)
==19085==    by 0x8081669: fr_read_dir (menu-fentry.c:434)
==19085==    by 0x808193D: ??? (menu-fentry.c:304)
==19085==    by 0x80816AD: fr_read_dir (menu-fentry.c:472)
==19085==    by 0x808193D: ??? (menu-fentry.c:304)
==19085==    by 0x80816AD: fr_read_dir (menu-fentry.c:472)
==19085==    by 0x807A211: init_menus (menu.c:142)
==19085==    by 0x8062FA5: main (main.c:81)
==19085==

which is in this code:

  if (entry != NULL)
    {
      g_assert (iter != NULL);
                                                                     
                                                       
      if (real_fs_absolute_path_p)
        *real_fs_absolute_path_p = g_strdup (entry_get_absolute_path
(entry));
      if (entry_relative_name_p)
        *entry_relative_name_p = g_strdup (entry_get_relative_path
(entry));
    }

at the end of this function:

static PathResolution
tree_node_find_subdir_or_entry (TreeNode   *node,
                                const char *name,
                                TreeNode  **subdir_p,
                                char      **real_fs_absolute_path_p,
                                char      **entry_relative_name_p)

I don't see the two vars being used anywhere after g_strdup()ing stuff
into them so I wonder if the allocation is bogus?
Comment 7 Mark McLoughlin 2004-08-25 18:24:15 EDT
Created attachment 103103 [details]
I think this is the patch for the other leak you point out
Comment 8 Mark McLoughlin 2004-08-25 18:27:06 EDT
Thanks, I've committed the entry_set_unref()s upstream:

2004-08-25  Mark McLoughlin  <mark@skynet.ie>

        * src/menu-process.c: (resolve_legacy_dir),
        (tree_node_from_menu_node): don't leak the entry
        sets. Patch from Kjartan Maraas in rh bug #130673

        * src/menu-method.c: (menu_method_get_info):
        free the resolved path. Another leak from rh bug #130673

and also a patch which i think should fix the other leak reported.

I've only committed this stuff upstream because we have a bazillion
patches in gnome-vfs2 for desktop-file-utils right now and we're in
the process of cleaning that up. When we do, we'll pull in the leak
fixes from upstream.

Tiny tip Kjartan - diff -p makes it much easier to read patches :-)

Note You need to log in before you can comment on or make changes to this bug.