Segfault at startup when none of the stored tabs points to a valid directory
Similar to #147 (closed) :
With gcmd, after going to a directory on USB connected external device, then closing gcmd, then pluging such external device out, then re-launching gnome-commander makes gcmd segfault.
Reproducer:
- First
$ cd ~
- create some directory
$ mkdir foo
- Launch gnome-commander
- On gcmd, go to
foo
- Close gnome-commander
- Do
$ rmdir foo
- Again launch gnome-commander
Then gcmd causes segfault:
** (gnome-commander:574916): WARNING **: 23:24:12.082: Stored path /home/tasaka1/foo is invalid. Skipping
../src/gnome-cmd-file-selector.h:72:61: runtime error: member access within null pointer of type 'struct GnomeCmdFileList'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==574916==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000060 (pc 0x562e9c2abddd bp 0x7ffce8ce61f0 sp 0x7ffce8ce61c0 T0)
==574916==The signal is caused by a READ memory access.
==574916==Hint: address points to the zero page.
#0 0x562e9c2abddd in GnomeCmdMainWin::update_cmdline() ../src/gnome-cmd-main-win.cc:1103
#1 0x7fa4bb2da649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#2 0x7fa4bb30a5f2 in signal_emit_unlocked_R.isra.0 ../gobject/gsignal.c:3888
#3 0x7fa4bb2fb103 in signal_emit_valist_unlocked ../gobject/gsignal.c:3520
#4 0x7fa4bb2fb360 in g_signal_emit_valist ../gobject/gsignal.c:3263
#5 0x7fa4bb2fb422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#6 0x7fa4bb2d8f5d in g_cclosure_marshal_VOID__POINTERv ../gobject/gmarshal.c:1800
#7 0x7fa4bb2fb253 in _g_closure_invoke_va ../gobject/gclosure.c:897
#8 0x7fa4bb2fb253 in signal_emit_valist_unlocked ../gobject/gsignal.c:3424
#9 0x7fa4bb2fb360 in g_signal_emit_valist ../gobject/gsignal.c:3263
#10 0x7fa4bb2fb422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#11 0x562e9c238e42 in on_dir_list_ok ../src/gnome-cmd-file-list.cc:1732
#12 0x7fa4bb2da649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#13 0x7fa4bb30a5f2 in signal_emit_unlocked_R.isra.0 ../gobject/gsignal.c:3888
#14 0x7fa4bb2fb103 in signal_emit_valist_unlocked ../gobject/gsignal.c:3520
#15 0x7fa4bb2fb360 in g_signal_emit_valist ../gobject/gsignal.c:3263
#16 0x7fa4bb2fb422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#17 0x562e9c10e0a8 in sync_list ../src/dirlist.cc:232
#18 0x562e9c10e0a8 in dirlist_list(_GtkWindow*, GnomeCmdDir*, int, void (*)(GnomeCmdDir*, int, _GList*, _GError*)) ../src/dirlist.cc:307
#19 0x562e9c1ee507 in gnome_cmd_dir_list_files(_GtkWindow*, GnomeCmdDir*, int) ../src/gnome-cmd-dir.cc:494
#20 0x562e9c247e0b in GnomeCmdFileList::set_directory(GnomeCmdDir*) ../src/gnome-cmd-file-list.cc:3127
#21 0x562e9c286fb5 in GnomeCmdFileSelector::new_tab(GnomeCmdDir*, GnomeCmdFileList::ColumnID, GtkSortType, int, int) ../src/gnome-cmd-file-selector.cc:1554
#22 0x562e9c2b1c1a in GnomeCmdMainWin::open_tabs(FileSelectorID) ../src/gnome-cmd-main-win.cc:963
#23 0x562e9c2bb5a3 in gnome_cmd_main_win_init ../src/gnome-cmd-main-win.cc:622
#24 0x7fa4bb306c69 in g_type_create_instance (/lib64/libgobject-2.0.so.0+0x3dc69) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#25 0x7fa4bb2ec003 in g_object_new_internal ../gobject/gobject.c:2606
#26 0x7fa4bb2ed61d in g_object_new_internal ../gobject/gobject.c:2603
#27 0x7fa4bb2ee640 in g_object_new (/lib64/libgobject-2.0.so.0+0x25640) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#28 0x562e9c141c59 in GnomeCmdMainWin::operator new(unsigned long) ../src/gnome-cmd-main-win.h:57
#29 0x562e9c141c59 in gnome_cmd_application_activate ../src/gnome-cmd-application.cc:128
#30 0x7fa4bb2fb253 in _g_closure_invoke_va ../gobject/gclosure.c:897
#31 0x7fa4bb2fb253 in signal_emit_valist_unlocked ../gobject/gsignal.c:3424
#32 0x7fa4bb2fb360 in g_signal_emit_valist ../gobject/gsignal.c:3263
#33 0x7fa4bb2fb422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#34 0x7fa4bab12e6f in g_application_real_local_command_line ../gio/gapplication.c:1188
#35 0x7fa4bab13012 in g_application_run (/lib64/libgio-2.0.so.0+0xe2012) (BuildId: 1a20350aab8ff50007bb0131898dc24973f8b164)
#36 0x562e9c0e8e2a in main ../src/main.cc:40
#37 0x7fa4b8c39087 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#38 0x7fa4b8c3914a in __libc_start_main_impl ../csu/libc-start.c:360
#39 0x562e9c0ea7b4 in _start (/usr/libexec/gnome-commander/gnome-commander+0x6b7b4) (BuildId: d50e9c60ef0fadd0bf3d652a4157c8cfee86a115)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ../src/gnome-cmd-main-win.cc:1103 in GnomeCmdMainWin::update_cmdline()
==574916==ABORTING
Reproducing both on e241767a and released gcmd-1.18.0