Every time I copy, move or delete lots of files Thunar segfaults at the end of the operation.
This is easily reproducible (just did it twice in a row, moving files back and forth):
cd -- "$(mktemp --directory)"
mkdir foo
Create lots of files, for example with touch {0..299}
Open the directory in Thunar
Mark all the files (not the directory)
Press Ctrl-x
Navigate to the "foo" directory
Press Ctrl-v
Actual behaviour: Copies all the files and then crashes.
Expected behaviour: Shouldn't crash :)
Backtrace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f54821896d6 in ?? () from /usr/lib/libgtk-x11-2.0.so.0[Current thread is 1 (Thread 0x7f548356d980 (LWP 871))](gdb) bt#0 0x00007f54821896d6 in () at /usr/lib/libgtk-x11-2.0.so.0#1 0x00007f5481c6ae1f in () at /usr/lib/libgdk-x11-2.0.so.0#2 0x00007f5481c6c180 in () at /usr/lib/libgdk-x11-2.0.so.0#3 0x00007f5481c6dc8a in () at /usr/lib/libgdk-x11-2.0.so.0#4 0x00007f5481c6dd2f in () at /usr/lib/libgdk-x11-2.0.so.0#5 0x00007f54800f3e38 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0#6 0x00007f54800f4081 in () at /usr/lib/libglib-2.0.so.0#7 0x00007f54800f43b2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0#8 0x00007f5481ff3df3 in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0#9 0x000055f9a94eaf60 in ()#10 0x00007f547faf4f4a in __libc_start_main () at /usr/lib/libc.so.6#11 0x000055f9a94eb0ba in ()
Version: 1.6.14
Designs
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
Unfortunately I can't reproduce here with Thunar from master and 1.6.14, I have used touch {0..1000} and all three view modes (Icons, Detailed and Compact).
I know you opened the bug against 1.6.14, but could please confirm you're using this version? A couple of previous versions were crashing on simple file operations. Besides that, which distro are you running?
I did reproduce it from the command line to see if there were any useful messages. This is the entire output (the warning pops up every time I change directory during normal use):
$ thunar -q; thunar
(thunar:5815): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
Segmentation fault (core dumped)
I never used Thunar as a daemon.
No plugins are installed:
$ pacman --query | grep thunar
thunar 1.6.14-1
The crash is reproducible on tmpfs and encrypted EXT4 LVM:
$ mount | grep /home
/dev/mapper/vg-home on /home type ext4 (rw,relatime,data=ordered)
I'm able to reproduce with the commands I specified on both my laptop and desktop machine (including stopping any running Thunar instances beforehand). It might be relevant that even moving files is incredibly slow in Thunar. Moving the 300 files in the test takes about 3-4 seconds within the same tmpfs on both machines, which is kind of ludicrous.
Thanks for the info !
Possibly the disk encryption makes a difference .. have to test that.
On a unencrypted ssd the movement of 300 files is something like 1-2 sec. for me ... did not compare with other file managers so far.
I was finally able to reproduce the bug after many attempts. However, I found an easier way to force the crash: keep switching between the target folder and its parent, Thunar will certainly crash.
These are the warnings messages it normally emits before crashing (not in this order):
(thunar:4043): GLib-GObject-WARNING **: invalid cast from 'GtkCssImageBuiltin' to 'ThunarFolder'
(thunar:4244): GLib-GObject-WARNING **: invalid cast from 'GtkCssTransition' to 'ThunarFolder'
(thunar:4170): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'ThunarFolder'
(thunar:4170): thunar-WARNING **: Content type loading failed for 370: Error when getting information for file “/tmp/tmp.KJj2GZa3j3/foo/370”: No such file or directory
And this is the backtrace (sometimes it segfaults at line 424):
#0 0x000055555559f2a9 in thunar_folder_content_type_loader_idle (data=<optimized out>) at thunar-folder.c:429#1 0x00007ffff4c80ca6 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0#2 0x00007ffff4c81081 in () at /usr/lib/libglib-2.0.so.0#3 0x00007ffff4c8110e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0#4 0x00007ffff524696e in g_application_run () at /usr/lib/libgio-2.0.so.0#5 0x000055555557ac8d in main (argc=2, argv=0x7fffffffe008) at main.c:165
My suspicion is that we're facing a race condition, where multiple threads are moving files, meanwhile Thunar is trying to update its view and then it uses an invalid reference to a folder.
I have prepared a patch that prevents crashes, but it acts on the problem effects, not on the cause, so CRITICAL messages are emitted. I just ask that you (Victor), if possible, could test it so we are sure to be on the right track.
Did not get any more info out of the coredump, anyhow thanks for sending it !
Offtopic, for next time: If you gzip the coredump it will shrink down to 3,8 MB
Build instructions for reproducibility and other testers:
The repo doesn't have build instructions. I found a build command in the thunar-git AUR package: ./autogen.sh --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --disable-static --enable-gio-unix --enable-dbus --enable-startup-notification --enable-gudev --enable-exif --enable-pcre --enable-gtk-doc --disable-debug
libxfce4ui-2 needs to be at least version 4.13.2 to build master.
There is no 1.6.15 tag on master. Found "thunar-1.6.15" it on the xfce-4.12 branch.
@Victor, sorry for the delay, I haven't had the time to check this again, for now the stopgap will do.
Let's keep this bug open until a proper fix is released.
And thanks for reporting and testing!
@alexxcons something similar happened to me today (crash when copying/pasting 150 files), I don't know if it is the same problem since it isn't reproducible if I use gdb. I'll investigate it further.
FYI last evening I got four segfaults with thunar master while copy files between external drives (ext4 and ntfs):
#0 0x0000563000ad9954 in thunar_view_reload (view=0x5630017315e0, reload_info=0) at thunar-view.c:267#1 0x00007f75dc197d8f in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0#2 0x00007f75dc1b3588 in () at /usr/lib/libgobject-2.0.so.0#3 0x00007f75dc1b4c49 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0#4 0x00007f75dc1b51a0 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0#5 0x0000563000a7aa2c in thunar_clipboard_manager_targets_received (clipboard=<optimized out>, selection_data=0x7fffd1153550, user_data=<optimized out>) at thunar-clipboard-manager.c:400
Any chance some commit from master sneaked into 4.16.9 causing the segfault seen by @andreldm? I've seen a couple of crashes after upgrading to 4.16.9 and have also received a downstream report about the thunar_view_reload segfault. For me it happened when copying a few tens of ~400MB files to a USB drive, but I have been unable to repro intentionally since then (~4 days ago).
(Edit: Bit weird that we're commenting on a 3 year old bug, but whatever works. :D)