GnuCash
Contact   Instructions
Bug 797684 - GTK_DEBUG=interactive - Bail out - gdk_window_set_cursor_internal
Summary: GTK_DEBUG=interactive - Bail out - gdk_window_set_cursor_internal
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: General (show other bugs)
Version: 3.9
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: general
QA Contact: general
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-15 01:44 EDT by nroycea+gnucash
Modified: 2020-04-15 17:40 EDT (History)
3 users (show)

See Also:


Attachments

Description nroycea+gnucash 2020-04-15 01:44:33 EDT
*****
$ GTK_DEBUG=interactive /usr/bin/gnucash %f
Traceback (most recent call last):
  File "/usr/share/gnucash/python/init.py", line 5, in <module>
    from gi import require_version
ImportError: cannot import name 'require_version' from 'gi' (unknown location)
Found Finance::Quote version 1.49.
**
Gdk:ERROR:../gtk/gdk/gdkwindow.c:6530:gdk_window_set_cursor_internal: assertion failed: (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor))
Bail out! Gdk:ERROR:../gtk/gdk/gdkwindow.c:6530:gdk_window_set_cursor_internal: assertion failed: (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor))
Aborted (core dumped)
*****

I was going to update bug 797535 because it was "looking" like it may be working right now.

HOWEVER, I encountered obstacles...
The first was the colors of the mortgage/loan repayment window made it nearly(?) unusable (primarily the left "step"-side).
It was just solid white at the start. When I clicked next, then the next step was highlighted enough to know what step I was on.
When I got to the bugged step from the previous bug, it was showing correctly now (instead of looking something like " :: :" (or whatever it was)).

But instead of going through with it all the way (to see if it seg-faults), I wanted to get the colors right first (using Breeze in Arch).

I looked in my gtk-3.0.css that I edited from the last update that messed up my colors, but didn't see anything standing out for that "step"-side part of repayment.
I tried editing some things, but no changes affected that part.

THAT is when I gave "GTK_DEBUG=interactive" a try, thinking it would tell me what css styles I need to change.
And that is what caused the above crash. Apparently a crash so bad, that it is unable to complete the coredump (I am not the one aborting it).
Comment 1 John Ralls 2020-04-15 11:32:40 EDT
You're misreading it. It's not an aborted core dump, the program aborted due to an assertion failure in Gdk and dumped core--except that it probably didn't because that's generally disabled by default.

We'll need to know where the offending gdk_window_get_display() call came from to diagnose the problem further, so please use the debugger to get a stack trace of the crash, instructions at https://wiki.gnucash.org/wiki/Stack_Trace.
Comment 2 nroycea+gnucash 2020-04-15 15:44:29 EDT
Yes, you are mostly correct (at least about me misreading). But the crash IS in the middle of getting dumped.
I am able to see it happening using "iotop" (ran it to see why my system was getting bogged down), as well as the journal finally registering:
*****
systemd[1]: systemd-coredump@1-208778-0.service: Service reached runtime time limit. Stopping.
*****

The stack trace link looks a bit out of date for enabling debug, but I did see https://wiki.gnucash.org/wiki/Gnucash_Build_Options, though I also had to install gtest and gmock.

I got the GDB backtrace/stacktrace output though:
*****
$ GTK_DEBUG=interactive gdb ./bin/gnucash
(gdb) run
Starting program: /<pathTo>/gc/gnucash-3.9/bin/gnucash 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffea6fd700 (LWP 371078)]
[New Thread 0x7fffe3fff700 (LWP 371079)]
[New Thread 0x7fffe9efc700 (LWP 371080)]
[New Thread 0x7fffe96fb700 (LWP 371081)]
[New Thread 0x7fffe305c700 (LWP 371088)]
[New Thread 0x7fffe285b700 (LWP 371089)]
[New Thread 0x7fffe205a700 (LWP 371090)]
[New Thread 0x7fffe1069700 (LWP 371091)]
[New Thread 0x7fffb3f03700 (LWP 371092)]
[New Thread 0x7fffb3702700 (LWP 371093)]
[New Thread 0x7fffb2f01700 (LWP 371094)]
[New Thread 0x7fffb2700700 (LWP 371095)]
[New Thread 0x7fffb1eff700 (LWP 371096)]
[New Thread 0x7fffb109b700 (LWP 371097)]
[New Thread 0x7fffa3fff700 (LWP 371100)]
libmariadb.so.3: cannot open shared object file: No such file or directory
libdbi: Failed to load driver: /usr/lib/dbd/libdbdmysql.so
[Thread 0x7fffb3f03700 (LWP 371092) exited]
Traceback (most recent call last):
  File "/usr/share/gnucash/python/init.py", line 5, in <module>
    from gi import require_version
ImportError: cannot import name 'require_version' from 'gi' (unknown location)
[Detaching after fork from child process 371103]
Found Finance::Quote version 1.49.
**
Gdk:ERROR:../gtk/gdk/gdkwindow.c:6530:gdk_window_set_cursor_internal: assertion failed: (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor))
Bail out! Gdk:ERROR:../gtk/gdk/gdkwindow.c:6530:gdk_window_set_cursor_internal: assertion failed: (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor))

Thread 1 "gnucash" received signal SIGABRT, Aborted.
0x00007fffef32fce5 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007fffef32fce5 in raise () at /usr/lib/libc.so.6
#1  0x00007fffef319857 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff7b8d062 in  () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff7bba51d in g_assertion_message_expr () at /usr/lib/libglib-2.0.so.0
#4  0x00007fffefab69be in  () at /usr/lib/libgdk-3.so.0
#5  0x00007fffefab6c3c in gdk_window_set_cursor () at /usr/lib/libgdk-3.so.0
#6  0x00007ffff2ceb515 in gnc_ui_set_cursor (win=0x55555709a030, type=GNC_CURSOR_BUSY, update_now=1) at /<pathTo>/gc/gnucash-3.9/gnucash/gnome-utils/cursors.c:55
#7  0x00007ffff2ceb644 in gnc_set_busy_cursor (w=0x555555b484a0, update_now=1) at /<pathTo>/gc/gnucash-3.9/gnucash/gnome-utils/cursors.c:94
#8  0x00007ffff2d32092 in gnc_post_file_open (parent=0x555555a114f0, filename=0x555556c2f7c0 "/<pathTo>/gnucash.xml.gnucash", is_readonly=0) at /<pathTo>/gc/gnucash-3.9/gnucash/gnome-utils/gnc-file.c:723
#9  0x00007ffff2d32c3e in gnc_file_open_file (parent=0x555555a114f0, newfile=0x555556c2f7c0 "/<pathTo>/gnucash.xml.gnucash", open_readonly=0) at /<pathTo>/gc/gnucash-3.9/gnucash/gnome-utils/gnc-file.c:1088
#10 0x000055555555af47 in inner_main (closure=0x0, argc=1, argv=0x7fffffffe648) at /<pathTo>/gc/gnucash-3.9/gnucash/gnucash-bin.c:651
#11 0x00007ffff7d681be in  () at /usr/lib/libguile-2.2.so.1
#12 0x00007ffff7d48b1a in  () at /usr/lib/libguile-2.2.so.1
#13 0x00007ffff7dcdc80 in  () at /usr/lib/libguile-2.2.so.1
#14 0x00007ffff7dd3711 in scm_call_n () at /usr/lib/libguile-2.2.so.1
#15 0x00007ffff7dc1a24 in  () at /usr/lib/libguile-2.2.so.1
#16 0x00007ffff7d49147 in  () at /usr/lib/libguile-2.2.so.1
#17 0x00007ffff7d49226 in scm_c_with_continuation_barrier () at /usr/lib/libguile-2.2.so.1
#18 0x00007ffff7dc042f in  () at /usr/lib/libguile-2.2.so.1
#19 0x00007ffff7ca9377 in GC_call_with_stack_base () at /usr/lib/libgc.so.1
#20 0x00007ffff7dc0829 in scm_with_guile () at /usr/lib/libguile-2.2.so.1
#21 0x00007ffff7d683b4 in scm_boot_guile () at /usr/lib/libguile-2.2.so.1
#22 0x000055555555b4fa in main (argc=1, argv=0x7fffffffe648) at /<pathTo>/gc/gnucash-3.9/gnucash/gnucash-bin.c:934
*****
Comment 3 John Ralls 2020-04-15 16:53:54 EDT
> Service reached runtime time limit. Stopping.
That would be either a bug or a configuration problem with systemd.

Thanks for noticing about the debug flag, it was for the old build system. I've updated it.

Since you can build yourself, how about trying a fix?

At gnucash/gnome-utils/cursors.c line 53, change gdk_display_get_default() to gdk_window_get_display(win).

Rebuild and see if it still crashes or at least crashes somewhere else.
Comment 4 nroycea+gnucash 2020-04-15 17:28:24 EDT
Yup, that fixed that issue.

Using the GTK inspector:
*****
$ gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true
$ GTK_DEBUG=interactive gnucash
*****
Then opening the loan/mortgage payment scheduler and pressing CTRL+SHIFT+I and pressing in that side area, I found the CSS field and added the value:
*****
.sidebar {
    background-color: black;
}
*****

Then I went through the scheduler and that succeeded (sort of). I'll update the other bug.

I'll leave it to you to close this issue after that fix of yours is applied.
Comment 5 John Ralls 2020-04-15 17:40:21 EDT
Done, thanks for the report.

Note You need to log in before you can comment on or make changes to this bug.