Batch-renaming to the reverse order causes freeze and high memory and cpu consumption
Affected version
- Nightly flatpak: Yes, GNOME nautilus 3.37.1
- Other: Fedora 31 / GNOME nautilus 3.34.2
Steps to reproduce
Warning: This will close all your nautilus windows first and eat up all your RAM later (rather slowly on my machine but anyways) - be ready to watch your RAM usage and kill nautilus.
- Run the attached script or create a new directory containing files
test1
andtest2
by hand. - Select those (Ctrl + A) and open rename dialog (F2)
- Enter name "test" and add automatic numbering [1,2,3] from the "+Add" button. Select "Original Name (Descending)" for ordering.
Current behavior
Nautilus freezes and starts eating your memory using 100% CPU on one thread. If you're lucky, oom killer might be there to save the day after a while. Files are not renamed.
Expected behavior
Either prevent renaming in this case and let the user handle this using two rename steps or - in best case - make the rename work as intended. This is actually a useful feature if you happen to have your files ordered the wrong way round.
Additional information
Nautilus notices and prevents a renaming conflict if the existing conflicting file is not part of the batch rename (i.e. you want to batch-rename files a and b to test1 and test2 but any of these is already there.)