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 571830 - g_main_context_iterate blocks forever
g_main_context_iterate blocks forever
Status: RESOLVED INVALID
Product: glib
Classification: Platform
Component: mainloop
2.19.x
Other Linux
: Normal major
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-02-15 13:55 UTC by Marc Maurer
Modified: 2009-02-15 16:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marc Maurer 2009-02-15 13:55:08 UTC
For some reason which I totally don't understand, I can't start AbiWord these days anymore, with glib blocking immediately on startup in g_main_context_iterate. No relevant AbiWord code has been touched in this area, making me believe that a glib update is the problem. I've tested with glib 2.18.4 and 2.19.6.

Backtrace below, any pointers towards resolving this issue would be helpful.

DEBUG: End _draw
DEBUG: Scroll Adjustment set to 0 
DEBUG: End _draw
DEBUG: Scroll Adjustment set to 0 
^C
Program received signal SIGINT, Interrupt.
pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
261             movl    (%rsp), %edi
Current language:  auto; currently asm
Missing separate debuginfos, use: debuginfo-install libtdb-1.1.2-25.fc11.x86_64
(gdb) bt
  • #0 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S line 261
  • #1 IA__g_main_context_wait
    at gmain.c line 2011
  • #2 g_main_context_iterate
    at gmain.c line 2403
  • #3 IA__g_main_loop_run
    at gmain.c line 2656
  • #4 IA__gtk_main
    at gtkmain.c line 1205
  • #5 AP_UnixApp::main
    at ap_UnixApp.cpp line 1207
  • #6 __libc_start_main
    at libc-start.c line 220
  • #7 _start

Comment 1 Marc Maurer 2009-02-15 15:34:55 UTC
Not calling g_thread_init fixes the issue. However in practice that kinda sucks, as we need thread support for several plugins (AbiWord's core is non-threaded).
Comment 2 Matthias Clasen 2009-02-15 15:49:16 UTC
No immediate idea, it works fine here.

Did you say it works with 2.18.4, but not with 2.19.6 ?
In that case, could you try to narrow it down ?  
(I know svn is not exactly convenient like git for bisection, but as I said, it works here, so I can't really do this myself...)
Comment 3 Marc Maurer 2009-02-15 16:19:54 UTC
I *think* it worked in 2.18.3, and the update in F10 to 2.18.4 broke it. It's broken in F11's 2.19.6 as well.

When I find some time I'll try to bisect it.
Comment 4 Marc Maurer 2009-02-15 16:37:26 UTC
OK, this was broken in AbiWord since forever: g_thread_init() could be called after other glib functions had been called. No clue what suddenly caused it to misbehave, but we were wrong all along.

Sorry for the noise.