Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageClient's thread_view is invalid #702

Open
oxzi opened this issue Oct 19, 2020 · 1 comment
Open

PageClient's thread_view is invalid #702

oxzi opened this issue Oct 19, 2020 · 1 comment

Comments

@oxzi
Copy link

oxzi commented Oct 19, 2020

Recently I noticed a lot of crashes of astroid. They seemed to be related to an invalid thread_view pointer in PageClient. When receiving new mails or editing their tags, segmentation faults occurred, as can be read in the following gdb logs.

I describe PageClient's thread_view as invalid, because its class variables have odd values. For example, page_client does not point back to the original PageClient pointer. Also I already had a thread_view which was a null pointer. Unfortunately I don't have the log for this.

However, it seems that I can only trigger this error if a ThreadViewActivatable plugin is loaded. Although I could not prove it, I would assume a connection here. Btw, it concerns the following plugin.

Initially I noticed the crashes with version 0.15. I did the debugging on the HEAD of the current master branch, 0723bf7. Two similar gdb logs of the probably same bug follow.

Thanks for all the great work!

Thread 1 "astroid" received signal SIGSEGV, Segmentation fault.
Astroid::PageClient::build_mime_tree (this=0x1920af0, m=..., c=..., root=<optimized out>, shallow=<optimized out>, keep_state=<optimized out>) at …/astroid/src/modes/thread_view/page_client.cc:794
794               part->set_focusable ( thread_view->state[m].get_element_by_id (c->id)->focusable );

(gdb) bt
#0  Astroid::PageClient::build_mime_tree (this=0x1920af0, m=..., c=..., root=<optimized out>, shallow=<optimized out>, keep_state=<optimized out>) at …/astroid/src/modes/thread_view/page_client.cc:794
#1  0x00000000005ef903 in Astroid::PageClient::make_message (this=0x1920af0, m=..., keep_state=true) at /nix/store/m9d4nxg3sr4cvzrfpbfj8y9xzp2x736c-glibmm-2.62.0-dev/include/glibmm-2.4/glibmm/refptr.h:282
#2  0x00000000005f0810 in Astroid::PageClient::update_message (this=this@entry=0x1920af0, m=..., t=t@entry=AstroidMessages::UpdateMessage_Type_Tags)
    at /nix/store/m9d4nxg3sr4cvzrfpbfj8y9xzp2x736c-glibmm-2.62.0-dev/include/glibmm-2.4/glibmm/refptr.h:282
#3  0x00000000005da746 in Astroid::ThreadView::on_message_changed (this=0xfccc60, m=0x12a3d70, me=<optimized out>) at /nix/store/m9d4nxg3sr4cvzrfpbfj8y9xzp2x736c-glibmm-2.62.0-dev/include/glibmm-2.4/glibmm/refptr.h:282
#4  0x0000000000673557 in sigc::internal::signal_emit3<void, Astroid::Db*, Astroid::Message*, Astroid::Message::MessageChangedEvent, sigc::nil>::emit (_A_a3=@0x7ffffffe9824: Astroid::Message::MESSAGE_TAGS_CHANGED,
    _A_a2=@0x7ffffffe9838: 0x12a3d70, _A_a1=@0x7ffffffe9828: 0x7ffffffe9aa0, impl=0xfaf5e0) at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot_base.h:335
#5  sigc::signal3<void, Astroid::Db*, Astroid::Message*, Astroid::Message::MessageChangedEvent, sigc::nil>::emit (this=<optimized out>, _A_a3=@0x7ffffffe9824: Astroid::Message::MESSAGE_TAGS_CHANGED, _A_a2=@0x7ffffffe9838: 0x12a3d70,
    _A_a1=@0x7ffffffe9828: 0x7ffffffe9aa0) at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/signal.h:3259
#6  Astroid::Message::emit_message_changed (this=<optimized out>, db=<optimized out>, me=<optimized out>) at …/astroid/src/message_thread.cc:169
#7  0x00000000006738cd in Astroid::MessageThread::on_thread_updated (this=<optimized out>, db=0x7ffffffe9aa0, tid=...) at …/astroid/src/message_thread.cc:1079
#8  0x000000000067dd81 in sigc::bound_mem_functor2<void, Astroid::MessageThread, Astroid::Db*, Glib::ustring>::operator() (_A_a2=..., _A_a1=@0x7ffffffe9988: 0x7ffffffe9aa0, this=<optimized out>)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/mem_fun.h:2142
#9  sigc::adaptor_functor<sigc::bound_mem_functor2<void, Astroid::MessageThread, Astroid::Db*, Glib::ustring> >::operator()<Astroid::Db* const&, Glib::ustring const&> (_A_arg2=..., _A_arg1=@0x7ffffffe9988: 0x7ffffffe9aa0,
    this=<optimized out>) at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:108
#10 sigc::internal::slot_call<sigc::bound_mem_functor2<void, Astroid::MessageThread, Astroid::Db*, Glib::ustring>, void, Astroid::Db*, Glib::ustring>::call_it (rep=<optimized out>, a_#0=@0x7ffffffe9988: 0x7ffffffe9aa0, a_#1=...)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:451
#11 0x00000000005f8050 in sigc::internal::signal_emit2<void, Astroid::Db*, Glib::ustring, sigc::nil>::emit (_A_a2=..., _A_a1=@0x7ffffffe9988: 0x7ffffffe9aa0, impl=0x186eea0)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot_base.h:335
#12 sigc::signal2<void, Astroid::Db*, Glib::ustring, sigc::nil>::emit (this=0x9015b8, _A_a2=..., _A_a1=@0x7ffffffe9988: 0x7ffffffe9aa0)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/signal.h:3104
#13 Astroid::ActionManager::emit_thread_updated (this=this@entry=0x901400, db=<optimized out>, db@entry=0x7ffffffe9aa0, thread_id=...) at …/astroid/src/actions/action_manager.cc:186
#14 0x00000000005415da in Astroid::NotmuchThread::emit_updated (this=<optimized out>, db=0x7ffffffe9aa0) at …/astroid/src/db.cc:834
#15 0x0000000000602c68 in Astroid::TagAction::emit (this=<optimized out>, db=0x7ffffffe9aa0) at …/astroid/src/actions/tag_action.cc:74
#16 0x00000000005faa56 in Astroid::ActionManager::emitter (this=0x901400) at …/astroid/src/actions/action_manager.cc:139
#17 0x00007ffff204be92 in Glib::DispatchNotifier::pipe_io_handler(Glib::IOCondition) () from /nix/store/7ff8zdc3v333v1wpl14gfdnxyq17b7qv-glibmm-2.62.0/lib/libglibmm-2.4.so.1
#18 0x00007ffff204dfac in Glib::IOSource::dispatch(sigc::slot_base*) () from /nix/store/7ff8zdc3v333v1wpl14gfdnxyq17b7qv-glibmm-2.62.0/lib/libglibmm-2.4.so.1
#19 0x00007ffff204e1af in Glib::Source::dispatch_vfunc(_GSource*, int (*)(void*), void*) () from /nix/store/7ff8zdc3v333v1wpl14gfdnxyq17b7qv-glibmm-2.62.0/lib/libglibmm-2.4.so.1
#20 0x00007ffff296dc6e in g_main_context_dispatch () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libglib-2.0.so.0
#21 0x00007ffff296e020 in g_main_context_iterate.isra () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libglib-2.0.so.0
#22 0x00007ffff296e0af in g_main_context_iteration () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libglib-2.0.so.0
#23 0x00007ffff4228ecd in g_application_run () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libgio-2.0.so.0
#24 0x000000000050fd80 in Astroid::Astroid::run (this=0x791570, argc=argc@entry=3, argv=argv@entry=0x7ffffffea608) at …/astroid/src/astroid.cc:324
#25 0x00000000005088c8 in main (argc=3, argv=0x7ffffffea608) at …/astroid/src/main.cc:8

(gdb) p (('Astroid::PageClient'*) 0x1920af0)->thread_view
$1 = (Astroid::ThreadView *) 0x748010
(gdb) p (('Astroid::PageClient'*) 0x1920af0)->thread_view->page_client
$2 = (Astroid::PageClient *) 0xdf0ab0
Thread 1 "astroid" received signal SIGSEGV, Segmentation fault.
Astroid::PluginManager::ThreadViewExtension::format_tags (this=0xffffffffffffffff, tags=std::vector of length 4, capacity 4 = {...}, bg=..., selected=false, out=...) at …/astroid/src/plugin/manager.cc:426
426         if (!active || astroid->plugin_manager->disabled) return false;

(gdb) bt
#0  Astroid::PluginManager::ThreadViewExtension::format_tags (this=0xffffffffffffffff, tags=std::vector of length 4, capacity 4 = {...}, bg=..., selected=false, out=...) at …/astroid/src/plugin/manager.cc:426
#1  0x00000000005ef3df in Astroid::PageClient::make_message (this=0x174ce70, m=..., keep_state=true) at /nix/store/b3zsk4ihlpiimv3vff86bb5bxghgdzb9-gcc-9.2.0/include/c++/9.2.0/bits/stl_uninitialized.h:82
#2  0x00000000005f0810 in Astroid::PageClient::update_message (this=this@entry=0x174ce70, m=..., t=t@entry=AstroidMessages::UpdateMessage_Type_Tags)
    at /nix/store/m9d4nxg3sr4cvzrfpbfj8y9xzp2x736c-glibmm-2.62.0-dev/include/glibmm-2.4/glibmm/refptr.h:282
#3  0x00000000005da746 in Astroid::ThreadView::on_message_changed (this=0x1116000, m=0x1000d10, me=<optimized out>) at /nix/store/m9d4nxg3sr4cvzrfpbfj8y9xzp2x736c-glibmm-2.62.0-dev/include/glibmm-2.4/glibmm/refptr.h:282
#4  0x0000000000673557 in sigc::internal::signal_emit3<void, Astroid::Db*, Astroid::Message*, Astroid::Message::MessageChangedEvent, sigc::nil>::emit (_A_a3=@0x7ffffffe9614: Astroid::Message::MESSAGE_TAGS_CHANGED,
    _A_a2=@0x7ffffffe9628: 0x1000d10, _A_a1=@0x7ffffffe9618: 0x7ffffffe98a0, impl=0x15b2fa0) at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot_base.h:335
#5  sigc::signal3<void, Astroid::Db*, Astroid::Message*, Astroid::Message::MessageChangedEvent, sigc::nil>::emit (this=<optimized out>, _A_a3=@0x7ffffffe9614: Astroid::Message::MESSAGE_TAGS_CHANGED, _A_a2=@0x7ffffffe9628: 0x1000d10,
    _A_a1=@0x7ffffffe9618: 0x7ffffffe98a0) at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/signal.h:3259
#6  Astroid::Message::emit_message_changed (this=<optimized out>, db=<optimized out>, me=<optimized out>) at …/astroid/src/message_thread.cc:169
#7  0x00000000006738cd in Astroid::MessageThread::on_thread_updated (this=<optimized out>, db=0x7ffffffe98a0, tid=...) at …/astroid/src/message_thread.cc:1079
#8  0x000000000067dd81 in sigc::bound_mem_functor2<void, Astroid::MessageThread, Astroid::Db*, Glib::ustring>::operator() (_A_a2=..., _A_a1=@0x7ffffffe9778: 0x7ffffffe98a0, this=<optimized out>)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/mem_fun.h:2142
#9  sigc::adaptor_functor<sigc::bound_mem_functor2<void, Astroid::MessageThread, Astroid::Db*, Glib::ustring> >::operator()<Astroid::Db* const&, Glib::ustring const&> (_A_arg2=..., _A_arg1=@0x7ffffffe9778: 0x7ffffffe98a0,
    this=<optimized out>) at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:108
#10 sigc::internal::slot_call<sigc::bound_mem_functor2<void, Astroid::MessageThread, Astroid::Db*, Glib::ustring>, void, Astroid::Db*, Glib::ustring>::call_it (rep=<optimized out>, a_#0=@0x7ffffffe9778: 0x7ffffffe98a0, a_#1=...)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot.h:451
#11 0x00000000005f8050 in sigc::internal::signal_emit2<void, Astroid::Db*, Glib::ustring, sigc::nil>::emit (_A_a2=..., _A_a1=@0x7ffffffe9778: 0x7ffffffe98a0, impl=0x190d0b0)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/functors/slot_base.h:335
#12 sigc::signal2<void, Astroid::Db*, Glib::ustring, sigc::nil>::emit (this=0x8735b8, _A_a2=..., _A_a1=@0x7ffffffe9778: 0x7ffffffe98a0)
    at /nix/store/j6d3gbiai727y7ysfcj8bylp6307bxgd-libsigc++-2.10.1/include/sigc++-2.0/sigc++/signal.h:3104
#13 Astroid::ActionManager::emit_thread_updated (this=this@entry=0x873400, db=<optimized out>, db@entry=0x7ffffffe98a0, thread_id=...) at …/astroid/src/actions/action_manager.cc:186
#14 0x000000000055df99 in Astroid::Poll::refresh_threads (this=<optimized out>) at …/astroid/src/poll.cc:362
#15 0x00007ffff204be92 in Glib::DispatchNotifier::pipe_io_handler(Glib::IOCondition) () from /nix/store/7ff8zdc3v333v1wpl14gfdnxyq17b7qv-glibmm-2.62.0/lib/libglibmm-2.4.so.1
#16 0x00007ffff204dfac in Glib::IOSource::dispatch(sigc::slot_base*) () from /nix/store/7ff8zdc3v333v1wpl14gfdnxyq17b7qv-glibmm-2.62.0/lib/libglibmm-2.4.so.1
#17 0x00007ffff204e1af in Glib::Source::dispatch_vfunc(_GSource*, int (*)(void*), void*) () from /nix/store/7ff8zdc3v333v1wpl14gfdnxyq17b7qv-glibmm-2.62.0/lib/libglibmm-2.4.so.1
#18 0x00007ffff296dc6e in g_main_context_dispatch () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libglib-2.0.so.0
#19 0x00007ffff296e020 in g_main_context_iterate.isra () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libglib-2.0.so.0
#20 0x00007ffff296e0af in g_main_context_iteration () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libglib-2.0.so.0
#21 0x00007ffff4228ecd in g_application_run () from /nix/store/9dsvcqg7mhkq7727afqb0dhdvmrvv9w5-glib-2.62.6/lib/libgio-2.0.so.0
#22 0x000000000050fd80 in Astroid::Astroid::run (this=0x791570, argc=argc@entry=3, argv=argv@entry=0x7ffffffea608) at …/astroid/src/astroid.cc:324
#23 0x00000000005088c8 in main (argc=3, argv=0x7ffffffea608) at …/astroid/src/main.cc:8

(gdb) p (('Astroid::PageClient'*) 0x174ce70)->thread_view
$1 = (Astroid::ThreadView *) 0x17542c0
(gdb) p (('Astroid::PageClient'*) 0x174ce70)->thread_view->plugins
$2 = (Astroid::PluginManager::ThreadViewExtension *) 0xffffffffffffffff
(gdb) p (('Astroid::PageClient'*) 0x174ce70)->thread_view->page_client
$3 = (Astroid::PageClient *) 0x61
@gauteh
Copy link
Member

gauteh commented Oct 20, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants