! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Crash when renaming a file that has been moved to another instance of Thunar.
Status:
RESOLVED: FIXED

Comments

Description Profpatsch 2014-04-10 15:26:50 CEST
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
Comment 1 Nikita Zlobin 2020-02-10 11:00:47 CET
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.
Comment 2 Theo Linkspfeifer editbugs 2020-02-10 15:01:25 CET
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
Comment 3 alexxcons editbugs 2020-02-10 16:07:11 CET
> 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 !
Comment 4 Nikita Zlobin 2020-02-10 16:50:09 CET
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.
Comment 5 Theo Linkspfeifer editbugs 2020-02-15 17:47:58 CET
Created attachment 9460 
patch

Attaching a patch which implements the suggestion from comment #2.
Comment 6 alexxcons editbugs 2020-02-15 18:43:49 CET
(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"
Comment 7 Theo Linkspfeifer editbugs 2020-02-15 19:08:28 CET
My test case was:

1. Rename some file (keep dialog open)
2. Delete or move file via terminal command
Comment 8 alexxcons editbugs 2020-02-15 19:26:47 CET
Interesting, so without patch thunar crashes for you when the rename is confirmed? (Because for me just the mentioned dialog is shown)
Comment 9 Theo Linkspfeifer editbugs 2020-02-15 19:39:41 CET
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
Comment 10 Theo Linkspfeifer editbugs 2020-02-15 19:44:16 CET
And yes, with the patch applied the dialog is closed automatically and no critical warning is shown in the terminal output.
Comment 11 Git Bot editbugs 2020-02-15 21:26:13 CET
Theo Linkspfeifer referenced this bugreport in commit db1e2f708df6d1b7438f4b72c8ab911865a3dfc6

Prevent crash when renaming file (Bug #10805)

https://git.xfce.org/xfce/thunar/commit?id=db1e2f708df6d1b7438f4b72c8ab911865a3dfc6
Comment 12 Git Bot editbugs 2020-02-15 21:27:54 CET
Theo Linkspfeifer referenced this bugreport in commit b0dac2a485fe1a5356560725b1dcea5004da7012

Prevent crash when renaming file (Bug #10805)

https://git.xfce.org/xfce/thunar/commit?id=b0dac2a485fe1a5356560725b1dcea5004da7012
Comment 13 alexxcons editbugs 2020-02-15 21:35:14 CET
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 :)
Comment 14 alexxcons editbugs 2020-02-15 21:36:17 CET
.. pushed to master and 4.14 branch, will be released in 1.8.13
Comment 15 Theo Linkspfeifer editbugs 2020-03-22 18:26:34 CET
Created attachment 9629 
follow-up patch
Comment 16 Git Bot editbugs 2020-03-23 10:39:55 CET
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
Comment 17 Git Bot editbugs 2020-03-23 10:44:57 CET
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
Comment 18 alexxcons editbugs 2020-03-23 10:45:32 CET
ok, tested and pushed, thanks theo !

Bug #10805

Reported by:
Profpatsch
Reported on: 2014-04-10
Last modified on: 2020-03-23

People

Assignee:
Jannis Pohlmann
CC List:
4 users

Version

Attachments

patch (1.25 KB, patch)
2020-02-15 17:47 CET , Theo Linkspfeifer
no flags
follow-up patch (867 bytes, patch)
2020-03-22 18:26 CET , Theo Linkspfeifer
no flags

Additional information