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 119635 - crash adding GtkCList
crash adding GtkCList
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: gail
unspecified
Other Linux
: Normal critical
: ---
Assigned To: padraig.obriain
Damon Chaplin
: 118139 125761 126059 130538 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-08-11 13:24 UTC by Jon Willeke
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.1/2.2


Attachments
GDB backtrace with some Red Hat debuginfo packages installed (10.30 KB, text/plain)
2003-08-11 13:27 UTC, Jon Willeke
  Details
Patch for gail (5.05 KB, patch)
2003-10-16 09:01 UTC, padraig.obriain
none Details | Review
Stack trace of glade-2 (5.44 KB, text/plain)
2003-10-16 09:09 UTC, padraig.obriain
  Details
Updated patch for gail (12.01 KB, patch)
2003-10-20 12:08 UTC, padraig.obriain
none Details | Review

Description Jon Willeke 2003-08-11 13:24:41 UTC
I'm using GLADE 2.0.0, libglade 2.0.1, GTK+ 2.2.1, GLib 2.2.1, and GAIL
1.2.0 on Linux.

GLADE crashes if I add a GtkCList or GtkCTree to a GtkScrolledWindow that
previously held a GtkTreeView.  I can reproduce this every time with the
following steps:

  1. start a new GTK+ project
  2. add a GtkWindow
  3. add a GtkTreeView to the window
  4. delete the GtkTreeView, but not the automatically added GtkScrolledWindow
  5. add a GtkCList or GtkCTree

I'm attaching a backtrace.
Comment 1 Jon Willeke 2003-08-11 13:27:06 UTC
Created attachment 19108 [details]
GDB backtrace with some Red Hat debuginfo packages installed
Comment 2 Jon Willeke 2003-08-11 16:16:55 UTC
The following appears on stderr if I start GLADE from a terminal session:

GTK Accessibility Module initialized

(glade-2:29534): Gtk-WARNING **: gtk_scrolled_window_add(): cannot add
non scrollable widget use gtk_scrolled_window_add_with_viewport() instead

(glade-2:29534): Gtk-WARNING **: gtk_scrolled_window_add(): cannot add
non scrollable widget use gtk_scrolled_window_add_with_viewport() instead

(glade-2:29534): GLib-GObject-WARNING **: invalid uninstantiatable
type `(null)' in cast to `GtkWidget'

(glade-2:29534): Gtk-CRITICAL **: file gtkwidget.c: line 6791
(gtk_widget_get_accessible): assertion `GTK_IS_WIDGET (widget)' failed
GTK Accessibility Module initialized
Comment 3 Damon Chaplin 2003-10-15 15:13:42 UTC
Yes, I can reproduce.
The crash appears to be in gail, though, so I'll move the bug to atk
(I can't find a gail product).

I think the problem is that gailtreeview.c doesn't disconnect the
signal handlers from the scrolled window adjustments when it is
destroyed. So the signal handlers are still called, but the treeview
is not valid any more. 
Comment 4 padraig.obriain 2003-10-16 09:01:30 UTC
Created attachment 20737 [details] [review]
Patch for gail
Comment 5 padraig.obriain 2003-10-16 09:07:39 UTC
The attached patch for gail prevents the problem from occurring.

However it looks to me that the real problem is in glade-2 or gtk.

I will attach a stack trace that shows that
gtk_tree_view_set_adjustment() is called with hadj and vadj set to
NULL when the GtkTreeView is deleted. This causes new vertical and
horizontal adjustments to be created and silently replace the existing
ones. It also seems that the new adjustments are then leaked.

My patch to gail saves the original hadj and vadj so that I can remove
the signal handlers. This does not seem like the correct solution. 
Comment 6 padraig.obriain 2003-10-16 09:09:15 UTC
Created attachment 20738 [details]
Stack trace of glade-2
Comment 7 Damon Chaplin 2003-10-16 15:44:14 UTC
*** Bug 118139 has been marked as a duplicate of this bug. ***
Comment 8 Damon Chaplin 2003-10-16 17:18:15 UTC
I agree there could be a problem in GTK+ here as well. But I don't
think Glade is involved. I think all Glade did was remove a
GtkTreeView and put a GtkCList in its place.

I don't really know how you handle life-cycle issues in gail so I
can't really help much with that.

What sort of better solution did you have in mind?
Comment 9 Damon Chaplin 2003-10-17 11:26:36 UTC
Actually gailtreeview.c doesn't seem to be taking into account the
fact that the treeview adjustments are changed when it is added to
a scrolledwindow. Or by using gtk_tree_view_set_hadjustment().
So that may need fixing as well. (Unless I missed something.)

I really think this should be an atk bug ;)
Comment 10 padraig.obriain 2003-10-20 09:49:36 UTC
Thanks for your work at this. I have looked at this some more and I
accept that this is a gail bug.
Comment 11 padraig.obriain 2003-10-20 12:08:57 UTC
Created attachment 20814 [details] [review]
Updated patch for gail
Comment 12 padraig.obriain 2003-10-20 16:54:01 UTC
atch committed to CVS HEAD.
Comment 13 Damon Chaplin 2003-10-29 11:41:03 UTC
*** Bug 125761 has been marked as a duplicate of this bug. ***
Comment 14 Damon Chaplin 2003-11-03 10:53:37 UTC
*** Bug 126059 has been marked as a duplicate of this bug. ***
Comment 15 Damon Chaplin 2004-09-23 16:02:42 UTC
*** Bug 130538 has been marked as a duplicate of this bug. ***