GNOME Bugzilla – Bug 709716
gdk_x11_screen_lookup_visual segfault on multiple X protocol screens setup
Last modified: 2013-11-26 00:39:51 UTC
I am using a multiple X protocol screens setup, as I use 2 video cards with 4 monitors. Xinerama and xrandr both buggy on this setup, therefore I have no choice. As an archlinux user, I upgraded to gtk3 3.10 recently. All gtk3 applications that have an inputbox focused segfault with this kind error: (gnome-system-monitor:7051): Gdk-CRITICAL **: gdk_x11_screen_lookup_visual: assertion 'GDK_IS_SCREEN (screen)' failed [1] 7051 segmentation fault (core dumped) gnome-system-monitor Even Gimp will cause this behavior, which I thought have multiple X screens support.
Thanks for taking the time to report this bug. Without a stack trace from the crash it's very hard to determine what caused it. Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Of course. I rebuild the gtk3 from ABS of Archlinux to get symbol table, then I got a stack trace when running gtk3-demo like this: (gtk3-demo:9732): Gdk-CRITICAL **: gdk_x11_screen_lookup_visual: assertion 'GDK_IS_SCREEN (screen)' failed Program received signal SIGSEGV, Segmentation fault. 0x00007ffff742a4ee in gdk_x11_window_foreign_new_for_display () from /usr/lib/libgdk-3.so.0 (gdb) thread apply all bt
+ Trace 232595
Thread 1 (Thread 0x7ffff7f7d8c0 (LWP 9732))
About how I reproduce this bug, If I start the gtk application on my primary screen(DISPLAY=:0.0), everything is normal. If I start the gtk application on other screen(DISPLAY=:0.{1,2,3}), the application will run normally until I leave the textbox focused and select some text (on the same window or other windows). What else should I provide? I am glad to help you dight with this bug.
I can reproduce this bug as well, with similar condition. I most often see it when selecting text on any screen other than the crashing application. I have captured a crash backtrace with gdb (while running gtk3-demo, many other programs are affected): (gtk3-demo:24858): Gdk-CRITICAL **: gdk_x11_screen_lookup_visual: assertion 'GDK_IS_SCREEN (screen)' failed Program received signal SIGSEGV, Segmentation fault. gdk_x11_window_foreign_new_for_display (display=display@entry=0x732090, window=71472706) at gdkwindow-x11.c:1239 1239 impl->window_scale = GDK_X11_SCREEN (screen)->window_scale; (gdb) bt
+ Trace 232829
Seems to come down to 47a8c2f73302c88f8ef6daa08d3de625c18923d4, more specifically the changes to _gdk_x11_display_screen_for_xrootwin
I saw this issue have been marked as fixed. First of all thank you for your fast fixing. I tried to apply the commit 1d2a070254a2f01de3202392a8fdb43fc2ee84d2 manually to the source tree of 3.10.4 (which archlinux is using now), and the applications including gtk3-demo still crash. I get this trace: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff74592d0 in gdk_property_change () from /usr/lib/libgdk-3.so.0 (gdb) thread apply all bt
+ Trace 232831
Thread 1 (Thread 0x7ffff7f8a8c0 (LWP 15540))
I don't know whether it is appropriate, but I suspect that the bug is still in somewhere. Thank you for your attention.
I too backported the patch into openSUSE's gtk3 3.10.2 RPM and I can no longer reproduce the problem. The patch appears to have fixed the problem for me, so I suspect there are actually two separate bugs here.
From the trace it looks like it could happen when you copy from one screen and paste to the other screen. If so, could you open a new bug for that?
I can reproduce the bug by exactly the same steps as previous. I run gtk3-demo in gdb on some screen(:0.2), selected some text in the "Info" text area, then gtk3-demo crashed. I didn't copy text from one screen to another, although the x11 selection could changed. With gtk3-demo --gdk-debug=all enabled, I can get these messages before crash: Gdk-Message: focus out: window: 75497558, detail: NotifyAncestor, mode: NotifyNormal Gdk-Message: property notify: window: 75497558, atom(337): "_NET_WM_USER_TIME" (gtk3-demo:26283): Gtk-CRITICAL **: gtk_tree_view_get_path_at_pos: assertion 'tree_view != NULL' failed 18: interval=266.7 (sleep) layout_start=0.0 paint_start=0.2 frame_end=23.9 predicted=25.0 19: interval=24.2 paint_start=0.0 frame_end=52.9 predicted=16.7 20: interval=53.1 paint_start=0.0 frame_end=62.6 predicted=16.7 Gdk-Message: selection request: window: 75498744 Program received signal SIGSEGV, Segmentation fault. 0x00007ffff74592d0 in gdk_property_change () from /usr/lib/libgdk-3.so.0 (gdb) bt
+ Trace 232832
Should I open another bug report in this circumstance?
I suppose you're running a clipboard manager or something like that? And yes, please open a new bug.
Turned out that it was my input method engine (fcitx) listening to the clipboard events. After I stopped fcitx, gtk3-demo no longer crashes. Thank you. I will open another bug.