Steps to reproduce: 1. Open two instances of Thunar. 2. Move a file from one window to the other, then quickly hit F2 in the window from which the file came. 3. Wait until the file is moved. 4. Type in a new name and click enter. 5. The program crashes because there is no reference to the object that should be renamed anymore. Error message: (thunar:28793): GLib-GObject-CRITICAL **: g_value_type_compatible: assertion 'G_TYPE_IS_VALUE (src_type)' failed (thunar:28793): thunar-ERROR **: thunar-simple-job.c:198: invalid object type ' [1] 28793 trace trap (core dumped) thunar
Version 1.8.11, it happens with just one window, which I got by "exo-open" from terminal, to get in place. It's in gentoo, but no distro-specific patches.
The Properties dialog closes itself if the file is moved, so the Rename dialog should probably do the same. https://git.xfce.org/xfce/thunar/tree/thunar/thunar-properties-dialog.c#n1441
> https://git.xfce.org/xfce/thunar/tree/thunar/thunar-properties-dialog.c#n1441 Not sure if the GFile, or as well the ThunarFile is not valid any more .. checked. At least it should be checked that the GFile to be renamed stil is valid when the new name is going to be applied. Patches would be very welcome !
Forgot to mention. What I described, happens only occasionally. Meanwhile, there is another bug, which looks to me related. When I did download with ytdl, it caused quick appearance/disappearance of temporary files, and during this process there where dozens of warnings like "unable to get file properties, no such file or directory". Of course I'm not dev, but it feels like could have similar core.
Created attachment 9460 patch Attaching a patch which implements the suggestion from comment #2.
(In reply to Theo Linkspfeifer from comment #5) > Created attachment 9460 > patch > > Attaching a patch which implements the suggestion from comment #2. Thanks alot for the patch Theo ! Did you suceed on reproducing the bug, and checked that the patch actually fixes it ? I just tried so with the steps provided in the bug description, though it seems to be not that easy. - If I move the file inside the same filesystem, it is done in a splitseconds .. rename-gui will be opened on the wrong item for me, since the original item already is gone. - If I move the file to a remote via CTRL+X + CTRL+V, so that a copy needs to be done, I get no crash, but a nice dialog "The file <Filename >could not be renamed. Error while renaming file <path> Unknown File or Folder"
My test case was: 1. Rename some file (keep dialog open) 2. Delete or move file via terminal command
Interesting, so without patch thunar crashes for you when the rename is confirmed? (Because for me just the mentioned dialog is shown)
Thunar 1.8.11 (packaged by distribution) crashes: (thunar:1176): thunar-ERROR **: 19:30:38.788: thunar-simple-job.c:198: invalid object type 'GtkCssWidgetNode' for value type 'ThunarFile' Trace/breakpoint trap Thunar compiled from git master does not crash: (thunar:1346): thunar-CRITICAL **: 19:32:19.418: thunar_io_jobs_rename_file: assertion '(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((file)); GType __t = ((thunar_file_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))' failed
And yes, with the patch applied the dialog is closed automatically and no critical warning is shown in the terminal output.
Theo Linkspfeifer referenced this bugreport in commit db1e2f708df6d1b7438f4b72c8ab911865a3dfc6 Prevent crash when renaming file (Bug #10805) https://git.xfce.org/xfce/thunar/commit?id=db1e2f708df6d1b7438f4b72c8ab911865a3dfc6
Theo Linkspfeifer referenced this bugreport in commit b0dac2a485fe1a5356560725b1dcea5004da7012 Prevent crash when renaming file (Bug #10805) https://git.xfce.org/xfce/thunar/commit?id=b0dac2a485fe1a5356560725b1dcea5004da7012
For some wired reason I dont even get the "thunar-CRITICAL" message when using thunar-master. So I guess some detail is still different for me. Whatever it is, your patch looks good to me and works well. So I just pushed it now. Thanks alot for your contribution and your patience :)
.. pushed to master and 4.14 branch, will be released in 1.8.13
Created attachment 9629 follow-up patch
Theo Linkspfeifer referenced this bugreport in commit 50501bf48730d140b697efd96bdc6ab64a9984f2 Unregister handler when Rename dialog is closed manually (followup of Bug #10805) https://git.xfce.org/xfce/thunar/commit?id=50501bf48730d140b697efd96bdc6ab64a9984f2
Theo Linkspfeifer referenced this bugreport in commit 6850f6fecc1da3230d69617d4293100ba8acd099 Unregister handler when Rename dialog is closed manually (followup of Bug #10805) https://git.xfce.org/xfce/thunar/commit?id=6850f6fecc1da3230d69617d4293100ba8acd099
ok, tested and pushed, thanks theo !