After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 423057 - Multi-threaded hangs with window events
Multi-threaded hangs with window events
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: atkbridge
1.7.x
Other All
: Normal critical
: ---
Assigned To: Li Yuan
Li Yuan
Depends on:
Blocks:
 
 
Reported: 2007-03-26 20:01 UTC by Francis Kung
Modified: 2008-01-28 05:34 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Testcase for window hiding hang (3.60 KB, text/plain)
2007-03-26 20:04 UTC, Francis Kung
Details
Testcase for window focus hang (1.73 KB, text/plain)
2007-03-26 20:07 UTC, Francis Kung
Details

Description Francis Kung 2007-03-26 20:01:52 UTC
Steps to reproduce:
1. Enable accessibility (export GTK_MODULES="gail:atk-bridge")
2. Run a program that makes GTK calls from multiple threads
3. Call gtk_widget_hide(), not from the GTK main thread
(see attached testcase)

Stack trace:

Thread 2 (Thread -1211327600 (LWP 24835))

  • #0 __kernel_vsyscall
  • #1 pthread_cond_wait
    from /lib/libpthread.so.0
  • #2 giop_recv_buffer_get
    at giop-recv-buffer.c line 708
  • #3 ORBit_small_invoke_stub
    at orbit-small.c line 657
  • #4 ORBit_small_invoke_stub_n
    at orbit-small.c line 575
  • #5 ORBit_c_stub_invoke
    at poa.c line 2643
  • #6 Accessibility_EventListener_notifyEvent
    at Accessibility-stubs.c line 321
  • #7 spi_atk_emit_eventv
    at bridge.c line 678
  • #8 spi_atk_bridge_window_event_listener
    at bridge.c line 1124
  • #9 g_signal_chain_from_overridden
    from /lib/libgobject-2.0.so.0
  • #10 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #11 g_signal_emit
    from /lib/libgobject-2.0.so.0
  • #12 gail_util_get_type
    from /usr/lib/gtk-2.0/modules/libgail.so
  • #13 g_cclosure_marshal_VOID__UINT_POINTER
    from /lib/libgobject-2.0.so.0
  • #14 g_closure_invoke
    from /lib/libgobject-2.0.so.0
  • #15 g_signal_chain_from_overridden
    from /lib/libgobject-2.0.so.0
  • #16 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #17 g_signal_emit_by_name
    from /lib/libgobject-2.0.so.0
  • #18 gail_toplevel_new
    from /usr/lib/gtk-2.0/modules/libgail.so
  • #19 gail_toplevel_new
    from /usr/lib/gtk-2.0/modules/libgail.so
  • #20 g_signal_chain_from_overridden
    from /lib/libgobject-2.0.so.0
  • #21 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #22 g_signal_emit
    from /lib/libgobject-2.0.so.0
  • #23 IA__gtk_widget_hide
    at gtkwidget.c line 2308
  • #24 hide_window
    at hello.c line 21
  • #25 start_thread
    from /lib/libpthread.so.0
  • #26 clone
    from /lib/libc.so.6


Other information:
I have noticed two problems both relating to hangs on multi-threaded window events:

- if gtk_widget_hide() is called on a window, but not from the gtk main thread (ie not in a callback), it will cause a hang.

- if gtk_init() and gtk_main() are called from two different threads, then the window losing focus will cause a hang.

I'll attach a testcases showing these two situations.  The stacktrace above is for the former (hang on closing window), but they are very similar.

This issue affects all graphical applications using GNU Classpath under Gnome.
Comment 1 Francis Kung 2007-03-26 20:04:16 UTC
Created attachment 85334 [details]
Testcase for window hiding hang

Clicking the button should cause a few lines to be printed to console, then the window closing an application exiting (this happens with accessibility off).  With accessibility on, the application hangs after the button is pressed.
Comment 2 Francis Kung 2007-03-26 20:07:22 UTC
Created attachment 85335 [details]
Testcase for window focus hang

Simple hello world application (modified from the GTK tutorial); however with accessibility enabled, once the window loses focus it hangs and will not redraw or respond.  It hangs in the same place as the last testcase.  Note gtk_init() and gtk_main() are called from different threads (there is no documentation I'm aware of that says this is not allowed, and it works with accessibility turned off).
Comment 3 Harry Lu 2007-03-29 15:24:55 UTC
looks like bug #329454. Could you please try with latest atk, gail and at-spi?
Comment 4 Francis Kung 2007-03-29 20:11:37 UTC
With more recent versions (1.18.0) there's a warning that appears fairly frequently ("failure: no device event controller found") but no hangs.

Thanks, didn't realise the packages I was using were that outdated and only searched open bugs before filing this one.
Comment 5 Jack Deslippe 2008-01-28 05:33:17 UTC
Here is the output (no more information - is there a way to tell it to be verbose??)

[jdeslip@jdeslippe ~]$ gramps
LPRDoc: Free true type fonts not found.
        Microsoft true type fonts not found.
        Using Gnome standard fonts.
        Non-ascii characters will appear garbled in the output.
        INSTALL Free true type fonts
        from http://www.nongnu.org/freefont/
[jdeslip@jdeslippe ~]$ gramps Test1.grdb 
LPRDoc: Free true type fonts not found.
        Microsoft true type fonts not found.
        Using Gnome standard fonts.
        Non-ascii characters will appear garbled in the output.
        INSTALL Free true type fonts
        from http://www.nongnu.org/freefont/
Trying to open: Test1.grdb ...
Type: GRAMPS database
Opened successfully!

(gramps.py:11846): atk-bridge-WARNING **: failure: no device event controller found.


(gramps.py:11846): atk-bridge-WARNING **: failure: no device event controller found.


(gramps.py:11846): atk-bridge-WARNING **: failure: no device event controller found.


(gramps.py:11846): atk-bridge-WARNING **: failure: no device event controller found.


(gramps.py:11846): atk-bridge-WARNING **: failure: no device event controller found.


(gramps.py:11846): atk-bridge-WARNING **: failure: no device event controller found.

Killed

-------------------

The atk-bridge warnings are nothing I think - they occur as I type each letter of the new childs name.  After the child is created and I  try to get back to the people list.  The program just hangs and uses up 100% of my cpu.  The "killed" occurs whenever I tell it to force quite.  

Let me know how I can produce more useful debugging info.
Comment 6 Jack Deslippe 2008-01-28 05:34:18 UTC
Oh crap.  I typed all that in the wrong bug... Sorry.  Please delete it.