Closed A-ri-eL closed 1 year ago
Hi @A-ri-eL it would be useful if you can build for debug from the source code following https://github.com/giuspen/cherrytree#building-cherrytree-on-ubuntu but instead of ./build.sh
use ./build.sh debug
then you should be able to give me a core dump with the actual cherrytree symbols
Thanks for your answer.
As I'm using a Debian 12 docker container to compile, ninja was not able to perform some tests that seem to need graphical user interface, then it always failed. So I managed to get a .deb
package with a not-stripped cheerytree bianary via export DEB_BUILD_OPTIONS=nostrip
.
~$file `which cherrytree`
/usr/bin/cherrytree: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=76338fe2c8b814ca77dcf9726429e657573fd214, for GNU/Linux 3.2.0, with debug_info, not stripped
I'm having difficulty to read that crash dump, probably because the binary of cherrytree that I pass to gdb is not the same that you are using. I will improve build.sh to support 2 arguments so that you will be able to pass both arguments 'debug' and 'notests' while at the moment you can pass only one
I have now improved build.sh if you git pull the latest, I also added support for the argument 'help'. In fact I noticed that 'debug' is already the default target, anyway you can now call ./build.sh debug notests Then run it via $ gdb ./build/cherrytree (gdb) r ...after it crashes (gdb) bt And copy/paste the backtrace here please
@giuspen ^-^ I proceeded exactly as you described so I've got:
~$ ls
build.ninja CMakeCache.txt cmake_install.cmake CPackConfig.cmake src
cherrytree CMakeFiles cmake_uninstall.cmake CPackSourceConfig.cmake
~$ file ./cherrytree
./cherrytree: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a7c74ef792e741ba3650f5f43267d3dbff6e2a79, for GNU/Linux 3.2.0, with debug_info, not stripped
$ ./cherrytree --version
CherryTree 1.0.0
Then starting cherrytree
from GDB and after working some time on the App when closing it I've got:
(...)
[Thread 0x7fffe1dfe6c0 (LWP 15242) exited]
Thread 1 "cherrytree" received signal SIGSEGV, Segmentation fault.
0x00007ffff7be2cd7 in Gtk::TreeView::get_selection() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
(gdb) bt
#0 0x00007ffff7be2cd7 in Gtk::TreeView::get_selection() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
Backtrace stopped: Cannot access memory at address 0x7fffffffb448
(gdb)
Unfortunately in your backtrace the symbols (names of functions) are not visible, I don't understand why.
Maybe try once again after after uninstalling completely your installed cherrytree and ensuring it's not running already maybe on the systray? (e.g. ps aux | grep cherrytree
)
I have concern that maybe one instance of cherrytree was running so it didn't really run from your built sources.
Then
git pull
git clean -dfx
./build.sh debug notests
$ gdb ./build/cherrytree
(gdb) r
...after it crashes
(gdb) bt
@giuspen thanks for your instructions. Hope I was able to get some useful backtrace now.
(...)
[Thread 0x7fffd23ff6c0 (LWP 8553) exited]
[2023-07-26 12:22:24.181] [ ] [debug] autosave no need
Thread 1 "cherrytree" received signal SIGSEGV, Segmentation fault.
0x00007ffff7be2cd7 in Gtk::TreeView::get_selection() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
(gdb) bt
#0 0x00007ffff7be2cd7 in Gtk::TreeView::get_selection() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#1 0x0000555555664f5a in CtMainWin::curr_tree_iter (this=0x5555561926d0) at /root/ct/cherrytree/src/ct/ct_main_win.h:126
#2 0x00005555558ffe91 in operator() (__closure=0x555559896da0, rMark=...) at /root/ct/cherrytree/src/ct/ct_codebox.cc:61
#3 0x0000555555905569 in sigc::adaptor_functor<CtTextCell::CtTextCell(CtMainWin*, const Glib::ustring&, const std::string&)::<lambda(const Gtk::TextIter&, const Glib::RefPtr<Gtk::TextMark>&)> >::operator()<const Gtk::TextIter&, const Glib::RefPtr<Gtk::TextMark>&>(const Gtk::TextIter &, const Glib::RefPtr<Gtk::TextMark> &) const (this=0x555559896da0, _A_arg1=..., _A_arg2=...) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:108
#4 0x000055555590489f in sigc::internal::slot_call2<CtTextCell::CtTextCell(CtMainWin*, const Glib::ustring&, const std::string&)::<lambda(const Gtk::TextIter&, const Glib::RefPtr<Gtk::TextMark>&)>, void, const Gtk::TextIter&, const Glib::RefPtr<Gtk::TextMark>&>::call_it(sigc::internal::slot_rep *, sigc::type_trait_take_t, sigc::type_trait_take_t) (rep=0x555559896d70, a_1=..., a_2=...) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:206
#5 0x00007ffff7bc2ff0 in ?? () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#6 0x00007ffff63f83b0 in g_closure_invoke () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7 0x00007ffff640b076 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8 0x00007ffff6411bf5 in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9 0x00007ffff6411dbf in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffff6ed6f52 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#11 0x00007ffff6f06dde in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#12 0x00007ffff63f83b0 in g_closure_invoke () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x00007ffff640b076 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x00007ffff6411bf5 in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x00007ffff6411dbf in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x00007ffff6cb3497 in gtk_adjustment_set_value () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#17 0x00007ffff6f038b0 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#18 0x00007ffff6f0f8c1 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#19 0x00007ffff63fd616 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007ffff64005ac in g_object_set_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x00007ffff640111c in g_object_set () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x00007ffff6e99fbd in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#23 0x00007ffff63fb611 in g_cclosure_marshal_VOID__OBJECTv () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff63f85a9 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff6411bbf in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ffff6411dbf in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff6d1f355 in gtk_container_remove () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#28 0x00007ffff7bebd6b in Gtk::Widget_Class::dispose_vfunc_callback(_GObject*) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#29 0x00007ffff63febb8 in g_object_run_dispose () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#30 0x00007ffff6e9aebd in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff63f83b0 in g_closure_invoke () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#32 0x00007ffff640b124 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#33 0x00007ffff6411bf5 in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#34 0x00007ffff6411dbf in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#35 0x00007ffff6f740dd in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#36 0x00007ffff63febb8 in g_object_run_dispose () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#37 0x00007ffff7c1b098 in Gtk::Object::_release_c_instance() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#38 0x00007ffff7babb96 in Gtk::ScrolledWindow::~ScrolledWindow() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#39 0x000055555590e212 in CtCodebox::~CtCodebox (this=0x55555985ec00, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /root/ct/cherrytree/src/ct/ct_codebox.h:54
#40 0x000055555590e2ae in CtCodebox::~CtCodebox (this=0x55555985ec00, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /root/ct/cherrytree/src/ct/ct_codebox.h:54
#41 0x00005555557f6725 in CtTreeStore::_iter_delete_anchored_widgets (this=0x5555566d4610, children=...)
at /root/ct/cherrytree/src/ct/ct_treestore.cc:388
#42 0x00005555557f64ce in CtTreeStore::~CtTreeStore (this=0x5555566d4610, __in_chrg=<optimized out>)
at /root/ct/cherrytree/src/ct/ct_treestore.cc:367
#43 0x00005555557f65d2 in CtTreeStore::~CtTreeStore (this=0x5555566d4610, __in_chrg=<optimized out>)
at /root/ct/cherrytree/src/ct/ct_treestore.cc:371
#44 0x00005555556af14a in std::default_delete<CtTreeStore>::operator() (this=0x555556192dd0, __ptr=0x5555566d4610)
at /usr/include/c++/12/bits/unique_ptr.h:95
#45 0x00005555556ac0b0 in std::unique_ptr<CtTreeStore, std::default_delete<CtTreeStore> >::~unique_ptr (this=0x555556192dd0,
__in_chrg=<optimized out>) at /usr/include/c++/12/bits/unique_ptr.h:396
#46 0x0000555555699476 in CtMainWin::~CtMainWin (this=0x5555561926d0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /root/ct/cherrytree/src/ct/ct_main_win.cc:201
#47 0x0000555555699622 in CtMainWin::~CtMainWin (this=0x5555561926d0, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /root/ct/cherrytree/src/ct/ct_main_win.cc:201
#48 0x0000555555659266 in CtApp::on_window_removed (this=0x555555f78140, window=0x5555561926d0) at /root/ct/cherrytree/src/ct/ct_app.cc:257
#49 0x00007ffff7b20147 in Gtk::Application_Class::window_removed_callback(_GtkApplication*, _GtkWindow*) ()
from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#50 0x00007ffff63fb611 in g_cclosure_marshal_VOID__OBJECTv () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#51 0x00007ffff63f85a9 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#52 0x00007ffff6411bbf in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#53 0x00007ffff6411dbf in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#54 0x00007ffff7beae84 in ?? () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#55 0x00007ffff63f83b0 in g_closure_invoke () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#56 0x00007ffff640b344 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#57 0x00007ffff6411bf5 in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#58 0x00007ffff6411dbf in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#59 0x00007ffff6f73eb1 in gtk_widget_hide () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#60 0x00007ffff63febb8 in g_object_run_dispose () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#61 0x00007ffff6e0934d in gtk_main_do_event () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#62 0x00007ffff7e2a815 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#63 0x00007ffff7e84702 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#64 0x00007ffff62fe7a9 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#65 0x00007ffff62fea38 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#66 0x00007ffff62feacc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#67 0x00007ffff750d65d in g_application_run () from /lib/x86_64-linux-gnu/libgio-2.0.so.0
#68 0x00005555555ee87e in main (argc=1, argv=0x7fffffffdd08) at /root/ct/cherrytree/src/ct/ct_main.cc:129
(gdb)
Yes this is a good backtrace I will have a look vs the code, may get back with more questions
Could you please pull the latest from git, rebuild and if it crashes again generate again a backtrace for me?
It worked! No more crashes :)
Thanks!
Hi, all!
For some reason cherrytree is performing core dumps every time I close the app after some time working on it. All of them points to the same issue (segfault):
~$ cherrytree --version CherryTree 0.99.56
~$ lsb_release -a Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm
~$ kf5-config --version Qt: 5.15.8 KDE Frameworks: 5.103.0 kf5-config: 1.0
~$ ls -lhS /var/lib/systemd/coredump/ total 53M ... 20M jul 3 22:03 core.cherrytree.1000.d64dfff681984efa9d44251c0dd62f2b.30844.1688432589000000.zst ... 14M jul 3 14:58 core.cherrytree.1000.d64dfff681984efa9d44251c0dd62f2b.4464.1688407082000000.zst
Here is the most recent one: