assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
by Johncc330 from LinuxQuestions.org on (#6D7JN)
I'm trying - for the first time - to get a GResource linked with the main C code and having serious problems with it. This bit of code is where the problem appears:
Code:create_window(char *win_id)
{
char *p = g_strdup_printf("%s/%s", RESOURCE_PATH, win_id);
GtkWidget *win;
builder = gtk_builder_new_from_resource(p);
g_free(p);
win = GTK_WIDGET(gtk_builder_get_object(builder, win_id));
g_object_unref(G_OBJECT(builder));
return win;
}The output of the program is:
Code:(process:946): Gtk-CRITICAL **: 22:01:37.141: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(process:946): Gtk-CRITICAL **: 22:01:37.141: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation faultRunning the program in gdb, I get that the error occurs in builder = gtk_builder_new_from_resource(p); The backtrace at this point is:
Code:#1 0x00007ffff7725304 in () at /usr/lib64/libgtk-3.so.0
#2 0x00007ffff7745c38 in () at /usr/lib64/libgtk-3.so.0
#3 0x00007ffff7730bcc in () at /usr/lib64/libgtk-3.so.0
#4 0x00007ffff7745b26 in () at /usr/lib64/libgtk-3.so.0
#5 0x00007ffff7731512 in () at /usr/lib64/libgtk-3.so.0
#6 0x00007ffff7f45b33 in g_type_create_instance ()
at /usr/lib64/libgobject-2.0.so.0
#7 0x00007ffff7f2a700 in () at /usr/lib64/libgobject-2.0.so.0
#8 0x00007ffff7f2bc0c in g_object_new_with_properties ()
at /usr/lib64/libgobject-2.0.so.0
#9 0x00007ffff7f2c7c1 in g_object_new () at /usr/lib64/libgobject-2.0.so.0
#10 0x00007ffff774de8a in () at /usr/lib64/libgtk-3.so.0
#11 0x00007ffff792306d in () at /usr/lib64/libgtk-3.so.0
#12 0x00007ffff7f45b33 in g_type_create_instance ()
at /usr/lib64/libgobject-2.0.so.0
#13 0x00007ffff7f2a700 in () at /usr/lib64/libgobject-2.0.so.0
#14 0x00007ffff7f2bf6c in g_object_newv () at /usr/lib64/libgobject-2.0.so.0
#15 0x00007ffff76d7c44 in () at /usr/lib64/libgtk-3.so.0
#16 0x00007ffff76d9015 in () at /usr/lib64/libgtk-3.so.0
#17 0x00007ffff76d9e97 in () at /usr/lib64/libgtk-3.so.0
#18 0x00007ffff7e2f290 in () at /usr/lib64/libglib-2.0.so.0
#19 0x00007ffff7e30785 in g_markup_parse_context_parse ()
at /usr/lib64/libglib-2.0.so.0
#20 0x00007ffff76daeb6 in () at /usr/lib64/libgtk-3.so.0
#21 0x00007ffff76d529c in gtk_builder_add_from_resource ()
at /usr/lib64/libgtk-3.so.0
#22 0x00007ffff76d873a in gtk_builder_new_from_resource ()
at /usr/lib64/libgtk-3.so.0
#23 0x0000000000401296 in create_window (win_id=0x40204b "farma.ui")
at ../src/main.c:33
#24 0x000000000040132e in main (argc=1, argv=0x7fffffffde98) at ../src/main.c:49
(gdb)Each time, I get a message in dmesg:
Code:Code: 00 00 4c 89 f7 e8 90 87 e1 ff 4c 89 ff e8 c8 be e1 ff 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 0f 1f 84 00 00 00 00 00 <48> 8b 47 18 48 8b 40 10 c3 0f 1f 80 00 00 00 00 53 48 8b 5f 18 48I've found some references to this error, but none in the context I'm using it, and none (even those marked 'solved') with an actual indication what's wrong. Most seem to use libglibmm (which I don't). All errors reported have 3 lines - like in my case.
Stepping to the code, I see that the parameters p is '/com/jcoppens/farma/farma.ui', which is correct.
(S)tepping into the next code line produces the error.
I'm running Slackware64 15.0, glibmm2.64.5 (not used in my code), gcc 12.2.0, kernel 5.19.17
Q1: Any suggestions where to look?
Q2: In one of references I found on the net, there was a references about on problems in glibmm around version 2.65 or 2.66. Does it make sense trying a more recent version?
Code:create_window(char *win_id)
{
char *p = g_strdup_printf("%s/%s", RESOURCE_PATH, win_id);
GtkWidget *win;
builder = gtk_builder_new_from_resource(p);
g_free(p);
win = GTK_WIDGET(gtk_builder_get_object(builder, win_id));
g_object_unref(G_OBJECT(builder));
return win;
}The output of the program is:
Code:(process:946): Gtk-CRITICAL **: 22:01:37.141: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(process:946): Gtk-CRITICAL **: 22:01:37.141: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation faultRunning the program in gdb, I get that the error occurs in builder = gtk_builder_new_from_resource(p); The backtrace at this point is:
Code:#1 0x00007ffff7725304 in () at /usr/lib64/libgtk-3.so.0
#2 0x00007ffff7745c38 in () at /usr/lib64/libgtk-3.so.0
#3 0x00007ffff7730bcc in () at /usr/lib64/libgtk-3.so.0
#4 0x00007ffff7745b26 in () at /usr/lib64/libgtk-3.so.0
#5 0x00007ffff7731512 in () at /usr/lib64/libgtk-3.so.0
#6 0x00007ffff7f45b33 in g_type_create_instance ()
at /usr/lib64/libgobject-2.0.so.0
#7 0x00007ffff7f2a700 in () at /usr/lib64/libgobject-2.0.so.0
#8 0x00007ffff7f2bc0c in g_object_new_with_properties ()
at /usr/lib64/libgobject-2.0.so.0
#9 0x00007ffff7f2c7c1 in g_object_new () at /usr/lib64/libgobject-2.0.so.0
#10 0x00007ffff774de8a in () at /usr/lib64/libgtk-3.so.0
#11 0x00007ffff792306d in () at /usr/lib64/libgtk-3.so.0
#12 0x00007ffff7f45b33 in g_type_create_instance ()
at /usr/lib64/libgobject-2.0.so.0
#13 0x00007ffff7f2a700 in () at /usr/lib64/libgobject-2.0.so.0
#14 0x00007ffff7f2bf6c in g_object_newv () at /usr/lib64/libgobject-2.0.so.0
#15 0x00007ffff76d7c44 in () at /usr/lib64/libgtk-3.so.0
#16 0x00007ffff76d9015 in () at /usr/lib64/libgtk-3.so.0
#17 0x00007ffff76d9e97 in () at /usr/lib64/libgtk-3.so.0
#18 0x00007ffff7e2f290 in () at /usr/lib64/libglib-2.0.so.0
#19 0x00007ffff7e30785 in g_markup_parse_context_parse ()
at /usr/lib64/libglib-2.0.so.0
#20 0x00007ffff76daeb6 in () at /usr/lib64/libgtk-3.so.0
#21 0x00007ffff76d529c in gtk_builder_add_from_resource ()
at /usr/lib64/libgtk-3.so.0
#22 0x00007ffff76d873a in gtk_builder_new_from_resource ()
at /usr/lib64/libgtk-3.so.0
#23 0x0000000000401296 in create_window (win_id=0x40204b "farma.ui")
at ../src/main.c:33
#24 0x000000000040132e in main (argc=1, argv=0x7fffffffde98) at ../src/main.c:49
(gdb)Each time, I get a message in dmesg:
Code:Code: 00 00 4c 89 f7 e8 90 87 e1 ff 4c 89 ff e8 c8 be e1 ff 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 0f 1f 84 00 00 00 00 00 <48> 8b 47 18 48 8b 40 10 c3 0f 1f 80 00 00 00 00 53 48 8b 5f 18 48I've found some references to this error, but none in the context I'm using it, and none (even those marked 'solved') with an actual indication what's wrong. Most seem to use libglibmm (which I don't). All errors reported have 3 lines - like in my case.
Stepping to the code, I see that the parameters p is '/com/jcoppens/farma/farma.ui', which is correct.
(S)tepping into the next code line produces the error.
I'm running Slackware64 15.0, glibmm2.64.5 (not used in my code), gcc 12.2.0, kernel 5.19.17
Q1: Any suggestions where to look?
Q2: In one of references I found on the net, there was a references about on problems in glibmm around version 2.65 or 2.66. Does it make sense trying a more recent version?