crash on gtk_tree_selection_get_selected



This one has me clueless and I don't know whether if it is a bug in
gtk2. I am porting xfsamba (frontend of the samba suite) to gtk2, and
when a server (represented by a row of a gtk_tree_view) is clicked on,
the program downloads information from the server (much like www
frontends). This is the code for the callback:

if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
     gtk_tree_model_get (GTK_TREE_MODEL (server_model), &iter,
SERVER_NAME_COLUMN, &sv, -1);
     if (!sv || strlen(sv)==0){
	  print_status(_("Invalid server selected"));
	  return;
     }
     strcpy(server,sv);
     g_free (sv);
     printf("got %s\n",server);
//  crash:
     SMBrefresh (server, RELOAD);
  }

If I do not call the SMBrefresh routine, all's fine. If I call
SMBrefresh() from anywhere but here, all's fine. With gtk1.2 all's fine.
What troubles me is the traceback I get from the crash, since it does
not seem to be generated from xfsamba code but from gtk2 internals:


Program received signal SIGSEGV, Segmentation fault.
0x40118455 in gtk_range_get_value () from /usr/lib/libgtk-x11-2.0.so.0
(gdb) bt
#0  0x40118455 in gtk_range_get_value () from
/usr/lib/libgtk-x11-2.0.so.0
#1  0x401997b3 in gtk_tree_view_get_type () from
/usr/lib/libgtk-x11-2.0.so.0
#2  0x4019ebf7 in gtk_tree_view_set_reorderable ()
   from /usr/lib/libgtk-x11-2.0.so.0
#3  0x40192362 in gtk_tree_view_get_type () from
/usr/lib/libgtk-x11-2.0.so.0
#4  0x400eff03 in gtk_propagate_event () from
/usr/lib/libgtk-x11-2.0.so.0
#5  0x4034a5c7 in g_type_class_meta_marshal ()
   from /usr/lib/libgobject-2.0.so.0
#6  0x4034a17a in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#7  0x4035f436 in signal_emit_unlocked_R () from
/usr/lib/libgobject-2.0.so.0
#8  0x4035d751 in g_signal_emit_valist () from
/usr/lib/libgobject-2.0.so.0
#9  0x401294d5 in gtk_signal_emit () from /usr/lib/libgtk-x11-2.0.so.0
#10 0x401b0888 in gtk_widget_send_expose () from
/usr/lib/libgtk-x11-2.0.so.0
#11 0x400efda3 in gtk_propagate_event () from
/usr/lib/libgtk-x11-2.0.so.0
#12 0x400eebff in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#13 0x40272013 in gdk_add_client_message_filter ()
   from /usr/lib/libgdk-x11-2.0.so.0
#14 0x403a1dd3 in g_main_dispatch () from /usr/lib/libglib-2.0.so.0
#15 0x403a2c51 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
#16 0x403a3011 in g_main_context_iterate () from
/usr/lib/libglib-2.0.so.0
#17 0x403a3720 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#18 0x400ee2b3 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#19 0x0804c487 in main (argc=1, argv=0xbffff9f4) at xfsamba.c:236

Would this be a bug in gtk2? (using RH gtk2-2.0.2-4).


Edscott Wilson Garcia





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]