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 74126 - hangs when used with threads
hangs when used with threads
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
1.3.x
Other Linux
: High normal
: ---
Assigned To: Jonathan Blandford
Jonathan Blandford
Depends on:
Blocks:
 
 
Reported: 2002-03-10 08:36 UTC by gnome
Modified: 2011-02-04 16:09 UTC
See Also:
GNOME target: ---
GNOME version: 2.0


Attachments
The program to test the bug. (7.95 KB, text/plain)
2002-03-10 08:39 UTC, gnome
  Details
A patch which lets the program run again, but perhaps breaks other things :-) (2.48 KB, patch)
2002-03-10 08:40 UTC, gnome
none Details | Review

Description gnome 2002-03-10 08:36:46 UTC
I've written a simple application which creates a tree view, fills it and
shows it.
When running without gtk_thread_init all runs fine.
When running with gtk_thread_init the program hangs.

I've changed the thread_enter/leave code in a way to make it easier for
debugging and found that gtktreeview tries to obtain the lock a second time
which leads to hanging. After changing the call to use the function without
locking again it runs fine.

diff -urN -X gtk+-2.0.0-dontdiff gtk+-2.0.0-vanilla/gtk/gtktreeview.c
gtk+-2.0.0/gtk/gtktreeview.c
--- gtk+-2.0.0-vanilla/gtk/gtktreeview.c        Fri Mar  8 20:26:59 2002
+++ gtk+-2.0.0/gtk/gtktreeview.c        Sun Mar 10 10:01:52 2002
@@ -261,6 +261,7 @@
                                          GtkTreePath *path);
 static void     validate_visible_area    (GtkTreeView *tree_view);
 static gboolean validate_rows_handler    (GtkTreeView *tree_view);
+static gboolean do_validate_rows (GtkTreeView *tree_view);
 static gboolean presize_handler_callback (gpointer     data);
 static void     install_presize_handler  (GtkTreeView *tree_view);
 static void    gtk_tree_view_dy_to_top_row (GtkTreeView *tree_view);
@@ -1482,7 +1483,7 @@

   /* we validate 50 rows initially just to make sure we have some size */
   /* in practice, with a lot of static lists, this should get a good width */
-  validate_rows_handler (tree_view);
+  do_validate_rows (tree_view);
   gtk_tree_view_size_request_columns (tree_view);
   gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
Comment 1 gnome 2002-03-10 08:39:30 UTC
Created attachment 7078 [details]
The program to test the bug.
Comment 2 gnome 2002-03-10 08:40:38 UTC
Created attachment 7079 [details] [review]
A patch which lets the program run again, but perhaps breaks other things :-)
Comment 3 gnome 2002-03-10 10:03:47 UTC
Just checked with the X11 engine. It has the same behavior.
I used the gtk+-2.0.0 sources for testing in both cases (directfb and
x11 engine).
Comment 4 Kristian Rietveld 2002-03-17 00:14:54 UTC
Good catch! Just committed this to CVS. Thanks for patch.