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 662630 - eog fails to launch and hangs.
eog fails to launch and hangs.
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
3.2.x
Other Linux
: High blocker
: GNOME3.4
Assigned To: EOG Maintainers
EOG Maintainers
: 663043 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-10-24 17:19 UTC by texstar
Modified: 2011-11-09 21:26 UTC
See Also:
GNOME target: ---
GNOME version: 3.3/3.4


Attachments
Don't lock GDK around g_application_run() (1.10 KB, patch)
2011-11-02 14:10 UTC, Allison Karlitskaya (desrt)
none Details | Review

Description texstar 2011-10-24 17:19:50 UTC
eog 3.2.1 compiled against glib2-2.31.0 on 64bit fails to launch. eog compiled against glib2-2.30.1 works as intended.
Comment 1 Felix Riemann 2011-10-24 19:21:47 UTC
Alright, just tried it and it's true. I guess I'll postpone the 3.3.1 release then, as it makes no sense that way.

This is probably due to GtkApplication not running the Gtk mainloop anymore due to changes in GApplication (we seem to have a locking issue with GdkThreads now).
Comment 2 Allison Karlitskaya (desrt) 2011-10-26 20:48:21 UTC
ouch this sucks.

I didn't realise that it would be necessary to enter the gdk threads before g_application_run() in order to avoid problems with gtk_main().

Ideally, that would not be required, and the obvious eog fix would be to drop the thread enter call.

I'm not sure I like what that says about compatibility with older versions, though...
Comment 3 Allison Karlitskaya (desrt) 2011-10-26 20:50:43 UTC
Another way to fix this could be to make the gdkthreads mutex recursive.
Comment 4 Allison Karlitskaya (desrt) 2011-10-26 21:27:39 UTC
(In reply to comment #3)
> Another way to fix this could be to make the gdkthreads mutex recursive.

this wouldn't work at all, you fool!
Comment 5 Felix Riemann 2011-10-30 15:05:16 UTC
*** Bug 663043 has been marked as a duplicate of this bug. ***
Comment 6 Allison Karlitskaya (desrt) 2011-10-31 13:29:07 UTC
I think the best solution at this point is to change the eog code.

I really consider this to be an unintended effect of the API -- it was never meant to interact with GdkThreads in this way.

Trying to fix it in glib or gtk would necessarily introduce some ugly hacks...
Comment 7 Felix Riemann 2011-11-02 13:21:22 UTC
(In reply to comment #6)
> I think the best solution at this point is to change the eog code.

I'm not exactly sure how to do that without making big changes to make sure that calls to GDK won't happen outside of the default mainloop.

GdkThreads is slightly mind-bending to me at the moment.

> I really consider this to be an unintended effect of the API -- it was never
> meant to interact with GdkThreads in this way.

You mean using G(tk)Application together with GdkThreads?

> Trying to fix it in glib or gtk would necessarily introduce some ugly hacks...

Wouldn't it be more safe to fix the original problem in Gtk+ and allow executing the Gtk mainloop? AFAIR GdkThreads-handling isn't the only thing the gtk mainloop does different than the normal glib mainloop.
Comment 8 Allison Karlitskaya (desrt) 2011-11-02 13:41:30 UTC
The only difference between gtk_main() and what GApplication does now is that gtk_main does this (copy/pasting):


  if (g_main_loop_is_running (main_loops->data))
    {
      GDK_THREADS_LEAVE ();
      g_main_loop_run (loop);
      GDK_THREADS_ENTER ();
      gdk_flush ();
    }


so you could fix the issue in eog main() by simply dropping the two gdkthreads calls.

As for dispatches, the difference only happens if you do gdk_threads_add_timeout() and so on -- and that will still continue to work, even with the changes.
Comment 9 Allison Karlitskaya (desrt) 2011-11-02 14:10:23 UTC
Created attachment 200513 [details] [review]
Don't lock GDK around g_application_run()

An unintended interaction between GtkApplication and GDK threading made
this necessary before.  That code has since been simplified, breaking
this formerly-working code.
Comment 10 Felix Riemann 2011-11-02 22:18:18 UTC
Hmm, I thought that the removal of these lock calls would only qualify as a diagnostic/workaround. Thanks, for clarification. :)

commit ee4f6b27027421ee1e7cb14948f587da83171668
Author: Ryan Lortie <>
Date:   Wed Nov 2 10:08:14 2011 -0400

    Don't lock GDK around g_application_run()
    
    An unintended interaction between GtkApplication and GDK threading made
    this necessary before.  That code has since been simplified, breaking
    this formerly-working code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662630

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 11 Rico Tzschichholz 2011-11-08 14:12:16 UTC
@Felix: Would you consider applying this patch to the gnome-3-2 branch too?
Comment 12 Felix Riemann 2011-11-09 16:06:59 UTC
(In reply to comment #11)
> @Felix: Would you consider applying this patch to the gnome-3-2 branch too?

Well, I didn't have any plans for that as 3.2.x is supposed to run with glib-2.30 which requires the lines removed by the patch.

Do you have any specific reasons for having it?
Comment 13 Rico Tzschichholz 2011-11-09 19:14:54 UTC
Oh, I am wrong then. I thought this can be dropped nevertheless and wouldn't have greater effects running with glib 2.30.

Running eog 3.0.2 (built with glib 2.28) runs with glib 2.31+ though which made me think this is some kind of regression.
Comment 14 Felix Riemann 2011-11-09 21:26:02 UTC
(In reply to comment #13)
> Oh, I am wrong then. I thought this can be dropped nevertheless and wouldn't
> have greater effects running with glib 2.30.
> 
> Running eog 3.0.2 (built with glib 2.28) runs with glib 2.31+ though which made
> me think this is some kind of regression.

Ah yes, 3.0.x is not affected by this problem because eog only moved to G(tk)Application with version 3.1.2. Beforehand eog had it's own code to handle application uniqueness and had to execute the Gtk mainloop itself.