gphalkes / tilde

The Tilde text editor
395 stars 21 forks source link

Random crash when closing window #37

Closed magiblot closed 5 years ago

magiblot commented 5 years ago

EDIT: Link to video reproducing the issue: https://drive.google.com/open?id=14Vq1wOGhvJBw4AL6ESq1RDDuQUC8IuGz

screenshot

It's not too easy to reproduce, but I can experience this when messing with windows.

I have the backtrace of the crash, with debug symbols:

#0  0x00007fa316de8c72 in std::_Deque_iterator<std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >, std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >&, std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >*>::_Deque_iterator(std::_Deque_iterator<std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >, std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >&, std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >*> const&) () from /usr/lib/libt3widget.so.2
#1  0x00007fa316de88c3 in std::deque<std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >, std::allocator<std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> > > >::begin() () from /usr/lib/libt3widget.so.2
#2  0x00007fa316de92e2 in std::deque<std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >, std::allocator<std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> > > >::clear() () from /usr/lib/libt3widget.so.2
#3  0x00007fa316de72e0 in t3widget::split_t::unsplit(std::unique_ptr<t3widget::widget_t, std::default_delete<t3widget::widget_t> >*) () from /usr/lib/libt3widget.so.2
#4  0x00007fa316de7466 in t3widget::split_t::unsplit() () from /usr/lib/libt3widget.so.2
#5  0x000055b4ee054f85 in ?? ()
#6  0x000055b4ee05b0a9 in ?? ()
#7  0x000055b4ee05e90a in ?? ()
#8  0x00007fa316e2b4f0 in std::function<void (int)>::operator()(int) const () from /usr/lib/libt3widget.so.2
#9  0x00007fa316e2b059 in t3widget::internal::func_ptr_t<int>::call(int) const () from /usr/lib/libt3widget.so.2
#10 0x00007fa316e2a921 in t3widget::signal_t<int>::operator()(int) const () from /usr/lib/libt3widget.so.2
#11 0x00007fa316e9c6cf in t3widget::signal_t<int>::get_trigger() const::{lambda(int)#1}::operator()(int) const () from /usr/lib/libt3widget.so.2
#12 0x00007fa316e9d51e in std::_Function_handler<void (int), t3widget::signal_t<int>::get_trigger() const::{lambda(int)#1}>::_M_invoke(std::_Any_data const&, int&&) ()
   from /usr/lib/libt3widget.so.2
#13 0x00007fa316e2b4f0 in std::function<void (int)>::operator()(int) const () from /usr/lib/libt3widget.so.2
#14 0x00007fa316e2b059 in t3widget::internal::func_ptr_t<int>::call(int) const () from /usr/lib/libt3widget.so.2
#15 0x00007fa316e2a921 in t3widget::signal_t<int>::operator()(int) const () from /usr/lib/libt3widget.so.2
#16 0x00007fa316e29f54 in t3widget::menu_panel_t::activate(int) () from /usr/lib/libt3widget.so.2
#17 0x00007fa316e15d3c in t3widget::menu_item_t::process_mouse_event_from_menu(t3widget::mouse_event_t) () from /usr/lib/libt3widget.so.2
#18 0x00007fa316e28f82 in t3widget::menu_panel_t::process_mouse_event(t3widget::mouse_event_t) () from /usr/lib/libt3widget.so.2
#19 0x00007fa316e9bdfc in t3widget::menu_bar_t::process_mouse_event(t3widget::mouse_event_t) () from /usr/lib/libt3widget.so.2
#20 0x00007fa316e4ee27 in t3widget::mouse_target_t::handle_mouse_event(t3widget::mouse_event_t) () from /usr/lib/libt3widget.so.2
#21 0x00007fa316df2799 in t3widget::iterate() () from /usr/lib/libt3widget.so.2
#22 0x00007fa316df284e in t3widget::main_loop() () from /usr/lib/libt3widget.so.2
#23 0x000055b4ee057162 in ?? ()
#24 0x00007fa316924223 in __libc_start_main () from /usr/lib/libc.so.6
#25 0x000055b4ee02f96e in ?? ()

I am on Arch Linux, using the package from AUR, with a tweaked PKGBUILD to generate a debug build (CXXFLAGS="-O0 -g -gstabs+"). I guess it would also help If I knew how to include the source so that it is visible to gdb.

I was running tilde on a TTY. I haven't tried in other terminals, but I will do soon. (EDIT: can reproduce in xterm). The full output of tilde --version is:

Tilde version 1.0.0
Copyright (c) 2011-2018 G.P. Halkes
Tilde is licensed under the GNU General Public License version 3
Library versions:
  libt3config 0.2.11
  libt3highlight 0.4.5
  libt3key (through libt3widget) 0.2.9
  libt3widget 1.0.2
  libt3window 0.3.2
  libtranscript 0.3.3
  libunistring 9.10.?

Cheers!

gphalkes commented 5 years ago

Thanks a lot for the extremely detailed information! That is really helpful for reproducing the bug, and I was able to reproduce it on my machine. I'll try to get this fixed as soon as possible, although it will likely be after Christmas before I am able to do a new release.

magiblot commented 5 years ago

Of course, gphalkes. Thanks and have a merry Christmas!

gphalkes commented 5 years ago

Thanks for the patience. I've fixed the underlying issue in libt3widget: https://github.com/gphalkes/t3widget/commit/2d8b059380031ad3ce5fc57ee13e3c0be8086b0e

This will be part of the next release, which should be soon. But, as you have filed a few other bugs, I'll try to see if I can fix those in the same release, so it might be a few days.