https://bugzilla.novell.com/show_bug.cgi?id=355402
User mmeeks@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=355402#c18
--- Comment #18 from Michael Meeks 2008-06-06 04:23:09 MDT ---
Hah ! nailed it ;-)
The main problem of course was repeating it - but it should be obvious now;
here is a good trace; it is unrelated to bug 395056 (and apparently unrelated
to bug 385128) - it is quite fun though:
good trace (from the 2nd log error which was clearer):
(gdb) bt
#0 IA__g_logv (log_domain=0xb69cdf97 "Gtk", log_level=G_LOG_LEVEL_CRITICAL,
format=0xb6c4f0bf "%s: assertion `%s' failed",
args1=0xbfb7efec "#�235�=�\235��") at gmessages.c:395
#1 0xb6c18156 in IA__g_log (log_domain=0xb69cdf97 "Gtk",
log_level=G_LOG_LEVEL_CRITICAL, format=0xb6c4f0bf "%s: assertion `%s' failed")
at gmessages.c:517
#2 0xb6c183bb in IA__g_return_if_fail_warning (log_domain=0xb69cdf97 "Gtk",
pretty_function=0xb69dc123 "_gtk_container_queue_resize",
expression=0xb69db53d "GTK_IS_CONTAINER (container)") at gmessages.c:532
#3 0xb67c1245 in _gtk_container_queue_resize (container=0xab66f60) at
gtkcontainer.c:1318
#4 0xb68d15de in real_queue_resize (widget=0xa348820) at gtksizegroup.c:159
#5 0xb68d1856 in queue_resize_on_widget (widget=0xa348820,
check_siblings=<value optimized out>) at gtksizegroup.c:203
#6 0xb6993e9f in IA__gtk_widget_queue_resize (widget=0xa348820) at
gtkwidget.c:3551
#7 0xb699401d in gtk_widget_set_style_internal (widget=0xa348820,
style=0x81c61c0, initial_emission=0) at gtkwidget.c:6030
#8 0xb6994154 in gtk_widget_reset_rc_style (widget=0xa348820) at
gtkwidget.c:5635
#9 0xb699420f in reset_rc_styles_recurse (widget=0xa348820, data=0x0) at
gtkwidget.c:6234
#10 0xb6994420 in IA__gtk_widget_reset_rc_styles (widget=0xa348820) at
gtkwidget.c:6247
#11 0xb68ac6e2 in gtk_rc_reset_widgets (settings=0x80751a0) at gtkrc.c:1619
#12 0xb68294d9 in reset_styles_idle (user_data=0x857f0d0) at gtkiconthemec:630
#13 0xb668182b in gdk_threads_dispatch (data=0x10710760) at gdk.c:470
#14 0xb6c0c3f1 in g_idle_dispatch (source=0x1218af48, callback=0xb69cdf97
<_fini+95>, user_data=0x10710760) at gmain.c:4087
#15 0xb6c0e2d9 in IA__g_main_context_dispatch (context=0x8087c40) at
gmain.c:2009
#16 0xb6c1185b in g_main_context_iterate (context=0x8087c40, block=1,
dispatch=1, self=0x805f7b8) at gmain.c:2642
#17 0xb6c119d8 in IA__g_main_context_iteration (context=0x8087c40, may_block=1)
at gmain.c:2705
#18 0xb78fb604 in nsAppShell::ProcessNextNativeEvent (this=0x8134f40,
mayWait=1) at nsAppShell.cpp:144
#19 0xb7910090 in nsBaseAppShell::DoProcessNextNativeEvent (this=0x8134f40,
mayWait=1) at nsBaseAppShell.cpp:151
#20 0xb7910227 in nsBaseAppShell::OnProcessNextEvent (this=0x8134f40,
thr=0x80a6900, mayWait=1, recursionDepth=0) at nsBaseAppShell.cpp:296
#21 0xb79bb004 in nsThread::ProcessNextEvent (this=0x80a6900, mayWait=1,
result=0xbfb7f3a4) at nsThread.cpp:497
#22 0xb798be10 in NS_ProcessNextEvent_P (thread=0xbfb7efec, mayWait=1) at
nsThreadUtils.cpp:227
#23 0xb7910370 in nsBaseAppShell::Run (this=0x8134f40) at
nsBaseAppShell.cpp:170
#24 0xb77ec430 in nsAppStartup::Run (this=0x820b518) at nsAppStartup.cpp:181
#25 0xb72580b3 in XRE_main (argc=2, argv=0xbfb82b14, aAppData=0x805ef68) at
nsAppRunner.cpp:3154
#26 0x080491eb in ?? ()
#27 0xb7dd45f5 in __libc_start_main (main=0x8048e14 , argc=2,
ubp_av=0xbfb82b14, init=0x804d900 ,
fini=0x804d8f0 , rtld_fini=0xb8075650 <_dl_fini>,
stack_end=0xbfb82b0c) at libc-start.c:220
#28 0x08048d51 in ?? ()
(gdb)
#3 0xb67c1245 in _gtk_container_queue_resize (container=0xab66f60) at
gtkcontainer.c:1318
1318 g_return_if_fail (GTK_IS_CONTAINER (container));
(gdb) l
1313 _gtk_container_queue_resize (GtkContainer *container)
1314 {
1315 GtkContainer *resize_container;
1316 GtkWidget *widget;
1317
1318 g_return_if_fail (GTK_IS_CONTAINER (container));
1319
1320 widget = GTK_WIDGET (container);
1321 resize_container = gtk_container_get_resize_container (container);
1322
(gdb) p *container
$24 = {widget = {object = {parent_instance = {g_type_instance = {g_class =
0x0}, ref_count = 1077936128, qdata = 0x0}, flags = 0}, private_flags = 0,
state = 0 '\0', saved_state = 0 '\0', name = 0x0, style = 0x0, requisition
= {width = 1077936128, height = 0}, allocation = {x = 0, y = 0, width = 0,
height = 0}, window = 0x3ff00000, parent = 0x0}, focus_child = 0x0,
border_width = 0, need_resize = 0, resize_mode = 0, reallocate_redraws = 0,
has_focus_chain = 0}
(gdb)
(gdb) up
#4 0xb68d15de in real_queue_resize (widget=0xa348820) at gtksizegroup.c:159
159 _gtk_container_queue_resize (GTK_CONTAINER (widget->parent));
(gdb) p *widget
$25 = {object = {parent_instance = {g_type_instance = {g_class = 0xa330ee0},
ref_count = 4, qdata = 0x81d2300}, flags = 2164672}, private_flags = 15872,
state = 0 '\0', saved_state = 0 '\0', name = 0x0, style = 0x81c61c0,
requisition = {width = 0, height = 0}, allocation = {x = 0, y = 0, width = 728,
height = 90}, window = 0xc67b008, parent = 0xab66f60}
(gdb) p (char *)g_type_name_from_instance (widget)
$26 = 0xb6a5bf95 "GtkPlug"
The culprit is the infamous GtkPlug ...
the widget: apparently 'realized' but with no valid parent:
#11 0xb68ac6e2 in gtk_rc_reset_widgets (settings=0x80751a0) at gtkrc.c:1619
1619 gtk_widget_reset_rc_styles (list->data);
(gdb) l
1614
1615 for (list = toplevels; list; list = list->next)
1616 {
1617 if (gtk_widget_get_screen (list->data) == settings->screen)
1618 {
1619 gtk_widget_reset_rc_styles (list->data);
1620 }
1621
1622 g_object_unref (list->data);
1623 }
(gdb)
(gdb) p toplevels
$27 = (GList *) 0xe3b9110
(gdb) p g_list_length (toplevels)
$28 = 182
(gdb)
seems rather a lot ;-) The window manager claims there are only 7 - but
whatever ;-)
Are we leaking GtkWindows / GtkPlugs all over the place ? [ thank God not
BonoboPlugs ;-].
(gdb) p (char *)(g_type_name_from_instance (g_list_nth_data (toplevels, 10)))
$36 = 0xb6a87f3b "GtkWindow"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 20))
$37 = 0xb6a87f3b "GtkWindow"
.. every 10 all the way to ...
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 171))
$52 = 0xb6a87f3b "GtkWindow"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 181))
$53 = 0xb6a5bf95 "GtkPlug"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 180))
$55 = 0xb6a5bf95 "GtkPlug"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 179))
$56 = 0xb6a5bf95 "GtkPlug"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 178))
$57 = 0xb6a5bf95 "GtkPlug"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 177))
$58 = 0xb6a5bf95 "GtkPlug"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 176))
$59 = 0xb6a5bf95 "GtkPlug"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 175))
$60 = 0xb6a5bf95 "GtkPlug"
(gdb) p (char *)g_type_name_from_instance (g_list_nth_data (toplevels, 174))
$61 = 0xb6a87f3b "GtkWindow"
.. all GtkWindows back to 168 & presumably to 0 ...
(gdb) p *(GtkPlug *)widget
$69 = {window = {bin = {container = {widget = {object = {parent_instance =
{g_type_instance = {g_class = 0xa330ee0}, ref_count = 4, qdata = 0x81d2300},
flags = 2164672}, private_flags = 15872, state = 0 '\0',
saved_state = 0 '\0', name = 0x0, style = 0x81c61c0, requisition = {width = 0,
height = 0}, allocation = {x = 0, y = 0, width = 728, height = 90},
window = 0xc67b008, parent = 0xab66f60}, focus_child = 0x0,
border_width = 0, need_resize = 1, resize_mode = 0, reallocate_redraws
= 0, has_focus_chain = 0}, child = 0x963e600}, title = 0x0,
wmclass_name = 0xb797568 "firefox", wmclass_class = 0x8755568 "Firefox",
wm_role = 0x0, focus_widget = 0x0, default_widget = 0x0,
transient_parent = 0x0, geometry_info = 0x0, frame = 0x0, group = 0x0,
configure_request_count = 0, allow_shrink = 0, allow_grow = 1,
configure_notify_received = 0, need_default_position = 1, need_default_size
= 1, position = 0, type = 0, has_user_ref_count = 1, has_focus = 0,
modal = 0, destroy_with_parent = 0, has_frame = 0, iconify_initially = 0,
stick_initially = 0, maximize_initially = 0, decorated = 1, type_hint = 0,
gravity = 1, is_active = 0, has_toplevel_focus = 0, frame_left = 0,
frame_top = 0, frame_right = 0, frame_bottom = 0, keys_changed_handler = 0,
mnemonic_modifier = GDK_MOD1_MASK, screen = 0x8083120}, socket_window =
0xe2accd0, modality_window = 0x0, modality_group = 0x0, grabbed_keys = 0x0,
same_app = 1}
(gdb) p *((GtkBin *)widget)->child
$71 = {object = {parent_instance = {g_type_instance = {g_class = 0xa3483d0},
ref_count = 1, qdata = 0x9a22c20}, flags = 2166720}, private_flags = 15872,
state = 0 '\0', saved_state = 0 '\0', name = 0x0, style = 0xbdc7be0,
requisition = {width = 0, height = 0}, allocation = {x = 0, y = 0, width = 728,
height = 90}, window = 0xc31f530, parent = 0xa348820}
(gdb) p (char *)g_type_name_from_instance (((GtkBin *)widget)->child)
$72 = 0xb69ddae1 "GtkDrawingArea"
** Presumably this came from an in-process plugin, still re-using the
GtkPlug/Socket thing ?
+ gtk_widget_set_parent ...
if (GTK_WIDGET_TOPLEVEL (widget))
{
g_warning ("Can't set a parent on a toplevel widget\n");
return;
}
** Interesting:
(gdb) p (char *)g_type_name_from_instance (widget)
$75 = 0xb6a5bf95 "GtkPlug"
(gdb) p widget->object.flags & (1<<4)
$76 = 0
The GtkPlug does not (apparently) have GTK_TOPLEVEL set - why not ? it is in
the list of toplevels ...
cf. gtk_plug_set_is_child (etc.)
** Odd - there is an in-process hack here - that is going wrong :-)
continuing I (predictably) got:
Program received signal SIGSEGV, Segmentation fault.
0xb69901da in IA__gtk_widget_get_toplevel (widget=0x47a) at gtkwidget.c:7286
7286 while (widget->parent)
(gdb) bt
#0 0xb69901da in IA__gtk_widget_get_toplevel (widget=0x47a) at
gtkwidget.c:7286
#1 0xb6990215 in gtk_widget_get_screen_unchecked (widget=0x47a) at
gtkwidget.c:6584
#2 0xb6990ebf in IA__gtk_widget_get_screen (widget=0xa348ca0) at
gtkwidget.c:6621
#3 0xb68ac6aa in gtk_rc_reset_widgets (settings=0x80751a0) at gtkrc.c:1617
#4 0xb68294d9 in reset_styles_idle (user_data=0x857f0d0) at gtkiconthemec:630
#5 0xb668182b in gdk_threads_dispatch (data=0x10710760) at gdk.c:470
#6 0xb6c0c3f1 in g_idle_dispatch (source=0x1218af48, callback=0x47a,
user_data=0x10710760) at gmain.c:4087
#7 0xb6c0e2d9 in IA__g_main_context_dispatch (context=0x8087c40) at
gmain.c:2009
#8 0xb6c1185b in g_main_context_iterate (context=0x8087c40, block=1,
dispatch=1, self=0x805f7b8) at gmain.c:2642
#9 0xb6c119d8 in IA__g_main_context_iteration (context=0x8087c40, may_block=1)
at gmain.c:2705
#10 0xb78fb604 in nsAppShell::ProcessNextNativeEvent (this=0x8134f40,
mayWait=1) at nsAppShell.cpp:144
#11 0xb7910090 in nsBaseAppShell::DoProcessNextNativeEvent (this=0x8134f40,
mayWait=1) at nsBaseAppShell.cpp:151
#12 0xb7910227 in nsBaseAppShell::OnProcessNextEvent (this=0x8134f40,
thr=0x80a6900, mayWait=1, recursionDepth=0) at nsBaseAppShell.cpp:296
#13 0xb79bb004 in nsThread::ProcessNextEvent (this=0x80a6900, mayWait=1,
result=0xbfb7f3a4) at nsThread.cpp:497
#14 0xb798be10 in NS_ProcessNextEvent_P (thread=0x3, mayWait=1) at
nsThreadUtils.cpp:227
#15 0xb7910370 in nsBaseAppShell::Run (this=0x8134f40) at
nsBaseAppShell.cpp:170
#16 0xb77ec430 in nsAppStartup::Run (this=0x820b518) at nsAppStartup.cpp:181
#17 0xb72580b3 in XRE_main (argc=2, argv=0xbfb82b14, aAppData=0x805ef68) at
nsAppRunner.cpp:3154
#18 0x080491eb in ?? ()
#19 0xb7dd45f5 in __libc_start_main (main=0x8048e14 , argc=2,
ubp_av=0xbfb82b14, init=0x804d900 ,
fini=0x804d8f0 , rtld_fini=0xb8075650 <_dl_fini>,
stack_end=0xbfb82b0c) at libc-start.c:220
#20 0x08048d51 in ?? ()
Suggestions:
* remove the GtkPlug from the list of toplevels as we assign the GtkSocket to
be it's parent in gtk_plug_set_is_child: we really need a
_gtk_window_set_toplevel (GtkWindow *window, gboolean)
that does the right thing for toplevel_list & preferably masks the flag at the
same time.
* review the ref-counting inside GtkPlug / GtkSocket to ensure the plug really
dies after it's been finished with: ultimately, it looks like we have a leak
here too - the parent GtkSocket is apparently dead, but the child is not: why ?
[ could be a bug in calling code inside firefox ].
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.