Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 695326

Summary: gnome-base/gnome-control-center-3.32.2: Error building template class 'CcApplicationsPanel' for an instance of type 'CcApplicationsPanel': Invalid object type 'CcToggleRow'
Product: Gentoo Linux Reporter: Chris Mayo <aklhfex>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: normal CC: ahvenas, da5id2001, emeric.maschino, firefly_dude0k, spikyatlinux
Priority: Normal Keywords: EBUILD
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=903129
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch removing Applications panel
gnome-control-center CLI
Gnome-control-center strace
emerge-info
gdb output
strace output
Patch to try
fixed missing some custom widget type issue

Description Chris Mayo 2019-09-21 17:03:24 UTC
Created attachment 590538 [details, diff]
Patch removing Applications panel

I managed to run gnome-control-center once. The second and subsequent times I tried to start it it crashed with messages including:

(gnome-control-center:456): Gtk-CRITICAL **: Error building template class 'CcApplicationsPanel' for an instance of type 'CcApplicationsPanel': .:2:3512 Invalid object type 'CcToggleRow'

ERROR:../gnome-control-center-3.32.2/shell/cc-panel.c:243:cc_panel_get_sidebar_widget: assertion failed: (sidebar_widget != NULL)
Aborted


I believe the last panel I had clicked on was the Applications panel. I've worked around this by re-building without the Applications panel (patch attached).
Comment 1 Rémi Cardona (RETIRED) gentoo-dev 2019-09-30 18:52:44 UTC
got that one, clicking on the "applications" panel as well. I tried launching g-c-c with another panel on the cli, same crash
Comment 2 Rémi Cardona (RETIRED) gentoo-dev 2019-10-12 07:29:55 UTC
I've looked a bit at the git repo and there's a ton of commits related to segfaults in half the panels. It's hard to figure out which one will fix this one particular crash when it looks like the whole application is very fragile. It's somewhat worrisome.

Anyhow, found another workaround that doesn't involve any patching or rebuilding:

    dconf reset /org/gnome/control-center/last-panel

That will make g-c-c forget the last panel you clicked on and will let you access the other, not broken, panels.
Comment 3 Mart Raudsepp gentoo-dev 2020-03-15 19:39:46 UTC
Hopefully 3.34.4 is better on this?
Comment 4 Bernd Feige 2020-03-16 10:05:58 UTC
(In reply to Mart Raudsepp from comment #3)
> Hopefully 3.34.4 is better on this?

Not here - gnome-base/gnome-control-center-3.34.4 and the application panel still crashes, still need to reset the last panel to start g-c-c again...
Comment 5 Émeric Maschino 2020-04-21 16:18:20 UTC
Same issue here on ia64.

BTW, what g-c-c' Applications panel is supposed to do/show? I don't remember the previous releases. Or is it an new panel introduced with >=gnome-base/gnome-control-center-3.32.2?
Comment 6 Mart Raudsepp gentoo-dev 2020-04-21 16:22:23 UTC
You can do per-application settings in there, like if it's allowed to send desktop notifications, micro-manage mime type associations (e.g. unset an application from handling a certain file type), toggle gnome-shell search integration enablement, etc.

I still can't reproduce the issue, unfortunately.
Comment 7 Brandon Penglase 2020-05-17 13:54:47 UTC
Created attachment 639836 [details]
gnome-control-center CLI

So I'm getting this now too (hadn't noticed it before at least).
Attached on this one is the output on the console, first of a failed launch, then a reset, then a successful launch.
I'll also attach an strace, and emerge --info. I'm wondering if it's down to a  specific app that's installed, that for reason is causing it when it tries to display. Hence it happening for some, but not others.
Comment 8 Brandon Penglase 2020-05-17 13:55:18 UTC
Created attachment 639838 [details]
Gnome-control-center strace
Comment 9 Brandon Penglase 2020-05-17 13:57:42 UTC
Created attachment 639840 [details]
emerge-info

I also had just rebuilt it in case, but no help.

[ebuild   R    ] gnome-base/gnome-control-center-3.34.5:2::gentoo  
USE="cups gnome-online-accounts ibus systemd -bluetooth -debug (-elogind) -flickr -kerberos -networkmanager -test -v4l -wayland" 
INPUT_DEVICES="-wacom" 0 KiB
Comment 10 Mart Raudsepp gentoo-dev 2020-05-17 14:25:56 UTC
From a short look together with Soap__ on IRC, it seems to be a problem of the necessary code somehow being optimized out of the final binary or something.
As in, those experiencing the problem don't have this command return anything, for example:

nm -D /usr/bin/gnome-control-center |grep cc_toggle_row_ne

For me that gives
000000000005fff0 T cc_toggle_row_new
so the GtkBuilder UI file can find the CcToggleRow stuff fine from the type machinery and instantiate this for the applications panel.

I don't see anything in the single emerge --info I see here that could cause this different compilation from me.
Please check with that nm command, that you are ending up in the same specific issue that it did for Soap__
Comment 11 Brandon Penglase 2020-05-17 15:21:10 UTC
(In reply to Mart Raudsepp from comment #10)

> nm -D /usr/bin/gnome-control-center |grep cc_toggle_row_ne
> 
> For me that gives
> 000000000005fff0 T cc_toggle_row_new
> so the GtkBuilder UI file can find the CcToggleRow stuff fine from the type
> machinery and instantiate this for the applications panel.
> 

It returns nothing for me. 

brandon@Rostia ~ $ nm -D /usr/bin/gnome-control-center |grep cc_toggle_row_ne
brandon@Rostia ~ $ 

FWIW, under the Config stage of the ebuild, I noticed this: 
     Optimized .................................. false

Also, I rebuilt with this: 
LDFLAGS="" CFLAGS="-march=znver2" CXXFLAGS="-march=znver2" USE="debug" emerge gnome-control-center

and nm still returns blank.
Comment 12 Brandon Penglase 2020-05-17 16:07:49 UTC
Some stabs in the dark here, since I'm not fully familiar with it, but it does seem to build cc-toggle-row.c.o, which has that output:

Rostia /var/tmp/portage/portage/gnome-base/gnome-control-center-3.34.5/work/gnome-control-center-3.34.5-build/panels/applications/cd6fcfa@@applications@sta # nm cc-toggle-row.c.o  | grep cc_toggle_row_new
0000000000000230 T cc_toggle_row_new

Is that maybe not being included in the final binary for some reason?
Comment 13 Mart Raudsepp gentoo-dev 2020-05-17 16:25:23 UTC
I'd suspect more in the direction of "optimized out"
Comment 14 Mart Raudsepp gentoo-dev 2020-05-17 20:04:11 UTC
What if you put this into cc_applications_panel_class_init function in panels/applications/cc-applications-panel.c

CC_TYPE_TOGGLE_ROW();
Comment 15 Brandon Penglase 2020-05-18 13:08:36 UTC
(In reply to Mart Raudsepp from comment #14)
> What if you put this into cc_applications_panel_class_init function in
> panels/applications/cc-applications-panel.c
> 
> CC_TYPE_TOGGLE_ROW();

It fails the compile:
FAILED: panels/applications/cd6fcfa@@applications@sta/cc-applications-panel.c.o 
x86_64-pc-linux-gnu-gcc -Ipanels/applications/cd6fcfa@@applications@sta -Ipanels/applications -I../gnome-control-center-3.34.5/panels/applications -I. -I../gnome-control-center-3.34.5 -Ipanels/common -I../gnome-control-center-3.34.5/panels/common -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gsettings-desktop-schemas -I/usr/include/libhandy-0.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/uuid -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/at-spi-2.0 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -O2 -march=znver2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -mmovbe -maes -msha -mpclmul -mpopcnt -mabm -mfma -mbmi -mbmi2 -mwbnoinvd -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mclflushopt -mxsavec -mxsaves -mclwb -mmwaitx -mclzero -mrdpid --param l1-cache-size=768 --param l1-cache-line-size=768 --param l2-cache-size=6144 -mtune=znver2 -fforce-addr -fomit-frame-pointer -fPIC -pthread '-DG_LOG_DOMAIN="applications-cc-panel"' '-DPANEL_ID="applications"' '-DGNOMELOCALEDIR="/usr/share/locale"' -MD -MQ 'panels/applications/cd6fcfa@@applications@sta/cc-applications-panel.c.o' -MF 'panels/applications/cd6fcfa@@applications@sta/cc-applications-panel.c.o.d' -o 'panels/applications/cd6fcfa@@applications@sta/cc-applications-panel.c.o' -c ../gnome-control-center-3.34.5/panels/applications/cc-applications-panel.c
../gnome-control-center-3.34.5/panels/applications/cc-applications-panel.c:21: warning: "G_LOG_DOMAIN" redefined
   21 | #define G_LOG_DOMAIN "cc-applications-panel"
      | 
<command-line>: note: this is the location of the previous definition
In file included from ../gnome-control-center-3.34.5/panels/applications/cc-applications-panel.c:30:
../gnome-control-center-3.34.5/panels/applications/cc-applications-panel.c: In function ‘cc_applications_panel_class_init’:
../gnome-control-center-3.34.5/panels/applications/cc-toggle-row.h:27:29: error: called object is not a function or function pointer
   27 | #define CC_TYPE_TOGGLE_ROW (cc_toggle_row_get_type())
      |                            ~^~~~~~~~~~~~~~~~~~~~~~~~~
../gnome-control-center-3.34.5/panels/applications/cc-applications-panel.c:1650:3: note: in expansion of macro ‘CC_TYPE_TOGGLE_ROW’
 1650 |   CC_TYPE_TOGGLE_ROW();
      |   ^~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
Comment 16 Brandon Penglase 2020-06-10 12:58:58 UTC
FWIW, 3.34.5-r1 is still failing to the same error.

(gnome-control-center:133383): Gtk-CRITICAL **: 08:55:53.956: gtk_size_group_add_widget: assertion 'GTK_IS_WIDGET (widget)' failed
**
ERROR:../gnome-control-center-3.34.5/shell/cc-panel.c:232:cc_panel_get_sidebar_widget: assertion failed: (sidebar_widget != NULL)
Bail out! ERROR:../gnome-control-center-3.34.5/shell/cc-panel.c:232:cc_panel_get_sidebar_widget: assertion failed: (sidebar_widget != NULL)
Aborted (core dumped)
Comment 17 Henrik Pihl 2020-07-21 11:28:39 UTC
Situation is still the same with freshly rebuilt 3.36.4, same error messages and same workaround with dconf to get the app open again. No cc_* rows in the nm -D output as well.
Comment 18 Mart Raudsepp gentoo-dev 2020-07-21 11:37:39 UTC
I use these CFLAGS with things working fine:
CFLAGS="-O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches"
(FEATURES=splitdebug also of course, due to the -ggdb2)

I wonder if someone that is able to reproduce the issue can get it working with tweaking their CFLAGS, perhaps adding -ggdb2 for this or something, to narrow it down a bit in what situations it might get badly optimized out and when not.
Comment 19 Henrik Pihl 2020-07-21 13:15:06 UTC
From the reinstalled gnome-control-center-3.36 package:

FEATURES="pid-sandbox sandbox usersync news config-protect-if-modified merge-sync assume-digests binpkg-logs distlocks ccache strict fixlafiles unknown-features-warn ebuild-locks binpkg-docompress sign unmerge-orphans multilib-strict network-sandbox preserve-libs protect-owned sfperms usersandbox userpriv parallel-fetch binpkg-dostrip splitdebug unmerge-logs qa-unresolved-soname-deps userfetch xattr ipc-sandbox"
CFLAGS="-O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches"

Situation has not changed. One thing that is also corrupt is the icon for non-functional Applications: https://imgur.com/a/FRLUP6c 
The real icon can be seen here: https://commons.wikimedia.org/wiki/File:GNOME_Control_Center.png
Am I the only one?
Comment 20 Mart Raudsepp gentoo-dev 2020-07-21 14:41:57 UTC
The icon is probably assumed to come from adwaita-icon-theme-3.34 or 3.36, which we don't have, because most of the scalable icons would look broken with librsvg-2.40, so these have been delayed. Only having one icon known broken so far from this isn't too much of a problem, considering this is ~arch. Though librsvg-2.46+ work is planned soon for main tree as one next bigger thing (it is written in rust language), but irrelevant to this bug entry here.
Comment 21 Brandon Penglase 2020-07-21 23:15:44 UTC
Created attachment 650142 [details]
gdb output
Comment 22 Brandon Penglase 2020-07-21 23:19:38 UTC
Created attachment 650146 [details]
strace output

I rebuilt with the following command: 
SE="${USE} debug" CFLAGS="-O2 -pipe -march=native -fno-omit-frame-pointer -ggdb2 -frecord-gcc-switches" FEATURES="splitdebug" emerge gnome-control-center

gcc 10.1.0. FWIW, 3900x on X570, 32G RAM, nvme storage.

It still happens. Attached are the output of gdb (opening and clicking applications), and strace (running just after gdb).
Comment 23 Georgi 2020-07-25 18:31:00 UTC
I think I created that issue by firstly using Gnome Tweaks and using Reset to Defaults option globally. The issue still persists since 3.32 through 3.36.
Comment 24 Mart Raudsepp gentoo-dev 2020-07-25 20:06:06 UTC
To confirm the symbol problem, someone could try adding
LDFLAGS="${LDFLAGS} -Wl,--no-as-needed"
temporarily for gnome-control-center build and see if it starts working when it didn't before.
Comment 25 Henrik Pihl 2020-07-25 20:17:43 UTC
The LDFLAGS change didn't change anything for me, still the same error.
Comment 26 Mart Raudsepp gentoo-dev 2020-07-25 21:18:54 UTC
ok, thanks, no point for others to test that part then. Figured it might workaround the issue, but it not helping doesn't mean it's not a symbol issue - it clearly is based on the nm outputs.

In any case, it would be nice if someone could work with upstream on this. It seems the symbols get optimized out in some situations on some setups, but then they need to be used via GtkBuilder UI files (which is something a compiler doesn't see), so hence the failures.
Comment 27 Jeongsu Kim 2020-07-28 09:12:33 UTC
hello.

I faced same issue and googled it and found this.
https://stackoverflow.com/questions/24235937/custom-gtk-widget-with-template-ui

I made some patch and it works

cat /etc/portage/patches/gnome-base/gnome-control-center/gnome-control-center-application.patch 
diff -urN gnome-control-center-3.34.5.orig/shell/meson.build gnome-control-center-3.34.5/shell/meson.build
--- gnome-control-center-3.34.5.orig/shell/meson.build	2020-07-28 17:06:45.588081492 +0900
+++ gnome-control-center-3.34.5/shell/meson.build	2020-07-28 18:03:05.185763440 +0900
@@ -130,7 +130,8 @@
          dependencies : shell_deps,
                c_args : cflags,
             link_with : panels_libs,
-              install : true
+              install : true,
+			link_args : '-rdynamic'
 )
Comment 28 Henrik Pihl 2020-07-28 09:55:06 UTC
(In reply to Jeongsu Kim from comment #27)
> hello.
> 
> I faced same issue and googled it and found this.
> https://stackoverflow.com/questions/24235937/custom-gtk-widget-with-template-
> ui
> 
> I made some patch and it works
> 
> cat
> /etc/portage/patches/gnome-base/gnome-control-center/gnome-control-center-
> application.patch 
> diff -urN gnome-control-center-3.34.5.orig/shell/meson.build
> gnome-control-center-3.34.5/shell/meson.build
> --- gnome-control-center-3.34.5.orig/shell/meson.build	2020-07-28
> 17:06:45.588081492 +0900
> +++ gnome-control-center-3.34.5/shell/meson.build	2020-07-28
> 18:03:05.185763440 +0900
> @@ -130,7 +130,8 @@
>           dependencies : shell_deps,
>                 c_args : cflags,
>              link_with : panels_libs,
> -              install : true
> +              install : true,
> +			link_args : '-rdynamic'
>  )

Also fixes the issue with 3.36.4.
Comment 29 Mart Raudsepp gentoo-dev 2020-07-28 09:57:22 UTC
We should write and upstream a solution as per 1) there - making a cc_toggle_row_get_type call in an appropriate place. However I remember having Soap__ try this over irc, and didn't help. But perhaps it was not an appropriate place.
Comment 30 Mart Raudsepp gentoo-dev 2020-07-28 10:09:09 UTC
Created attachment 651132 [details, diff]
Patch to try

Please try this patch INSTEAD of any -rdynamic or other tweaks and let me know if this solves it as well. This one should be upstreamable then, and I'll take it there if it fixes it for you guys
Comment 31 Henrik Pihl 2020-07-28 10:19:45 UTC
(In reply to Mart Raudsepp from comment #30)
> Created attachment 651132 [details, diff] [details, diff]
> Patch to try
> 
> Please try this patch INSTEAD of any -rdynamic or other tweaks and let me
> know if this solves it as well. This one should be upstreamable then, and
> I'll take it there if it fixes it for you guys

Crashes at the usual place - there is no difference in normal error output with or without that patch.
Comment 32 Mart Raudsepp gentoo-dev 2020-07-28 10:25:30 UTC
OK, thanks, this is more involved then.
Comment 33 Jeongsu Kim 2020-07-29 03:01:42 UTC
Created attachment 651342 [details, diff]
fixed missing some custom widget type issue

I made another patch and it works fine.
Please check this patch.
Comment 34 Henrik Pihl 2020-07-29 09:27:53 UTC
(In reply to Jeongsu Kim from comment #33)
> Created attachment 651342 [details, diff] [details, diff]
> fixed missing some custom widget type issue
> 
> I made another patch and it works fine.
> Please check this patch.

Fixes the issue on 3.36.4.
Comment 35 Mart Raudsepp gentoo-dev 2020-07-29 09:34:41 UTC
(In reply to Jeongsu Kim from comment #33)
> Created attachment 651342 [details, diff] [details, diff]
> fixed missing some custom widget type issue
> 
> I made another patch and it works fine.
> Please check this patch.

Can you please go upstream with this patch too?

https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests
Comment 36 Jeongsu Kim 2020-07-29 12:43:47 UTC
(In reply to Mart Raudsepp from comment #35)
> (In reply to Jeongsu Kim from comment #33)
> > Created attachment 651342 [details, diff] [details, diff] [details, diff]
> > fixed missing some custom widget type issue
> > 
> > I made another patch and it works fine.
> > Please check this patch.
> 
> Can you please go upstream with this patch too?
> 
> https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests

I wrote merge request.
https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/802
Comment 37 Bernd Feige 2020-12-20 08:43:35 UTC
(In reply to Jeongsu Kim from comment #36)
> I wrote merge request.
> https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/802

Seems that this was cherrypicked for 3.36 and with current g-c-c 3.36.4 the applications tab actually works for me.
Comment 38 Chris Mayo 2020-12-20 19:46:37 UTC
Looks like it's in 3.36.5 to me:

https://gitlab.gnome.org/GNOME/gnome-control-center/-/commits/gnome-3-36/#commit-1cd98472
Comment 39 Larry the Git Cow gentoo-dev 2021-01-09 17:48:35 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=820ecba8c45da3239dc5478617c2734d8f143b1f

commit 820ecba8c45da3239dc5478617c2734d8f143b1f
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2021-01-09 17:39:21 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2021-01-09 17:48:20 +0000

    gnome-base/gnome-control-center: Version bump to 3.36.5
    
    Closes: https://bugs.gentoo.org/695326
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 gnome-base/gnome-control-center/Manifest           |   2 +
 .../gnome-control-center-3.36.5.ebuild             | 180 +++++++++++++++++++++
 2 files changed, 182 insertions(+)