Bug 294385 - glib2 busyloops, blocking Konqueror and Opera on flash sites
glib2 busyloops, blocking Konqueror and Opera on flash sites
Status: VERIFIED FIXED
: 296887 297519 305230 306414 (view as bug list)
Classification: openSUSE
Product: openSUSE 10.3
Classification: openSUSE
Component: GNOME
Beta 2
x86-64 Other
: P5 - None : Blocker (vote)
: ---
Assigned To: Federico Mena Quintero
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-25 05:33 UTC by Silviu Marin-Caea
Modified: 2007-09-10 20:04 UTC (History)
14 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Silviu Marin-Caea 2007-07-25 05:33:44 UTC
This happens after latest factory update.  I didn't observe it with alpha6.

rpm -q flash-player kdelibs3 kdebase3
flash-player-9.0.48.0-3
kdelibs3-3.5.7-32
kdebase3-3.5.7-33


top - 08:31:57 up 15:36,  3 users,  load average: 1.18, 1.06, 1.02
Tasks: 110 total,   4 running, 106 sleeping,   0 stopped,   0 zombie
Cpu(s): 50.2%us,  0.2%sy,  0.0%ni, 49.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1027300k total,   847116k used,   180184k free,    50468k buffers
Swap:   393584k total,        0k used,   393584k free,   567724k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 5895 silviu_m  25   0 66884  13m  11m R  100  1.4 505:58.82 nspluginviewer
 6946 silviu_m  15   0 16688 1232  896 R    0  0.1   0:00.02 top
    1 root      18   0   808  320  256 S    0  0.0   0:01.76 init
    2 root      10  -5     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT  -5     0    0    0 S    0  0.0   0:00.01 migration/0
    4 root      34  19     0    0    0 S    0  0.0   0:00.01 ksoftirqd/0
    5 root      RT  -5     0    0    0 S    0  0.0   0:00.00 migration/1
    6 root      34  19     0    0    0 S    0  0.0   0:00.01 ksoftirqd/1
    7 root      10  -5     0    0    0 S    0  0.0   0:00.04 events/0
    8 root      10  -5     0    0    0 S    0  0.0   0:00.01 events/1
    9 root      11  -5     0    0    0 S    0  0.0   0:00.00 khelper
   30 root      10  -5     0    0    0 S    0  0.0   0:00.00 kblockd/0
   31 root      10  -5     0    0    0 S    0  0.0   0:00.01 kblockd/1
   32 root      17  -5     0    0    0 S    0  0.0   0:00.00 kacpid
   33 root      17  -5     0    0    0 S    0  0.0   0:00.00 kacpi_notify
  113 root      11  -5     0    0    0 S    0  0.0   0:00.00 cqueue/0
  114 root      12  -5     0    0    0 S    0  0.0   0:00.00 cqueue/1
  115 root      10  -5     0    0    0 S    0  0.0   0:00.00 kseriod
  145 root      16   0     0    0    0 S    0  0.0   0:00.00 pdflush
  146 root      15   0     0    0    0 S    0  0.0   0:00.32 pdflush
  147 root      11  -5     0    0    0 S    0  0.0   0:00.00 kswapd0
  148 root      11  -5     0    0    0 S    0  0.0   0:00.00 aio/0
  149 root      11  -5     0    0    0 S    0  0.0   0:00.00 aio/1
  383 root      11  -5     0    0    0 S    0  0.0   0:00.00 kpsmoused
  450 root      10  -5     0    0    0 S    0  0.0   0:00.06 ata/0
Comment 1 Stephan Kulow 2007-07-25 08:24:03 UTC
I have the same problem and all I could get from gdb was that it's in glib somewhere.
Comment 2 Dirk Mueller 2007-07-25 09:22:39 UTC
does it go away after downgrading to 9.0.31.0?
Comment 3 Dirk Mueller 2007-07-25 15:22:40 UTC
coolo: how do you reproduce the hang? it works fine here. 
Comment 4 Silviu Marin-Caea 2007-07-25 15:28:51 UTC
Opening a Flash heavy site in Konqueror triggers the hang on my machine.

http://www.eurogamer.net
Comment 5 Dirk Mueller 2007-07-25 15:38:08 UTC
thanks, not reproduceable here. 
Comment 6 Silviu Marin-Caea 2007-07-25 15:41:14 UTC
Going back to flash 9.0.31 from Alpha5 does not fix it.

BTW, Firefox does not have any problem with flash sites.

So it does not appear to be caused by the flash plugin itself.
Comment 7 Daniel Gollub 2007-07-27 14:10:35 UTC
I can reproduce this with http://www.vgn.de ...

Downgrade of flash-player to 9.0.31 didn't helped here either...

dani@g205:~> rpm -q kdebase3-nsplugin flash-player
flash-player-9.0.48.0-4
kdebase3-nsplugin-3.5.7-34
Comment 8 Stephan Kulow 2007-07-27 15:08:52 UTC
Rudi had the same. I wonder you can't see it
Comment 9 Ruediger Oertel 2007-07-30 23:49:50 UTC
backtrace:

warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4

IA__g_slist_find (list=0x80e3d00, data=0xf5a0598c) at gslist.c:378
378     }
(gdb) bt
#0  IA__g_slist_find (list=0x80e3d00, data=0xf5a0598c) at gslist.c:378
#1  0xf5a72943 in IA__g_once_init_enter_impl (value_location=0xf5a0598c) at gthread.c:214
#2  0xf598ee4f in IA__gdk_display_get_type () at /usr/include/glib-2.0/glib/gthread.h:338
#3  0xf59afffe in _gdk_display_x11_get_type () at gdkdisplay-x11.c:108
#4  0xf59b11fb in IA__gdk_display_open (display_name=0x0) at gdkdisplay-x11.c:157
#5  0xf598da0d in IA__gdk_display_open_default_libgtk_only () at gdk.c:288
#6  0xf5c7d02f in IA__gtk_init_check (argc=0x0, argv=0x0) at gtkmain.c:898
#7  0xf5c7d064 in IA__gtk_init (argc=0x0, argv=0x0) at gtkmain.c:933
#8  0xf5f30a35 in ?? () from /usr/lib/browser-plugins/libflashplayer.so
#9  0xf5f2b629 in ?? () from /usr/lib/browser-plugins/libflashplayer.so
#10 0xf5f2d4e4 in ?? () from /usr/lib/browser-plugins/libflashplayer.so
#11 0xfff8d388 in ?? ()
#12 0x080d78c8 in ?? ()
#13 0x00000001 in ?? ()
#14 0x0000000a in ?? ()
#15 0x080d9080 in ?? ()
#16 0x080d90b0 in ?? ()
#17 0x00000000 in ?? ()
Comment 10 Ruediger Oertel 2007-07-31 10:09:01 UTC
this is what I get on stdout from konqueror:

Flash Player: Warning: environment variable G_FILENAME_ENCODING is set and is not UTF-8

(process:19191): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function

(process:19191): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

(process:19191): Gtk-CRITICAL **: gtk_clipboard_get_for_display: assertion `GDK_IS_DISPLAY (display)' failed
Adobe FlashPlayer: gtk_clipboard_get(GDK_SELECTION_PRIMARY); failed. Trying to call gtk_init(0,0);
Comment 11 Stephan Kulow 2007-07-31 10:16:06 UTC
Federico, is there anything we can do? This seems to be a major regression
Comment 12 Federico Mena Quintero 2007-07-31 15:14:19 UTC
How weird.  The first warning ("initialization assertion failed...") happens if you don't call g_type_init(), but the stack trace shows that gtk_init() is being called --- which should be enough.

Can you please load the program under gdb, set a breakpoint in g_log(), and get a stack trace where the first warning happens?
Comment 13 Warren Stockton 2007-07-31 20:06:50 UTC
I have also seen this since on x86_64 on Alpha6 and all subsequent factory updates.

rpm -q --qf '%{n}-%{v}-%{r}.%{arch}\n' kdebase3 kdelibs3 kdebase3-nsplugin nspluginwrapper flash-player
kdebase3-3.5.7-37.x86_64
kdelibs3-3.5.7-36.x86_64
kdebase3-nsplugin-3.5.7-37.i586
nspluginwrapper-0.9.91.4-36.x86_64
flash-player-9.0.48.0-6.i586


Is the arch for nspluginwrapper correct?
Comment 14 Dirk Mueller 2007-08-01 13:00:18 UTC
do you guys have gtk2 2.11.6 installed? it works fine with gtk2 2.11.5 (alpha6, like the bugreport says). 

I guess this bugreport is post alpha6 then, right?

Comment 15 Stephan Kulow 2007-08-02 15:02:53 UTC
*** Bug 296887 has been marked as a duplicate of this bug. ***
Comment 16 Dirk Mueller 2007-08-02 15:12:22 UTC
Marcus: does it work for you when going back to gtk2 2.11.5 as well?
Comment 17 Marcus Meissner 2007-08-02 15:31:06 UTC
Yes, works fine when I use gtk2 2.11.5.
Comment 18 Dirk Mueller 2007-08-02 15:51:56 UTC
Thanks. Federico, could you look into the diff and see if there is a obvious bug?
Comment 19 Stephan Kulow 2007-08-02 19:36:28 UTC
21:14 < coolo> federico1: ping
21:15 < coolo> 214           while (g_slist_find (g_once_init_list, (void*) value_location))
21:15 < coolo> 215             g_cond_wait (g_once_cond, g_once_mutex);
21:15 < coolo> that loop is never exited
21:16 < coolo> IA__g_once_init_enter_impl (value_location=0xb5a8c98c) at gthread.c:214
21:18 < coolo> (gdb) print g_once_init_list->next->data
21:18 < coolo> $17 = (gpointer) 0xb5a8c98c
21:18 < coolo> so it's in the list and always returned
21:18 < coolo> and both g_once_cond and g_once_mutex are 0x0
Comment 20 Federico Mena Quintero 2007-08-02 19:38:00 UTC
Coolo says that visiting youtube.com in konqueror is enough to trigger this.
Comment 21 Ruediger Oertel 2007-08-02 22:25:51 UTC
I'd try to help with #12 but don't really know how.
I can only attach to gdb if the process is stuck already,
tried a wrapper around nspluginviewer, but that does not work.

how to attach to gdb early enough (before the log messages) ?
Comment 22 Ruediger Oertel 2007-08-02 22:58:18 UTC
played around a bit since I suspected it could as well be glib2 as well
as gtk2, but it's really gtk2.

glib2-32bit-2.13.5-3.x86_64.rpm,gtk2-32bit-2.11.5-3.x86_64.rpm works
(as on Alpha6)

glib2-32bit-2.13.7-5.x86_64.rpm,gtk2-32bit-2.11.5-3.x86_64.rpm works
(Alpha7 glib2, Alpha6 gtk2)

glib2-32bit-2.13.5-3.x86_64.rpm,gtk2-32bit-2.11.6-4.x86_64.rpm 
 (no flash, would probably need recompile of gtk with older glib)

glib2-32bit-2.13.7-5.x86_64.rpm,gtk2-32bit-2.11.6-4.x86_64.rpm hangs
(Alpha7 glib2, Alpha7 gtk2) this is the hang this bug is about.
Comment 23 Dirk Mueller 2007-08-02 23:11:46 UTC
the backtrace is:

#0  IA__g_log (log_domain=0xb5ac74fb "GLib-GObject", log_level=G_LOG_LEVEL_CRITICAL,
    format=0xb5acbd1c "%s: initialization assertion failed, use %s() prior to this function")
    at gmessages.c:516
#1  0xb5abd7de in IA__g_type_register_static (parent_type=80, type_name=0xb59b43f6 "GdkDisplay",
    info=0xbfba7b04, flags=0) at gtype.c:2242
#2  0xb5abdc99 in IA__g_type_register_static_simple (parent_type=80,
    type_name=0xb59b43f6 "GdkDisplay", class_size=88,
    class_init=0xb59623d0 <gdk_display_class_intern_init>, instance_size=80,
    instance_init=0xb5962580 <gdk_display_init>, flags=0) at gtype.c:2230
#3  0xb5961e9d in IA__gdk_display_get_type () at gdkdisplay.c:87
#4  0xb5d95e55 in IA__gtk_clipboard_get_for_display (display=0x0, selection=0x1)
    at gtkclipboard.c:290
#5  0xb5d95ef6 in IA__gtk_clipboard_get (selection=0x1) at gtkclipboard.c:315
#6  0xb5ee79ec in ?? () from /usr/lib/browser-plugins/libflashplayer.so


Comment 24 Ruediger Oertel 2007-08-03 12:28:03 UTC
wow, looks like the real change is caused by the glib2 update ...


I've got here a gtk2-32bit-2.11.6 installed that was built with
glib2-2.13.5 (using a rebuilt pango built with that same glib2).

running a combination between this gtk2-32bit-2.11.6 and the
current glib2 (glib2-32bit-2.13.7) I've got a working flashplayer.

So it looks like the new glib2 offers some features to gtk2
that cause the hang when really used.

for #22, the missing symbol in case3 (old glib2, new gtk2)
was libgdk-111-2.0.so.0: undefined symbol: g_once_init_enter_impl
which is interestingly in the backtrace mentioned above ...
Comment 25 Dirk Mueller 2007-08-06 19:42:58 UTC
g_once_init_enter_impl is also touched in bug 297636. does it work with that glib2?

Comment 26 Stephan Kulow 2007-08-07 09:08:59 UTC
*** Bug 297519 has been marked as a duplicate of this bug. ***
Comment 27 Will Stephenson 2007-08-09 11:56:43 UTC
Opera is also affected, I hear.
Comment 28 Federico Mena Quintero 2007-08-10 15:38:57 UTC
For reference, the upstream bug which introduced the patch in glib is http://bugzilla.gnome.org/show_bug.cgi?id=65041
Comment 29 Federico Mena Quintero 2007-08-10 16:06:39 UTC
(10:55:19 AM) mclasen: federico: are you compiling with -O3 ?
(10:55:55 AM) mclasen: it seems that gcc has started to move our const-annotated get_type functions wildly around
Comment 30 Dirk Mueller 2007-08-10 16:17:39 UTC
in case that was a question: no, we build with -O2. but I don't really get it, because if you annotate a function as const then that means that the compiler is allowed to move it out of hot code spots. if something breaks then thats not really a compiler issue. 

Comment 31 Marcus Meissner 2007-08-10 21:26:44 UTC
glib2 has some bugfixes in this area in STABLE already (from andreas schwab)

perhaps they help.
Comment 32 Stephan Kulow 2007-08-11 07:01:44 UTC
You're seeing ghosts? The only change from andreas is for #297636
Comment 33 Dimitri Rizek 2007-08-12 16:58:17 UTC
I just wanted to confirm that I have this problem too in A7. It seems that any flash sites at all will cause it to hang.

I also have the problem in the latest Kubuntu release, so it is not Suse specific. 
Comment 34 Dirk Mueller 2007-08-13 09:16:21 UTC
beta1 has it as well
Comment 35 Stephan Kulow 2007-08-14 09:19:37 UTC
Received this from timj:
  hi, i have found and fixed a race in g_once_init, and thus
  closed http://bugzilla.gnome.org/show_bug.cgi?id=65041.
  so please try again with recent SVN.

Comment 36 Dirk Mueller 2007-08-15 12:27:31 UTC
I don't think we can release 10.3 with this issue
Comment 37 Will Stephenson 2007-08-15 12:45:46 UTC
as dirk says, timj's race fix did not help.
Comment 38 Stephan Binner 2007-08-23 07:48:51 UTC
any news on this?
Comment 39 Bjoern Bendix 2007-08-23 17:23:35 UTC
This problem is not solved in beta 2
Comment 40 Sebastian Turzański 2007-08-23 17:44:16 UTC
it's very strange bug - I have opensuse 10.2 with most unofficial repos and updated frequently and I don't have this bug. But in SUse 10.1 I have this bug and can't get rid of it
Comment 41 Dirk Mueller 2007-08-24 10:08:47 UTC
don't hijack bugreports. this is solely about a 10.3 regression. for 10.1 file a new bugreport. 
Comment 42 Darren Clarke 2007-08-26 01:14:34 UTC
Flash is completely broken in Opera 9.23 on 10.3 beta 2. Everytime I try to access any flash based content (including the flash version check at http://www.adobe.com/shockwave/welcome/) I get 100% cpu usage by operapluginwrapper for about 5 seconds and then it terminates (opera is still running).
Comment 43 Will Stephenson 2007-08-26 08:54:09 UTC
Rename reflecting broader impact of bug
Comment 44 Benjamin Weber 2007-08-27 21:11:29 UTC
A mandriva guy has a hack that works around this problem for kde:

http://people.mandriva.com/~boiko/patches/kdebase-3.5.7-fix_flashplayer_nsplugin.patch
Comment 45 Federico Mena Quintero 2007-08-27 22:19:10 UTC
I finally got a KDE session set up on 10.3.  When I visit youtube with Konqueror, youtube tells me that I don't have Javascript enabled, or that I have an old version of Flash player.

Tools/HTML Settings/Javascript is turned on, and Firefox of course works fine.  How do I make Youtube work in Konqueror?
Comment 46 Benjamin Weber 2007-08-28 00:56:57 UTC
I can confirm that the patch I linked above fixes the problem in konqueror on my machine.

I built a test package in the build service

http://download.opensuse.org/repositories/home:/benjimanw/openSUSE_Factory/i586/kdebase3-nsplugin-3.5.7-94.1.i586.rpm
Comment 47 Will Stephenson 2007-08-28 07:05:17 UTC
#45: youtube doesn't test separately for broken JS and broken Flash, so you need to test separately on other sites which is really causing you the problem.

Assuming it's Flash, go to Configure Konqueror->Plugins and check that "Enabled plugins globally" in Global Settings is checked, and click the "Scan for plugins" button, then check that libflashplayer is found on the Plugins tab.
Comment 48 Stephan Binner 2007-08-28 11:41:45 UTC
*** Bug 305230 has been marked as a duplicate of this bug. ***
Comment 49 Will Stephenson 2007-08-28 14:04:21 UTC
I tested with the newest flashplayer beta and found that it is also affected by the bug, contrary to some anecdotal evidence on IRC.
Comment 50 Federico Mena Quintero 2007-08-28 21:14:04 UTC
(In reply to comment #47 from Will Stephenson)
> Assuming it's Flash, go to Configure Konqueror->Plugins and check that "Enabled
> plugins globally" in Global Settings is checked, and click the "Scan for
> plugins" button, then check that libflashplayer is found on the Plugins tab.

Huh... I go to the Settings / Configure Konqueror window, and there's no "Plugins" item.  I only get "Behavior", "Appearance", "Previews & Meta-Data", and "Performance".  How can I show the Plugins options?
Comment 51 Stephan Binner 2007-08-29 04:06:46 UTC
How did you set your KDE session? Not via selecting the KDE pattern? Do you have the kdebase3-nsplugin package installed?
Comment 52 Will Stephenson 2007-08-29 09:03:40 UTC
I guess Stephan meant to say "How did you install your KDE session".

Installing the "KDE Base System" pattern should be sufficient.  
Comment 53 Steve Beattie 2007-08-29 10:26:48 UTC
I also see this behavior for flash/opera on 10.3 beta2 on i586, with the same reported messages to stdout the reudiger reported in comment #10:

  Flash Player: Warning: environment variable G_FILENAME_ENCODING is set and is not UTF-8

  (process:29689): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function

  (process:29689): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

  (process:29689): Gtk-CRITICAL **: gtk_clipboard_get_for_display: assertion `GDK_IS_DISPLAY (display)' failed
  Adobe FlashPlayer: gtk_clipboard_get(GDK_SELECTION_PRIMARY); failed. Trying to call gtk_init(0,0);
  opera: Plug-in 29689 is not responding. It will be closed.
  opera: Define environment variable OPERA_KEEP_BLOCKED_PLUGIN to keep blocked plug-ins.

The odd thing is that I *also* saw this behavior for opera/flash within the past couple of days on up-to-date 10.2 before updating to 10.3 beta2 yesterday.
Comment 54 Federico Mena Quintero 2007-08-29 14:44:57 UTC
(In reply to comment #51 from Stephan Binner)
> How did you set your KDE session? Not via selecting the KDE pattern? Do you
> have the kdebase3-nsplugin package installed?

(In reply to comment #52 from Will Stephenson)
> I guess Stephan meant to say "How did you install your KDE session".
> 
> Installing the "KDE Base System" pattern should be sufficient.  

That's what I did when installing my box, I think.  I'll reinstall those packages.
Comment 55 Federico Mena Quintero 2007-08-29 17:22:44 UTC
libflashplayer.so is doing something really dumb.  It's calling GTK+ functions (gtk_clipboard_get(), in particular) before calling gtk_init().  This is the code it has:

(gdb) x/20i $pc-5
0xb5f499e7:     call   0xb5f3d828 <gtk_clipboard_get@plt>
0xb5f499ec:     test   %eax,%eax
0xb5f499ee:     jne    0xb5f49ab8
0xb5f499f4:     mov    -0x81c(%ebx),%eax
0xb5f499fa:     mov    $0x1,%ecx
0xb5f499ff:     mov    %eax,-0x10(%ebp)
0xb5f49a02:     mov    (%eax),%eax
0xb5f49a04:     mov    %ecx,0x4(%esp)
0xb5f49a08:     mov    %eax,0xc(%esp)
0xb5f49a0c:     mov    $0x63,%eax
0xb5f49a11:     mov    %eax,0x8(%esp)
0xb5f49a15:     lea    -0xa4284(%ebx),%eax
0xb5f49a1b:     mov    %eax,(%esp)
0xb5f49a1e:     call   0xb5f3ddb8 <fwrite@plt>
0xb5f49a23:     xor    %edx,%edx
0xb5f49a25:     mov    %edx,0x4(%esp)
0xb5f49a29:     movl   $0x0,(%esp)
0xb5f49a30:     call   0xb5f3d4d8 <gtk_init@plt>

This reads roughly

  if (gtk_clipboard_get (GDK_SELECTION_PRIMARY) != NULL)
     goto 0xb5f49ab8;

  fwrite (...);

  gtk_init (...);

But gtk_clipboard_get() fails, as gtk_init() hasn't been called first.  This is a bug in libflashplayer.

I'll just include the patch mentioned in comment #44; it's a hack, but there's no way for us to fix libflashplayer for real.
Comment 56 Benjamin Weber 2007-08-29 17:34:39 UTC
> I'll just include the patch mentioned in comment #44; it's a hack, but there's
> no way for us to fix libflashplayer for real.
> 

Presumably this won't fix opera though. Why does the problem only occur with new glib/gtk?
Comment 57 Dirk Mueller 2007-08-30 07:54:30 UTC
> But gtk_clipboard_get() fails, as gtk_init() hasn't been called first.  This > is a bug in libflashplayer.

Why do you think so?

What the code's intention is that it tries to figure out if gtk_init() has been called already. There are two uses: 

a) in gtk+ based firefox, where gtk_init() has already been called

and 

b) in konqueror, which is not gtk+ based and therefore doesn't initialize gtk. 

the code above tries to figure out if it needs to call gtk_init(). it does that by calling a function that only works if gtk_init() was already called before, and if that one fails, it calls gtk_init(). 

the debug message "Adobe FlashPlayer: gtk_clipboard_get(GDK_SELECTION_PRIMARY); failed. Trying to call gtk_init(0,0);" is saying that, and Mike Melanson from Adobe Flash Player team has confirmed the intention of this code. 

However, given that it has been always that way with any version of gtk, why is it suddenly a bug in flash player that glib2 produces an endless loop?

The real question was already in comment #19, and it is still unanswered: 

21:15 < coolo> 215             g_cond_wait (g_once_cond, g_once_mutex);
21:15 < coolo> that loop is never exited
21:16 < coolo> IA__g_once_init_enter_impl (value_location=0xb5a8c98c) at
gthread.c:214
21:18 < coolo> (gdb) print g_once_init_list->next->data
21:18 < coolo> $17 = (gpointer) 0xb5a8c98c





Comment 58 Dirk Mueller 2007-08-30 08:16:24 UTC
I feel so dirty now, but I sat down and wrote a two liner testcase: 

/*
   gcc `pkg-config --cflags gtk+-2.0` -o looptest looptest.c `pkg-config --libs gtk+-2.0`
*/

#include <gtk/gtkmain.h>

int main()
{
    if (!gtk_clipboard_get(GDK_SELECTION_PRIMARY))
        gtk_init(0,0);
}


this works fine with any version of gtk <= alpha6, and busyloops endlessly with gtk > alpha6. no flash player involved.
Comment 59 Dirk Mueller 2007-08-30 10:15:22 UTC
gah, wasted time. its already fixed upstream: 

http://bugzilla.gnome.org/show_bug.cgi?id=463773#c10 
Comment 60 Will Stephenson 2007-08-30 11:15:44 UTC
Is it possible to backport this fix to glib 2.13?
Comment 61 Stephan Binner 2007-08-30 16:00:00 UTC
*** Bug 306414 has been marked as a duplicate of this bug. ***
Comment 62 Federico Mena Quintero 2007-08-30 16:13:28 UTC
(In reply to comment #57 from Dirk Mueller)
> What the code's intention is that it tries to figure out if gtk_init() has been
> called already.

Ah, but no app should need to do this.  gtk_init() and friends are idempotent; calls subsequent to the first one are no-ops.

Flash player should simply call gtk_init() unconditionally.  Since we cannot fix it, we can simply use the patch to call gtk_init() from nspluginviewer always.

> the code above tries to figure out if it needs to call gtk_init(). it does that
> by calling a function that only works if gtk_init() was already called before,
> and if that one fails, it calls gtk_init(). 

This is the wrong way to do things on several levels:

- No code needs to know if GTK+ is initialized, as it can always call gtk_init() with no ill results.

- Calling any GTK+ functions before gtk_init() is called is *documented* to be wrong.  With an older glib, this will almost certainly print a warning (or it would crash if your glib was compiled with --disable-debug, or it would crash if you were running a development version of GNOME, since those make critical warnings crash automatically to catch bugs sooner - see http://mail.gnome.org/archives/desktop-devel-list/2005-November/msg00051.html about this).

- This is like watching for EBADFD to say, "oh, I guess I should have opened the file first" :)
Comment 63 Stephan Binner 2007-08-31 08:03:55 UTC
Added a patch to fix it like discussed in the upstream bug report. Verified that it fixes the problem with both Opera and Konqueror and that a GNOME desktop still works.
Comment 64 Stefan Dirsch 2007-08-31 08:52:00 UTC
Thanks. I would like to give it a try. Which package do I need to update? mbuilding it is fine for me.
Comment 66 Stefan Dirsch 2007-08-31 10:14:55 UTC
Thanks. Updating gtk2 works fine for me. :-)
Comment 67 Rob Robster 2007-08-31 14:39:35 UTC
(In reply to comment #66 from Stefan Dirsch)
> Thanks. Updating gtk2 works fine for me. :-)
> 

(In reply to comment #63 from Stephan Binner)
> Added a patch to fix it like discussed in the upstream bug report. Verified
> that it fixes the problem with both Opera and Konqueror and that a GNOME
> desktop still works.
> 

Hi,

what shall I do to fix the bug?
Where can I download the patch?

Could you tell me please step by step instructions?

Thank you.
Comment 68 Marcus Meissner 2007-08-31 14:55:36 UTC
I have submitted a patch for Online Update.
Comment 69 Rob Robster 2007-08-31 15:41:27 UTC
(In reply to comment #68 from Marcus Meissner)
> I have submitted a patch for Online Update.
> 

Please tell me where can I download it from!

Regards.


Comment 70 Federico Mena Quintero 2007-08-31 17:07:43 UTC
Thanks, Stephan and Marcus :)
Comment 71 Nikolay Derkach 2007-09-03 18:03:36 UTC
> Hi,
> 
> what shall I do to fix the bug?
> Where can I download the patch?
> 
> Could you tell me please step by step instructions?
> 
> Thank you.
> 

The current factory contains fixed packages (version 2.11.6-19), note that you also have to update gtk2-32bit package if you are using x86_64.

And yes, don't tell anyone, looks like this is a top-secret ;)
Comment 72 Christian Boltz 2007-09-10 20:04:31 UTC
VERIFIED in beta3 - thanks for fixing!