GNOME Bugzilla – Bug 631201
PATCH: Several memory leaks, valgrind errors
Last modified: 2010-10-29 16:27:55 UTC
I have tracked a number of leaks and unitialized data references when playing with valgrind (among others). Attached is a format-patch against the lucab/btrfs branch that you could merge to fix most of them.
Created attachment 171605 [details] [review] format-patch git format-patch -7 commit fad3951f025edbd7cb9716882e5798d79bfe4b08 Author: Seth Heeren <sgheeren@hotmail.com> Date: Sun Oct 3 02:53:05 2010 +0200 erase_filesystem_signatures writes uninitialized data tagged FIXME commit 8e2796848e435705b7a6928716483005bbcde9f5 Author: Seth Heeren <sgheeren@hotmail.com> Date: Sun Oct 3 02:52:06 2010 +0200 leaked FS structures for unsupported partition types FILESYSTEMS vector copies anyway commit 729e78d810bc5fac8d2a2144d9fe415161577a9d Author: Seth Heeren <sgheeren@hotmail.com> Date: Sun Oct 3 02:50:54 2010 +0200 leaked regular expression (regfree not called) commit 36a08e6af6a6ae0a59c2ac4fd4e2cf4bb9c534fd Author: Seth Heeren <sgheeren@hotmail.com> Date: Sun Oct 3 02:50:24 2010 +0200 Unitialized value in OperationDetail::OperationDetail commit 09196287309d541058febbfc0277dea17637bbb7 Author: Seth Heeren <sgheeren@hotmail.com> Date: Sun Oct 3 02:49:05 2010 +0200 ped_partition_get_path result not freed commit b8916c3ef3f6d126dfd1caa101487e1921ea517b Author: Seth Heeren <sgheeren@hotmail.com> Date: Sun Oct 3 02:44:41 2010 +0200 leaked FS structures for new partition dialog FILESYSTEMS vector copies anyway commit 69d900049e2b2e9e631e13b2e971a110907518bc Author: Seth Heeren <sgheeren@hotmail.com> Date: Sun Oct 3 02:41:11 2010 +0200 leaked Gtk::HBox
Thank you Seth for your interest in GParted and especially for finding and proposing fixes for these problems. Since Luca Bruno created the lucab/btrfs branch, I will seek to coordinate these patches with Luca. We plan to include btrfs support in the GParted 0.7.0 release, so these patches are very timely. :-) Development Plans for the Next Release of GParted (0.7.0) http://gparted-forum.surf4.info/viewtopic.php?id=14331 Regards, Curtis Gedak
My prelimary testing of these patches encountered no problems. These patches have been committed to the Gnome git repository master for inclusion in the next release of GParted (0.7.0). Seth, I am curious as to how you found these memory leaks. You mentioned valgrind which I looked up and learned is a debugging and profiling tool. Do you have some advice on how I should start learning to locate memory leaks? I have been using the eclipse CDT for a few years now in case that is relevant. Your suggestions are appreciated.
I've sent a rather large mail on using Valgrind, notably from Eclipse 3.6, to your private gmail afdress Seth
A big thanks go to Seth for providing patches for these problems. The enhancements to address this bug report have been included in GParted 0.7.0 which was released on October 29, 2010. Closing this bug report.