Regression: xfce4-terminal crashes when using latest VTE builds
HEAD (at time of testing): 8586e429
Offending commit (found via git-bisect): be6896d9
Using xfce4-terminal on the latest VTE, I encountered the application crashing when closing the terminal (or any tab) due to an exception being thrown:
terminate called after throwing an instance of 'std::runtime_error'
what(): Widget is nullptr
GDB backtrace
(gdb) bt
#0 0x00007ffff6e4f615 in raise () at /usr/lib/libc.so.6
#1 0x00007ffff6e38862 in abort () at /usr/lib/libc.so.6
#2 0x00007ffff66e386a in __gnu_cxx::__verbose_terminate_handler() () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#3 0x00007ffff66efd9a in __cxxabiv1::__terminate(void (*)()) (handler=<optimized out>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#4 0x00007ffff66efe07 in std::terminate() () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#5 0x00007ffff66f00ae in __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*)) (obj=<optimized out>, tinfo=0x7ffff681c280 <typeinfo for std::runtime_error>, dest=0x7ffff6705fe0 <std::runtime_error::~runtime_error()>)
at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95
#6 0x00007ffff7ddcc76 in _vte_terminal_get_impl(_VteTerminal*) [clone .cold] () at /usr/lib/libvte-2.91.so.0
#7 0x00007ffff7df4639 in vte::terminal::emit_child_exited_idle_cb(_VteTerminal*) () at /usr/lib/libvte-2.91.so.0
#8 0x00007ffff704fa84 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#9 0x00007ffff70a39b1 in () at /usr/lib/libglib-2.0.so.0
#10 0x00007ffff704efd3 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#11 0x00007ffff77eb22f in gtk_main () at /usr/lib/libgtk-3.so.0
#12 0x0000555555567100 in main (argc=<optimized out>, argv=<optimized out>) at main.c:352
Since the offending commit introduces smart pointers to handle cleanup for the terminal widget, I imagine what's happening is the VteTerminal instance is being cleaned up before emit_child_exited_idle_cb is being called, causing this issue. But I'm not very familiar with this codebase so I'm welcome to any input.
Thanks!
Edited by John C. Allwein