GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Nov 23, 2014 12:17 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: GtkCellRendererSpin Seg Fault
PostPosted: Fri Mar 30, 2012 7:26 pm 
Offline
Familiar Face

Joined: Tue Feb 09, 2010 12:33 am
Posts: 32
Hello,

When entering a number into a GtkCellRendererSpin widget I randomly get the message GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed and the program segfaults. It seems that the error occurs when calling gtk_adjustment_set_value (); but it is intermittent. Is this the correct asumption? Is there a known fix? Should I file a bug report and if so where?

Thanks for the help,
Patrick

The backtrace on the core dump shows this:
Quote:
#0 0x0000003db54135b8 in g_object_notify () from /lib64/libgobject-2.0.so.0
#1 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#2 0x0000003db5420d17 in ?? () from /lib64/libgobject-2.0.so.0
#3 0x0000003db542a141 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#4 0x0000003db542a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#5 0x0000003000079d2a in gtk_adjustment_value_changed ()
from /usr/lib64/libgtk-3.so.0
#6 0x000000000048dc51 in scmtm_trading_grid_term_strike_cell_edited_cb (
renderer=0x25ac280, path=0x30f2d60 "3", text=0x3085680 "0.995",
scmtm_trading_grid=0x2aa23f0) at scmtm_trading_grid.c:1436
#7 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#8 0x0000003db5420d17 in ?? () from /lib64/libgobject-2.0.so.0
#9 0x0000003db542a141 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#10 0x0000003db542a4cd in g_signal_emit_by_name ()
from /lib64/libgobject-2.0.so.0
#11 0x00000030000b0402 in ?? () from /usr/lib64/libgtk-3.so.0
#12 0x00000030001529d8 in ?? () from /usr/lib64/libgtk-3.so.0
#13 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#14 0x0000003db5420d17 in ?? () from /lib64/libgobject-2.0.so.0
#15 0x0000003db5429f13 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#16 0x0000003db542a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#17 0x000000300027f289 in ?? () from /usr/lib64/libgtk-3.so.0
#18 0x000000300028b722 in gtk_widget_send_focus_change ()
from /usr/lib64/libgtk-3.so.0
#19 0x0000003000290b40 in ?? () from /usr/lib64/libgtk-3.so.0
#20 0x0000003000291dda in ?? () from /usr/lib64/libgtk-3.so.0
#21 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#22 0x0000003db5420b5c in ?? () from /lib64/libgobject-2.0.so.0
#23 0x0000003db542a141 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#24 0x0000003db542a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#25 0x0000003000266556 in ?? () from /usr/lib64/libgtk-3.so.0
#26 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#27 0x0000003db5420b5c in ?? () from /lib64/libgobject-2.0.so.0
#28 0x0000003db542a141 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#29 0x0000003db542a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#30 0x00000030002803ba in gtk_widget_grab_focus ()
from /usr/lib64/libgtk-3.so.0
#31 0x000000300026cf67 in ?? () from /usr/lib64/libgtk-3.so.0
#32 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#33 0x0000003db5420d17 in ?? () from /lib64/libgobject-2.0.so.0
#34 0x0000003db542a141 in g_signal_emit_valist ()
---Type <return> to continue, or q <return> to quit---
from /lib64/libgobject-2.0.so.0
#35 0x0000003db542a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#36 0x000000300009dd0b in ?? () from /usr/lib64/libgtk-3.so.0
#37 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#38 0x0000003db5420d17 in ?? () from /lib64/libgobject-2.0.so.0
#39 0x0000003db542a141 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#40 0x0000003db542a4cd in g_signal_emit_by_name ()
from /lib64/libgobject-2.0.so.0
#41 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#42 0x0000003db5420d17 in ?? () from /lib64/libgobject-2.0.so.0
#43 0x0000003db5429750 in g_signal_emitv () from /lib64/libgobject-2.0.so.0
#44 0x000000300008880a in ?? () from /usr/lib64/libgtk-3.so.0
#45 0x0000003000088d78 in ?? () from /usr/lib64/libgtk-3.so.0
#46 0x0000003000088ec2 in ?? () from /usr/lib64/libgtk-3.so.0
#47 0x000000300008a295 in gtk_bindings_activate_event ()
from /usr/lib64/libgtk-3.so.0
#48 0x00000030000e43c5 in ?? () from /usr/lib64/libgtk-3.so.0
#49 0x00000030001529d8 in ?? () from /usr/lib64/libgtk-3.so.0
#50 0x0000003db540e97a in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#51 0x0000003db5420b5c in ?? () from /lib64/libgobject-2.0.so.0
#52 0x0000003db5429f13 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#53 0x0000003db542a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#54 0x000000300027f289 in ?? () from /usr/lib64/libgtk-3.so.0
#55 0x000000300029954b in gtk_window_propagate_key_event ()
from /usr/lib64/libgtk-3.so.0
#56 0x000000300029c1eb in ?? () from /usr/lib64/libgtk-3.so.0
#57 0x00000030001529d8 in ?? () from /usr/lib64/libgtk-3.so.0
#58 0x0000003db540ea24 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#59 0x0000003db5420b5c in ?? () from /lib64/libgobject-2.0.so.0
#60 0x0000003db5429f13 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#61 0x0000003db542a2e2 in g_signal_emit () from /lib64/libgobject-2.0.so.0
#62 0x000000300027f289 in ?? () from /usr/lib64/libgtk-3.so.0
#63 0x0000003000152217 in gtk_propagate_event () from /usr/lib64/libgtk-3.so.0
#64 0x000000300015254b in gtk_main_do_event () from /usr/lib64/libgtk-3.so.0
#65 0x0000003000847642 in ?? () from /usr/lib64/libgdk-3.so.0
#66 0x0000003db4044acd in g_main_context_dispatch ()
from /lib64/libglib-2.0.so.0
#67 0x0000003db40452c8 in ?? () from /lib64/libglib-2.0.so.0
#68 0x0000003db4045815 in g_main_loop_run () from /lib64/libglib-2.0.so.0
#69 0x000000300015198d in gtk_main () from /usr/lib64/libgtk-3.so.0
#70 0x00000000004432fb in main (argc=1, argv=0x7fff156de108) at scmtm_main.c:93


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Sat Mar 31, 2012 11:30 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Dear mccraic,
It is unlikely that it is a bug -- there's always the possibility, but investigate a bit further before filing a report. I often get criticals and after a lot of digging through the code find its there's an error in my code that didn't get picked up until a long way down the track in a seemingly unconnected fashion. Gtk/glib is pretty well tested to the point that it is highly unlikely that a CRITICAL will be a bug in gtk/glib itself (non critical errors however, often go overlooked). Especially when the error is G_IS_OBJECT it is likely that you have done something to make it not an OBJECT any more. The fact that it is intermittent makes it more complicated to track. The backtrace helps pin down where the error ws picked up but won't tell where it originated. Could you post more code.
Regards,
Paul.


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Wed Apr 04, 2012 10:36 pm 
Offline
Familiar Face

Joined: Tue Feb 09, 2010 12:33 am
Posts: 32
Hello,

I have been doing quite a bit of debugging and I still have issues. The first time I click on the treeview column with the GtkCellRendererSpin cell I do not get any errors. If I then click on a different cell when I click back on the GtkCellRendererSpin cell every time I get the error GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed. If I keep doing this I sometimes get these errors and after about 4 clicks on the field the program segfaults.
Quote:
(scmtm_3:3076): Gtk-CRITICAL **: gtk_spin_button_get_adjustment: assertion `GTK_IS_SPIN_BUTTON (spin_button)' failed
(scmtm_3:3076): GLib-GObject-CRITICAL **: g_value_unset: assertion `G_IS_VALUE (value)' failed
(scmtm_3:3076): GLib-GObject-WARNING **: g_object_notify: object class `GtkStyleContext' has no property named `accessible-value'

One thing which might be related is that if I change the value in the spin button manually through the keyboard the value is visible in the spinbutton but when I hit enter gtk_adjustment_get_value (adjustment); returns the old value so the CellRendererText is not updated to the new value. If I change the value using the spinbuttons gtk_adjustment_get_value (adjustment); returns the new value and CellRendererText is updated to the new value.

I am using gtk3-3.2.4.x86_64 and glade3-3.10.0.x86_64 on Fedora 16

This is the cell_edited() callback function connected to the signal:
Code:
void
quantity_cell_edited_cb (GtkCellRendererText *renderer, gchar *path, gchar *text, GtkTreeView *treeview)
   {
   GtkTreeIter iter;
   GtkTreeModel *model;
   GtkAdjustment *adjustment;
   gdouble quantity;

   g_object_get (renderer, "adjustment", &adjustment, NULL);
   quantity = gtk_adjustment_get_value (adjustment);
   model = gtk_tree_view_get_model (treeview);
      
   if (gtk_tree_model_get_iter_from_string (model, &iter, path))
   {
     gtk_tree_store_set (GTK_LIST_STORE (model), &iter, COLUMN_TG, (gdouble) quantity, -1);
   }
   return;
}

I have tried creating the column, renderer and adjustment through glade and gtk_builder as well as creating the column, renderer and adjustment in the C code but both have the same results:

Code:
adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 10000.0, 1.0, 2.0, 0.0));

cell_renderer = gtk_cell_renderer_spin_new ();
g_object_set (G_OBJECT (cell_renderer), "editable", TRUE, "adjustment", adjustment, "digits", 3, NULL);
g_signal_connect (G_OBJECT (cell_renderer), "edited", G_CALLBACK (cell_edited_cb), (gpointer) treeview);

column = gtk_tree_view_column_new_with_attributes ("Test", cell_renderer, "text", COLUMN_TEST, NULL);

gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);

Thanks for the help,

Patrick


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Thu Apr 05, 2012 6:58 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
For a start I think you should be doing your callback on the "value-changed" signal of the adjustment rathr than the "edited" of the CellRenderer. This way you make sure the input passes as a float properly before testing it. You won't get any false signals if the user accidentally inputs text and the gtk_adjustment_get_value function is sure to work properly.
I see you also forgot the line in the documentation:
Quote:
It is the responsibility of the application to update the model and store new_text at the position indicated by path.
http://developer.gnome.org/gtk/2.24/GtkCellRendererText.html#GtkCellRendererText-edited
Your callback function doesn't match in the two snippets you give. I take it this is just a typo.


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Thu Apr 05, 2012 7:20 am 
Offline
Familiar Face

Joined: Thu Dec 15, 2011 6:23 pm
Posts: 36
Location: Hrvatska
one more error - prototype callback for edited signal is
Quote:
void user_function ( GtkCellRendererText *renderer,
gchar *path,
gchar *new_text,
gpointer user_data)

if you pass pointer to treeview as user_data, you must do some casting, like this:
Code:
GtkTreeView *treeview = (GtkTreeView *) user_data;

as Paul said, edited signal is not good choice here.

EDIT: oops ! it is not error at all ! just check it.
yes, it is OK to put casting in argument of function, just like Patrick do


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Thu Apr 05, 2012 3:27 pm 
Offline
Familiar Face

Joined: Thu Dec 15, 2011 6:23 pm
Posts: 36
Location: Hrvatska
here is test code. it is modified sample from GTK-DEMO. NUMBER column with combo box is removed, and YUMMY column with progress bar is replaced with SPIN button.
it fires two callback : editing-started for GtkCellRendererSpin and value-changed for GtkSpinButton. maybe it can help someone. ( tested on fedora 16 )

Code:
#include <gtk/gtk.h>
#include <string.h>
#include <stdlib.h>


static GtkWidget *window = NULL;

typedef struct
{
  gchar *product;
  gfloat  yummy;
}
Item;

enum
{
  COLUMN_ITEM_PRODUCT,
  COLUMN_ITEM_YUMMY,
  NUM_ITEM_COLUMNS
};

static GtkWidget *treeview;
static GtkListStore *model;
static GtkTreeModel *items_model;
static GtkAdjustment *adjust;
static GArray *articles = NULL;
static GtkTreePath *tree_path;
static gint column;


static void
add_items (void)
{
  Item foo;

  g_return_if_fail (articles != NULL);

  foo.product = "bottles of coke";
  foo.yummy = 20.0;
  g_array_append_vals (articles, &foo, 1);

  foo.product = "packages of noodles";
  foo.yummy = 50.0;
  g_array_append_vals (articles, &foo, 1);

}

static void
create_items_model (void)
{
  gint i = 0;
  GtkTreeIter iter;

  /* create array */
  articles = g_array_sized_new (FALSE, FALSE, sizeof (Item), 1);

  add_items ();

  /* create list store */
  model = gtk_list_store_new (NUM_ITEM_COLUMNS, G_TYPE_STRING,
                              G_TYPE_FLOAT, G_TYPE_BOOLEAN);

  /* add items */
  for (i = 0; i < articles->len; i++)
    {
      gtk_list_store_append (model, &iter);

      gtk_list_store_set (model, &iter,
                          COLUMN_ITEM_PRODUCT,
                          g_array_index (articles, Item, i).product,
                          COLUMN_ITEM_YUMMY,
                          g_array_index (articles, Item, i).yummy,
                          -1);
    }
  items_model = GTK_TREE_MODEL (model);
  // g_object_unref (model);
}


static void
value_changed (GtkSpinButton *spinbutton,
        gpointer       user_data)
{
   GtkAdjustment *adj;
   GtkTreeIter iter;
    // tree_path = (GtkTreePath *) user_data;

   adj = gtk_spin_button_get_adjustment (spinbutton);
   gdouble value = gtk_adjustment_get_value (adj);
   //  g_print (" %g ",value);

   gtk_tree_model_get_iter (items_model, &iter, tree_path);
    gtk_list_store_set (GTK_LIST_STORE (items_model), &iter,
          COLUMN_ITEM_YUMMY, value, -1);
    // gtk_tree_path_free (tree_path);
}



static void
editing_started (GtkCellRenderer *cell,
                 GtkCellEditable *editable,
                 const gchar     *path,
                 gpointer         user_data)
{
   tree_path = gtk_tree_path_new_from_string (path);
   GtkTreeIter iter;
   column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));

   gtk_tree_model_get_iter (items_model, &iter, tree_path);


   switch (column)
   {

     case COLUMN_ITEM_YUMMY:
     {
        GtkWidget *button = GTK_SPIN_BUTTON(editable);

        g_signal_connect (G_OBJECT (button), "value-changed",
                        G_CALLBACK (value_changed), NULL);

     }
     break;

   }

   // gtk_tree_path_free (tree_path);
}


static void
add_columns ()
{
  GtkCellRenderer *renderer;


  /* product column */
  renderer = gtk_cell_renderer_text_new ();
  g_object_set (renderer, "editable", FALSE, NULL);
  g_object_set_data (G_OBJECT (renderer),
        "column", GINT_TO_POINTER (COLUMN_ITEM_PRODUCT));

  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
                                               -1, "Product", renderer,
                                               "text", COLUMN_ITEM_PRODUCT,
                                               NULL);

  /* yummy column */
  adjust = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1000.0, 0.1, 1.0, 0.0));
  renderer = gtk_cell_renderer_spin_new ();
  g_object_set (renderer, "editable", TRUE, NULL);
  g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_ITEM_YUMMY));
  g_object_set (renderer, "adjustment", adjust, NULL);
  // g_object_set (renderer, "climb-rate", 0.5, NULL);
  g_object_set (renderer, "digits", 3, NULL);

  g_signal_connect (renderer, "editing-started",
                     G_CALLBACK (editing_started), NULL);


  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
                                               -1, "Yummy", renderer,
                                               "text", COLUMN_ITEM_YUMMY,
                                               NULL);

}


int main (int argc, char *argv[])
{

    GtkWidget *vbox;
    GtkWidget *hbox;
    GtkWidget *sw;
    GtkWidget *button;

    gtk_init(&argc, &argv);

   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);    // GTK_WINDOW_TOPLEVEL
   gtk_widget_set_size_request(window, 800, 600);

   gtk_window_set_resizable(GTK_WINDOW(window), TRUE);   
   gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);

    gtk_window_set_title (GTK_WINDOW (window), "Shopping list");
    gtk_container_set_border_width (GTK_CONTAINER (window), 5);
    g_signal_connect (window, "destroy",
                      G_CALLBACK (gtk_main_quit), &window);

    vbox = gtk_vbox_new (FALSE, 5);
    gtk_container_add (GTK_CONTAINER (window), vbox);

    gtk_box_pack_start (GTK_BOX (vbox),
                        gtk_label_new ("Shopping list (you can edit only SPIN-BUTTON cell !)"),
                        FALSE, FALSE, 0);

    sw = gtk_scrolled_window_new (NULL, NULL);
    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
                                         GTK_SHADOW_ETCHED_IN);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
                                    GTK_POLICY_AUTOMATIC,
                                    GTK_POLICY_AUTOMATIC);
    gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);

    /* create models */
    create_items_model ();

    /* create tree view */
    treeview = gtk_tree_view_new_with_model (items_model);
    gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE);
    gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)),
                                 GTK_SELECTION_SINGLE);

    add_columns ();

    // g_object_unref (items_model);

    gtk_container_add (GTK_CONTAINER (sw), treeview);

    /* some buttons */
    hbox = gtk_hbox_new (TRUE, 4);
    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);

    button = gtk_button_new_with_label ("EXIT");
    g_signal_connect (button, "clicked", G_CALLBACK(gtk_main_quit), NULL);
    gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);



  gtk_widget_show_all(window);
  gtk_main ();
  return 0;
}

you can compile from terminal with this command:
Quote:
gcc -g -Wall -o test test.c $(pkg-config --cflags --libs gtk+-3.0)


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Thu Apr 05, 2012 10:03 pm 
Offline
Familiar Face

Joined: Tue Feb 09, 2010 12:33 am
Posts: 32
It is a bit confusing because the documentation also says this:
Quote:
The GtkAdjustment object does not update the value itself. Instead it is left up to the owner of the GtkAdjustment to control the value.

The owner of the GtkAdjustment typically calls the gtk_adjustment_value_changed() and gtk_adjustment_changed() functions after changing the value and its bounds. This results in the emission of the "value_changed" or "changed" signal respectively.


I have changed my code as follows and this fixes the manual data entry issue but I still get the same error of just clicking on and off the CellRendererSpin several times with or without entering data which causes a segfault (first click does not print out an error):

Code:
value_changed_cb (GtkSpinButton *spinbutton, gpointer user_data)
   {
   GtkTreeIter iter;
      
   GtkAdjustment *adjustment;

   GtkTreeSelection * tree_selection;

   GtkTreeModel *tree_model;
      
   gdouble value;

   adjustment = gtk_spin_button_get_adjustment (spinbutton);
   
   value = gtk_adjustment_get_value (adjustment);

   tree_selection = gtk_tree_view_get_selection (treeview);

   if (gtk_tree_selection_get_selected (tree_selection, &tree_model, &iter))
      {
      gtk_list_store_set (GTK_LIST_STORE (tree_model), &iter, COLUMN_TG_VALUE, (gdouble) VALUE, -1);
   }
   else
      g_print ("Error (VALUE): gtk_tree_selection_get_selected (tree_selection, &tree_model, &iter) returned false\n");
      
   return;
}


and
Code:
void
editing_started (GtkCellRenderer *cell, GtkCellEditable *editable, const gchar *path, gpointer user_data)
   {
   gint column;
      
   gpointer term;
      
   column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column"));

   switch (column)
      {
      case COLUMN_TG_VALUE:
         {
         GtkWidget *button = GTK_SPIN_BUTTON(editable);

         g_signal_connect (G_OBJECT (button), "value-changed", G_CALLBACK (value_changed_cb), NULL);
         break;
      }
      break;
   }
}


I am able to step through the code using Anjuta and GDB and it seems to have issues after leaving the value_changed_cb function but I have not figured out why.

Thanks again for the help,

Patrick


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Fri Apr 06, 2012 5:23 am 
Offline
Familiar Face

Joined: Thu Dec 15, 2011 6:23 pm
Posts: 36
Location: Hrvatska
just to confirm, I also get this warning:
Quote:
I randomly get the message GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed

but this is not critical, so it can be ignored ( I hope )


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Sun Apr 08, 2012 4:52 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 778
Location: UK
Hi,

Do not ignore these debugging output from your application. It does mean you are doing something wrong and should be corrected. If you do ignore it, and then get more of them later it will just make debugging harder.

_________________
E.


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Mon Apr 09, 2012 8:01 am 
Offline
Familiar Face

Joined: Thu Dec 15, 2011 6:23 pm
Posts: 36
Location: Hrvatska
errol,
thanks for reply.
can you test my sample on your box, please ?
maybe it is fedora 16 specific ( patrick and me both have fedora box ).
please, give me some report, now I am curious about that.
cheers !


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Mon Apr 09, 2012 3:33 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 778
Location: UK
I am running Debian testing and get the same results. I have not really looked into debugging as of yet, but do see that there could be a problem with connecting a signal in the function editing_started().

_________________
E.


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Mon Apr 09, 2012 5:34 pm 
Offline
Familiar Face

Joined: Tue Feb 09, 2010 12:33 am
Posts: 32
Hello,

I have compiled the example program from kepica and I get the same results as my program:

First entry of data or click on the spinbutton produces no error.

Next click on the spinbutton produces GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed

After several clicks on the spinbutton and getting the same error above the program segfaults.

I do get one warning when compiling:

test.c: In function ‘editing_started’:
test.c:118:29: warning: initialization from incompatible pointer type [enabled by default]

This warning goes away if I change GtkWidget to GtkSpinButton and has no effect on the issue being discussed.

Thanks,

Patrick


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Thu Apr 12, 2012 6:34 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 778
Location: UK
I have simplified the code and done various methods of connecting to the signals. But all have come to the same result so far. I have been using a debugger to break when one of the warnings occurs and to give me a stack trace. So far every time the stack trace has been totally within GTK and not in our code.

So far I have not found any other examples of the GtkCellRendererSpin to compare with, so I am unsure if this could be a bug.

_________________
E.


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Wed Apr 18, 2012 10:46 pm 
Offline
Familiar Face

Joined: Tue Feb 09, 2010 12:33 am
Posts: 32
Hello,

Should this bug be reported somewhere? and if so where?

Thanks,

Patrick


Top
 Profile  
 
 Post subject: Re: GtkCellRendererSpin Seg Fault
PostPosted: Fri Apr 20, 2012 6:41 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 778
Location: UK
I will need to simplify the code a bit and make extra checks on it and if it still a reproducible bug then I will report it as a possible bug to the maintainers of GTK+.

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group