Segfault when closing Thunar if search results are visible
As of 909efefe, Thunar crashes when you try to quit the app during a search.
Steps to reproduce
- Start Thunar
- Initiate a search with Ctrl+F
- It doesn't matter what you enter. The search string can be blank.
- Quit Thunar by pressing Ctrl+Q or by clicking the close button.
- This causes Thunar to segfault
💥
- This causes Thunar to segfault
Backtrace
Debian debug environment specifics (click to expand)
I like full backtraces, so for this report I installed all the debug packages from Debian Testing for its Thunar using
sudo apt install debian-goodies # for find-dbgsym-packages
sudo apt install --mark-auto $(find-dbgsym-packages /usr/bin/thunar)
Don't forget the debug symbol repos: https://wiki.debian.org/SourcesList#Debug_Symbol_Packages
My gdbinit consists of
$ cat ~/.gdbinit
set python print-stack full
but I think it needn't for this.
With a build configured with --enable-debug
, from within the source tree,
GDB run (click to expand)
$ gdb -ex run --args thunar/.libs/thunar .
GNU gdb (Debian 10.1-2+b1) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from thunar/.libs/thunar...
Starting program: /home/andrewc/Development/Thunar/thunar-git/thunar/.libs/thunar .
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff59f5640 (LWP 836827)]
[New Thread 0x7ffff51f4640 (LWP 836828)]
[New Thread 0x7fffeffff640 (LWP 836829)]
[New Thread 0x7fffef7fe640 (LWP 836830)]
[New Thread 0x7fffeeffd640 (LWP 836831)]
[Thread 0x7fffeeffd640 (LWP 836831) exited]
[New Thread 0x7fffeeffd640 (LWP 836832)]
[New Thread 0x7fffee7fc640 (LWP 836833)]
[Thread 0x7fffeeffd640 (LWP 836832) exited]
[New Thread 0x7fffeeffd640 (LWP 836834)]
[New Thread 0x7fffedffb640 (LWP 836835)]
[Thread 0x7fffee7fc640 (LWP 836833) exited]
[Thread 0x7fffeeffd640 (LWP 836834) exited]
[Thread 0x7fffedffb640 (LWP 836835) exited]
[New Thread 0x7fffedffb640 (LWP 836840)]
[New Thread 0x7fffeeffd640 (LWP 836841)]
[Thread 0x7fffedffb640 (LWP 836840) exited]
[Thread 0x7fffeeffd640 (LWP 836841) exited]
[New Thread 0x7fffeeffd640 (LWP 836851)]
[New Thread 0x7fffedffb640 (LWP 836854)]
[Thread 0x7fffeeffd640 (LWP 836851) exited]
[Thread 0x7fffedffb640 (LWP 836854) exited]
[Thread 0x7fffef7fe640 (LWP 836830) exited]
(thunar:836822): GLib-GObject-WARNING **: 19:16:12.602: invalid unclassed pointer in cast to 'ThunarStandardView'
(thunar:836822): GLib-GObject-WARNING **: 19:16:12.602: invalid unclassed pointer in cast to 'ThunarStandardView'
Thread 1 "thunar" received signal SIGSEGV, Segmentation fault.
0x0000555555610e66 in thunar_window_replace_view (window=window@entry=0x55555588b260,
view=0x555555c92090,
view_type=view_type@entry=0x555555ae3ed0 [ThunarDetailsView/ThunarStandardView/GtkScrolledWindow/GtkBin/GtkContainer/GtkWidget/GInitiallyUnowned]) at thunar-window.c:3685
3685 if (view != NULL && G_TYPE_FROM_INSTANCE (view) == view_type)
(gdb) bt full
#0 0x0000555555610e66 in thunar_window_replace_view
(window=window@entry=0x55555588b260, view=0x555555c92090, view_type=view_type@entry=0x555555ae3ed0 [ThunarDetailsView/ThunarStandardView/GtkScrolledWindow/GtkBin/GtkContainer/GtkWidget/GInitiallyUnowned])
at thunar-window.c:3685
file = 0x0
current_directory = 0x0
new_view = <optimized out>
history = 0x0
job = 0x0
selected_thunar_files = 0x0
page_num = <optimized out>
is_current_view = <optimized out>
__func__ = "thunar_window_replace_view"
#1 0x00005555556113a4 in thunar_window_action_view_changed
(view_type=0x555555ae3ed0 [ThunarDetailsView/ThunarStandardView/GtkScrolledWindow/GtkBin/GtkContainer/GtkWidget/GInitiallyUnowned], window=0x55555588b260) at thunar-window.c:3796
window = 0x55555588b260
#2 thunar_window_reset_view_type_idle (window_ptr=0x55555588b260) at thunar-window.c:3124
window = 0x55555588b260
#3 0x00007ffff706ce94 in g_main_dispatch (context=0x55555569ae50) at ../../../glib/gmain.c:3417
dispatch = 0x7ffff7069220 <g_idle_dispatch>
prev_source = 0x0
begin_time_nsec = 0
was_in_call = 0
user_data = 0x55555588b260
callback = 0x555555611320 <thunar_window_reset_view_type_idle>
cb_funcs = <optimized out>
cb_data = <optimized out>
need_destroy = <optimized out>
source = 0x555555f06240
current = 0x5555556a4050
i = 0
__func__ = "g_main_dispatch"
#4 g_main_context_dispatch (context=0x55555569ae50) at ../../../glib/gmain.c:4135
#5 0x00007ffff706d238 in g_main_context_iterate
(context=context@entry=0x55555569ae50, block=block@entry=0, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4211
max_priority = 200
timeout = 0
some_ready = 1
nfds = <optimized out>
allocated_nfds = <optimized out>
fds = 0x5555558a4070
#6 0x00007ffff706d2ef in g_main_context_iteration
(context=context@entry=0x55555569ae50, may_block=may_block@entry=0) at ../../../glib/gmain.c:4276
retval = <optimized out>
#7 0x00007ffff72968e8 in g_application_run
(application=0x5555556b20f0 [ThunarApplication], argc=argc@entry=2, argv=argv@entry=0x7fffffffe098)
at ../../../gio/gapplication.c:2600
arguments = 0x5555556b4290
status = 0
context = 0x55555569ae50
acquired_context = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
__func__ = "g_application_run"
#8 0x000055555557ed05 in main (argc=2, argv=0x7fffffffe098) at main.c:86
application = 0x5555556b20f0 [ThunarApplication]
error = 0x0
(gdb) c
Continuing.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
(gdb) [Thread 0x7fffeffff640 (LWP 836829) exited]
[Thread 0x7ffff51f4640 (LWP 836828) exited]
[Thread 0x7ffff59f6a80 (LWP 836822) exited]
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
The program is not being run.
(gdb) q
Apologies for the detail I hope I'm doing this right...
Edited by Andrew Chadwick