OK, I know it's bad netiquette to answer your own emails, but I've narrowed
the problem down:

  It so happens that the race condition problem I described (which, BTW,
also affects placement of the tooltip window), does not occur on desktops
1-4, but only on 5-6. This is with fvwm (http://fvwm.org) as window manager.

  So my current hypothesis is that gtk might be using some incorrect
parameters in the call to XGetWindowProperty(), or else fvwm might be
setting some incorrect parameters or both of them might be racing each
other on a common property set in the Xserver.

  Any other hypothesis?

2013/2/12 Edscott Wilson <edscott.wilson.gar...@gmail.com>

>
> I'm battling with a race condition for several week now, and have not been
> able to determine anything incorrect in my development code (http:/
> xffm.org). The situation is as follows: If I compile with gtk+2,
> everything is fine. Compilation with gtk+3 produces a race condition on
> mapping the popup menu. The symptoms is that the popup menu acts a little
> crazy. This condition *only* occurs on my test box with centrino-duo
> processor, and never on my quad-core box (which indicates a probable race
> condition). Condition does not always occur, either. The difference
> gtk+2/gtk+3 is the following (gtk+2.24/gtk+-3.4.4):
>
>
> #if GTK_MAJOR_VERSION<3
>     gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 3, event->time);
> #else
>     GdkDeviceManager *gdm =
>         gdk_display_get_device_manager (gdk_display_get_default());
>     gtk_menu_popup_for_device (menu,
>         gdk_device_manager_get_client_pointer(gdm), // GdkDevice *device,
>         NULL, NULL, NULL, NULL,
>         NULL,  //GDestroyNotify destroy,
>         3, event->time);
> #endif
>
> Would the way I'm calling gtk_menu_popup_for_device be causing the
> problem, or could it be a gtk+3 bug to be reported?
>
> Further details on the problem with Valgrind reveal:
>
> ==13595== Invalid read of size 4
> ==13595==    at 0x465DF9C: gdk_x11_screen_get_monitor_workarea (in
> /usr/lib/libgdk-3.so.0.400.4)
> ==13595==    by 0x4635B1A: gdk_screen_get_monitor_workarea (in
> /usr/lib/libgdk-3.so.0.400.4)
> ==13595==    by 0x438B103: gtk_menu_get_preferred_height_for_width (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x43879C3: gtk_menu_get_preferred_height (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x44016B3: compute_size_for_orientation (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x44D914D: gtk_window_get_preferred_height (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x44016B3: compute_size_for_orientation (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x4401ED5: gtk_widget_get_preferred_size (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x438EAEE: gtk_menu_popup_for_device (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x4093AC2: rodent_pop_menu (rodent_popup.c:129)
> ==13595==    by 0x409B315: rodent_signal_on_button_press
> (rodent_mouse.i:875)
> ==13595==    by 0x437E51E: _gtk_marshal_BOOLEAN__BOXEDv (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==  Address 0x1b7d6650 is 15 bytes after a block of size 65 alloc'd
> ==13595==    at 0x4029548: malloc (vg_replace_malloc.c:263)
> ==13595==    by 0x40F08D0: XGetWindowProperty (in /usr/lib/libX11.so.6.3.0)
> ==13595==    by 0x465DE84: gdk_x11_screen_get_monitor_workarea (in
> /usr/lib/libgdk-3.so.0.400.4)
> ==13595==    by 0x4635B1A: gdk_screen_get_monitor_workarea (in
> /usr/lib/libgdk-3.so.0.400.4)
> ==13595==    by 0x438B103: gtk_menu_get_preferred_height_for_width (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x43879C3: gtk_menu_get_preferred_height (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x44016B3: compute_size_for_orientation (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x44D914D: gtk_window_get_preferred_height (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x44016B3: compute_size_for_orientation (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x4401ED5: gtk_widget_get_preferred_size (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x438EAEE: gtk_menu_popup_for_device (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x4093AC2: rodent_pop_menu (rodent_popup.c:129)
> ==13595== Invalid read of size 4
> ==13595==    at 0x465DF99: gdk_x11_screen_get_monitor_workarea (in
> /usr/lib/libgdk-3.so.0.400.4)
> ==13595==    by 0x4635B1A: gdk_screen_get_monitor_workarea (in
> /usr/lib/libgdk-3.so.0.400.4)
> ==13595==    by 0x4392D3F: gtk_menu_item_position_menu (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x4387D3E: gtk_menu_position (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x438E913: gtk_menu_popup_for_device (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x438EE59: gtk_menu_popup (in /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x4392B6D: gtk_menu_item_real_popup_submenu (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x4392C3B: gtk_menu_item_popup_timeout (in
> /usr/lib/libgtk-3.so.0.400.4)
> ==13595==    by 0x462582C: gdk_threads_dispatch (in
> /usr/lib/libgdk-3.so.0.400.4)
> ==13595==    by 0x499C47B: ??? (in /usr/lib/libglib-2.0.so.0.3200.4)
> ==13595==    by 0x499B772: g_main_context_dispatch (in
> /usr/lib/libglib-2.0.so.0.3200.4)
> ==13595==    by 0x499BB07: ??? (in /usr/lib/libglib-2.0.so.0.3200.4)
> ==13595==  Address 0x7cbe63c is not stack'd, malloc'd or (recently) free'd
>
> Which points to a problem with XGetWindowProperty(). AFAICT, the value
> returned by XGetWindowProperty() is getting screwed up by some other
> thread, or, being an asynchronous Xlib instruction, may be out of sync.
>
> Any ideas?
>
> Further information on problem box:
>
> model name      : Intel(R) Core(TM)2 CPU         T5600  @ 1.83GHz
> cpu MHz         : 1833.000
> cache size      : 2048 KB
> flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
> cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm
> constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx
> est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm tpr_shadow
>
> uname -a:
> Linux areli 3.4.11-tuxonice #4 SMP Sun Dec 16 13:06:43 CST 2012 i686
> Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz GenuineIntel GNU/Linux
>
>
>
>
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to