bugFreeciv - Bugs: bug #25246, usdlg memory leak

 
 
Show feedback again

bug #25246: usdlg memory leak

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Sun Oct 30 18:28:15 2016  
 
Category: client-gtk-3.22Severity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Sveinung Kvilhaugsvik <sveinung>Open/Closed: Closed
Release: S2_6 r34290Operating System: Any
Planned Release: 3.1.0, 3.0.0, 2.6.0, 2.5.7Contains string changes: No

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed May 10 08:19:54 2017, SVN revision 35487:

unitselect: don't initialize pix twice.

This fixes a memory leak. (Detectable with Valgrind.)

Reported by Marko Lindqvist

See gna bug #25246

(Browse SVN revision 35487)

Sveinung Kvilhaugsvik <sveinung>
Project MemberIn charge of this item.
Mon May 8 12:14:15 2017, comment #7:

> Does that indicate that also S2_5 is affected?


Yes. Gna patch #2715 went into S2_5.

(file #29965)

Sveinung Kvilhaugsvik <sveinung>
Project MemberIn charge of this item.
Sun May 7 21:03:14 2017, comment #6:

> pre "Gtk3-client drawing code uses cairo" initialization


Does that indicate that also S2_5 is affected?

Marko Lindqvist <cazfi>
Project Administrator
Thu May 4 10:23:06 2017, SVN revision 35384:

unitselect: don't create pix twice.

Delete the pre "Gtk3-client drawing code uses cairo" (gna patch #2715)
initialization of the variable pix in usdlg_tab_append_utype(). The original
patch had already deleted it from usdlg_tab_append_units(). No change is
therefore needed in usdlg_get_unit_image(), the current location of
usdlg_tab_append_units()'s unit drawing code.

This fixes a memory leak. (Detectable with Valgrind.)

Reported by Marko Lindqvist

See gna bug #25246

(Browse SVN revision 35384)

Sveinung Kvilhaugsvik <sveinung>
Project MemberIn charge of this item.
Thu May 4 10:22:37 2017, SVN revision 35383:

unitselect: don't create pix twice.

Delete the pre "Gtk3-client drawing code uses cairo" (gna patch #2715)
initialization of the variable pix in usdlg_tab_append_utype(). The original
patch had already deleted it from usdlg_tab_append_units(). No change is
therefore needed in usdlg_get_unit_image(), the current location of
usdlg_tab_append_units()'s unit drawing code.

This fixes a memory leak. (Detectable with Valgrind.)

Reported by Marko Lindqvist

See gna bug #25246

(Browse SVN revision 35383)

Sveinung Kvilhaugsvik <sveinung>
Project MemberIn charge of this item.
Thu May 4 10:22:10 2017, SVN revision 35382:

unitselect: don't create pix twice.

Delete the pre "Gtk3-client drawing code uses cairo" (gna patch #2715)
initialization of the variable pix in usdlg_tab_append_utype(). The original
patch had already deleted it from usdlg_tab_append_units(). No change is
therefore needed in usdlg_get_unit_image(), the current location of
usdlg_tab_append_units()'s unit drawing code.

This fixes a memory leak. (Detectable with Valgrind.)

Reported by Marko Lindqvist

See gna bug #25246

(Browse SVN revision 35382)

Sveinung Kvilhaugsvik <sveinung>
Project MemberIn charge of this item.
Sun Apr 30 09:38:40 2017, comment #2:

These came after rework for unitselunitdlg stuff, I think.

Marko Lindqvist <cazfi>
Project Administrator
Sun Oct 30 18:31:07 2016, comment #1:

usdlg_tab_append_utype() -> gdk_pixbuf_new() is part of also other loss records. For example:

==12941== 635,904 bytes in 23 blocks are indirectly lost in loss record 23,976 of 23,981
==12941== at 0x4C2ABAF: malloc (vg_replace_malloc.c:299)
==12941== by 0x813C0DC: gdk_pixbuf_new (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.3600.0)
==12941== by 0x22506A: usdlg_tab_append_utype (unitselect.c:693)
==12941== by 0x22506A: usdlg_tab_update (unitselect.c:634)
==12941== by 0x22538D: usdlg_refresh (unitselect.c:353)
==12941== by 0x1EFB11: update_unqueue (update_queue.c:319)
==12941== by 0x161479: idle_callback_wrapper (gui_main.c:2177)
==12941== by 0x898A689: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.1)
==12941== by 0x898AA3F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.1)
==12941== by 0x898AD61: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.1)
==12941== by 0x6BC1804: gtk_main (in /usr/lib/x86_64-linux-gnu/libgtk-3.so.0.2200.2)
==12941== by 0x16414E: ui_main (gui_main.c:1821)
==12941== by 0x18C4C3: client_main (client_main.c:679)

Marko Lindqvist <cazfi>
Project Administrator
Sun Oct 30 18:28:15 2016, original submission:

==12941== 1,664,160 (5,280 direct, 1,658,880 indirect) bytes in 60 blocks are definitely lost in loss record 23,981 of 23,981
==12941== at 0x4C2ABAF: malloc (vg_replace_malloc.c:299)
==12941== by 0x898FDE8: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.1)
==12941== by 0x89A8322: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.1)
==12941== by 0x89A894D: g_slice_alloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.1)
==12941== by 0x87202B3: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.1)
==12941== by 0x87021FA: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.1)
==12941== by 0x870410D: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.1)
==12941== by 0x87043B0: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.5000.1)
==12941== by 0x813E9AF: gdk_pixbuf_new_from_data (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.3600.0)
==12941== by 0x813C10D: gdk_pixbuf_new (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.3600.0)
==12941== by 0x22506A: usdlg_tab_append_utype (unitselect.c:693)
==12941== by 0x22506A: usdlg_tab_update (unitselect.c:634)
==12941== by 0x22538D: usdlg_refresh (unitselect.c:353)

Marko Lindqvist <cazfi>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sveinung (Updated the item)
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Error: not logged in

     

     

    Follow 17 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed May 10 08:20:30 2017sveinungStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Mon May 8 12:14:15 2017sveinungAttached File-=>Added 2.5-unitselect-don-t-initialize-pix-twice.patch, #29965
      StatusFixed=>Ready For Test
      Open/ClosedClosed=>Open
      Planned Release3.1.0, 3.0.0, 2.6.0=>3.1.0, 3.0.0, 2.6.0, 2.5.7
    Thu May 4 10:24:34 2017sveinungStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue May 2 18:01:40 2017sveinungAttached File-=>Added 2.6-and-3.0-unitselect-don-t-initialize-pix-twice.patch, #29956
    Tue May 2 17:57:05 2017sveinungAttached File#29955=>Removed
    Tue May 2 17:47:24 2017sveinungAttached File-=>Added 3.1-unitselect-don-t-initialize-pix-twice.patch, #29954
      Attached File-=>Added 2.6-and-3.0-unitselect-don-t-initialize-pix-twice.patch, #29955
      StatusNone=>Ready For Test
      Operating SystemNone=>Any
      Planned Release=>3.1.0, 3.0.0, 2.6.0
      Contains string changesNone=>No
    Sun Apr 30 09:38:40 2017cazfiAssigned toNone=>sveinung
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup