Hoglet / TimeIT

The unobtrusive time tracker
GNU General Public License v3.0
19 stars 7 forks source link

get_cardinal failed: Unexpected data #19

Closed hackel closed 5 years ago

hackel commented 7 years ago

When I launch timeit, the above message prints to the console every second indefinitely until I exit.

Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-t2inzsevG5: Connection refused
failed: Unexpected dataget_cardinal failed: Unexpected dataget_cardinal failed: Unexpected dataget_cardinal failed: Unexpected data ...etc.

Backtrace:

#0  0x00007ffff520818d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff6987576 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6987902 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff43f4507 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#4  0x000055555568708f in GUI::GUIFactory::run() ()
#5  0x00005555556c0565 in Main::run() ()
#6  0x00005555556c082b in main ()

Then when I exit, it segfaults:

(timeit:16541): glibmm-CRITICAL **: Glib::ObjectBase* Glib::wrap_create_new_wrapper(GObject*): assertion 'wrap_func_table != nullptr' failed
(timeit:16541): glibmm-WARNING **: Failed to wrap object of type 'GailCalendar'. Hint: this error is commonly caused by failing to call a library init() function.
=== last 2 lines repeat 9 times ===
Thread 1 "timeit" received signal SIGSEGV, Segmentation fault.
0x00007fffe9505241 in ?? () from /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libgail.so

Backtrace:

#0  0x00007fffe9505241 in  () at /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libgail.so
#1  0x00007ffff6c60c25 in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#2  0x00007ffff6c72c32 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#3  0x00007ffff6c7b88c in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4  0x00007ffff6c7bc6f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5  0x00007ffff6c65054 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6  0x00007ffff6c67511 in g_object_notify () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7  0x00007ffff4514b19 in gtk_widget_hide () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#8  0x00007ffff6c672f8 in g_object_run_dispose () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9  0x00007ffff43484ba in  () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#10 0x00007ffff437cf8f in  () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#11 0x00007ffff6c60c25 in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007ffff6c72f46 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x00007ffff6c7b88c in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x00007ffff6c7bc6f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#15 0x00007ffff441bc60 in  () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#16 0x00007ffff6c658b5 in g_object_unref () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#17 0x00007ffff7a49afa in Gtk::Object::_destroy_c_instance() () at /usr/lib/x86_64-linux-gnu/libgtkmm-2.4.so.1
#18 0x00007ffff7a06941 in Gtk::VBox::~VBox() () at /usr/lib/x86_64-linux-gnu/libgtkmm-2.4.so.1
#19 0x0000555555691047 in GUI::MainWindow::~MainWindow() ()
#20 0x0000555555691274 in GUI::MainWindow::~MainWindow() ()
#21 0x000055555568ae8a in std::_Sp_counted_ptr<GUI::MainWindow*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#22 0x00005555556589c6 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#23 0x00005555556583ad in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() ()
#24 0x000055555568834e in std::__shared_ptr<IWidget, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() ()
#25 0x0000555555688386 in std::shared_ptr<IWidget>::~shared_ptr() ()
#26 0x0000555555686f46 in GUI::GUIFactory::~GUIFactory() ()
#27 0x0000555555686f9e in GUI::GUIFactory::~GUIFactory() ()
#28 0x00005555556c1df4 in std::_Sp_counted_ptr<GUI::GUIFactory*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#29 0x00005555556589c6 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#30 0x00005555556583ad in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() ()
#31 0x00005555556b8ec2 in std::__shared_ptr<GUI::IGUIFactory, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() ()
#32 0x00005555556b8f04 in std::shared_ptr<GUI::IGUIFactory>::~shared_ptr() ()
#33 0x00005555556c00ac in Main::~Main() ()
#34 0x00005555556c0839 in main ()

It seems to be otherwise working normally. Idle time fires, etc. I've just upgraded to Ubuntu 17.04 (without recompiling), so perhaps it's related to that. I'm going to recompile the latest source and see what happens.

Edit: Exactly the same behaviour/backtrace after recompiling.

Hoglet commented 7 years ago

It seems to be several issues for you

1. A dbus connection error 2. Failure to get workspace layout (get_cardinal failed) *3. Segfault at exit

Number 3 is actually a known issue that I simply have been ignoring. When I was investigating it I did not get further than to the gtkmm lib and I suspect that this is inside it and therefore outside of scope for me.

Number 1 seems to be a failure to to connect through dbus. As timeit itself is not using dbus it must be one of the libraries that is getting data through it.

I have made a fresh install of Ubuntu 17.04 in a virtual box and compiled the latest version of timeit in it. When running it I do not get the number 3 fault but not the two other.

Question: Do you run something else than Xorg, like wayland or mir?

hackel commented 7 years ago

No, I'm still running Xorg, with GNOME shell. dbus is definitely working in general. I'm just not sure where it's getting that /tmp socket from (which doesn't exist). It should be using: DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus' But since TimeIT isn't using dbus, I guess there's nothing you can/should do about it.

The 3rd issue isn't particularly important, I just mentioned it in case it was relevant.

When I have time I'll try to play around a bit in a VM and see if I can replicate it. Thanks for looking into this!

Hoglet commented 5 years ago

gnome-shell does not set some "Extended Window Manager Hints", in this case DESKTOP_LAYOUT. TimeIT tries to read it with failure as a result.