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 772434 - batch rename: possible major memory leak
batch rename: possible major memory leak
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
3.21.x
Other Linux
: Normal critical
: 3.22
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 771490 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-10-05 01:25 UTC by Mohammed Sadiq
Modified: 2016-10-11 18:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Valgrind log (run with 100 files) (100.79 KB, text/x-c)
2016-10-05 08:51 UTC, Mohammed Sadiq
  Details
batch-rename: Fix memory leaks (4.33 KB, patch)
2016-10-07 10:03 UTC, Alexandru Pandelea
committed Details | Review

Description Mohammed Sadiq 2016-10-05 01:25:16 UTC
Batch rename seems to have major memory leak that doesn't free the memory used.

How to reproduce:

1. Create several files:
   touch {0000..9999}
2. Select All -> Rename -> Find and Replace Text
3. replace '0' with '1'

Result:
The memory usage of nautilus rises, which isn't freed even after closing the batch rename dialog.

Note: This happens only when the Replacement Text creates a conflict.

As this could potentially freeze the system, marking the bug as critical.


Thanks
- Mohammed Sadiq
Comment 1 Carlos Soriano 2016-10-05 08:11:32 UTC
Can you run valgrind to find the leak?
Comment 2 Mohammed Sadiq 2016-10-05 08:51:12 UTC
Created attachment 336967 [details]
Valgrind log (run with 100 files)

(In reply to Carlos Soriano from comment #1)
> Can you run valgrind to find the leak?

Sure. Valgrind log attached.
Comment 3 Alexandru Pandelea 2016-10-07 10:03:54 UTC
Created attachment 337140 [details] [review]
batch-rename: Fix memory leaks

Fix memory leaks for batch renaming.
Comment 4 Carlos Soriano 2016-10-11 17:09:20 UTC
Review of attachment 337140 [details] [review]:

Thanks Alex for these improvements!

::: src/nautilus-batch-rename-utilities.c
@@ +965,3 @@
     }
 
+    selection_metadata = g_list_reverse (selection_metadata);

This is not a leak, so worth having in a different patch, but lets leave it here for now. Just keep it in mind to create new patch when is an unrelated change for the future :)
Comment 5 Carlos Soriano 2016-10-11 17:11:44 UTC
Pushed since I'm planning to do a release soon

Attachment 337140 [details] pushed as 045d04a - batch-rename: Fix memory leaks
Comment 6 Carlos Soriano 2016-10-11 18:22:01 UTC
*** Bug 771490 has been marked as a duplicate of this bug. ***