Bug 145786 - Crash in: libgobject-2.0.so.0 Gtk-CRITICAL when attempting to change color palette (UI, Sidebar)
Summary: Crash in: libgobject-2.0.so.0 Gtk-CRITICAL when attempting to change color pa...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.2.2.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0 target:7.2.5 target:7.4....
Keywords:
Depends on:
Blocks: HiDPI GTK3
  Show dependency treegraph
 
Reported: 2021-11-20 05:15 UTC by Tom
Modified: 2022-01-21 01:50 UTC (History)
5 users (show)

See Also:
Crash report or crash signature: ["libgobject-2.0.so.0"]
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom 2021-11-20 05:15:08 UTC
Description:

LibreOffice (Draw & Impress) crashes when clicking on any of the color palette dropdowns from the Sidebar -> Properties. LO outputs the following error on the stderr: "Gtk-CRITICAL **: gtk_toggle_button_set_active: assertion 'GTK_IS_TOGGLE_BUTTON (toggle_button)' failed"

Steps to reproduce:

1) Open a new Draw document;
2) Draw any shape (say, rectangle);
3) From the Sidebar (Ctrl+F5), go to Properties -> Area -> Fill Color;
4) Open the Color selection and click on the dropdown to change the active palette;
5) A blank combo opens instead of the dropdown list, LO freezes and crashes.

Expected result:

A dropdown list with available list of color palettes should open when one can select the palette and then select the desired color from it.

Actual result:

LO freezes with a white blank window appearing in place where the dropdown list is expected. LO's UI is no longer responding and it has to be forced to quit / the process killed. Not sure if the error outputted to stderr is related but when the crash occurs the message says:

Gtk-CRITICAL **: gtk_toggle_button_set_active: assertion 'GTK_IS_TOGGLE_BUTTON (toggle_button)' failed

Reproducible:

Always

Tested with 7.2.0.4 (Fresh) as well as 7.2.2.2 with a fresh user profile, both experience the same issue. Note that this seems to be only happening with the color selectors from the Sidebar, everywhere else it works as expected (e.g. via the 'Area' properties windows, toolbars, etc.). 


This bug was filed from the crash reporting server and is br-e92f7225-2db4-401e-94e3-365cab06ec65.
=========================================
Comment 1 Tom 2021-11-20 05:22:59 UTC
Tested with AppImage 7.2.0.4 (Fresh) to rule out external factors - same result: UI freeze or crash and the Gtk-CRITICAL error.

Also, the same happens in Writer, Impress, Calc - when trying to use the color selector and change palette from the Sidebar -> Properties it crashes every time.

Note, this is only happening when using the color selector from the Sidebar.
Comment 2 Julien Nabet 2021-11-20 08:40:03 UTC
On pc Debian testing x86-64 with master sources updated today or with LO Debian package 7.2.2.2, I don't reproduce this.
I can select other palettes like "compatibility", "custom", "tonal", etc.

On which Linux distrib are you and with which version?
How did you install LO 7.2.2 ?
What's your precise gtk version?
Comment 3 Tom 2021-11-20 11:52:48 UTC
Distro: Linux Mint 20.2 Cinnamon
Installed from LibreOffice Fresh PPA (ppa:libreoffice/ppa)
libgtk: 3.24.20 (3.24.20-0ubuntu1)

Just tried another scenario (with 7.2.2 from PPA, as well as 7.2.0.4 from an AppImage):

It works if I navigate the dropdown using only the keyboard, I can change the palette fine, however if I then try to do the same with the mouse it crashes the moment I click on the dropdown.

Not sure if related, but this is on a HiDPI screen (I have no means to test in other environment right now). Since it crashed even when running LO as AppImage I wonder, could this actually be the window manager bug rather than LO?
Comment 4 Tom 2021-11-20 15:01:22 UTC
Hi Julien,

I did a little bit more testing and it does appear to be related to the fact that I'm on a HiDPI display with x2 scaling. After switching window scaling to x1 (using the GTK Inspector, i.e. run with GTK_DEBUG=interactive), there is no issue and the dropdown works as expected without crashing LO.

Steps to reproduce:

Note: I'm using the AppImage here to simplify testing and rule out the environment.

1) Run with the GTK Inspector enabled

GTK_DEBUG=interactive ./LibreOffice-fresh.basic-x86_64.AppImage

2) Using the inspector: Visual -> set Window Scaling to 1

Follow the steps 2-4 from Comment#0 -- works as expected.

3) Using the inspector: Visual -> set Window Scaling to 2

Follow the steps 2-4 from Comment#0 -- blank rectangle in place of the dropdown list and LO crashes

Would you be able to test it on your set-up please?
Comment 5 Julien Nabet 2021-11-20 21:37:26 UTC
(In reply to Tom from comment #4)
> Hi Julien,
> 
> ...
> Would you be able to test it on your set-up please?

I didn't know GTK Inspector, I gave a try and put Window Scaling at 2, I could reproduce this with LO Debian package 7.2.2.2 with this bt:
#0  0x00007f4f66783396 in g_type_check_instance_cast () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1  0x00007f4f606127ee in  () at /usr/lib/libreoffice/program/libvclplug_gtk3lo.so
#2  0x00007f4f600dbe67 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#3  0x00007f4f667626df in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4  0x00007f4f66774b36 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5  0x00007f4f6677aabb in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6  0x00007f4f6677b4ff in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7  0x00007f4f60085a14 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#8  0x00007f4f5ff38fe0 in  () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#9  0x00007f4f5ff3ac43 in gtk_main_do_event () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#10 0x00007f4f5fc227a5 in  () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#11 0x00007f4f5fc562b2 in  () at /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#12 0x00007f4f6666dc7b in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007f4f6666df28 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007f4f6666dfdf in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007f4f60606f34 in  () at /usr/lib/libreoffice/program/libvclplug_gtk3lo.so
#16 0x00007f4f6a5aa3c2 in  () at /usr/lib/libreoffice/program/libmergedlo.so
#17 0x00007f4f6a5ac975 in Application::Execute() () at /usr/lib/libreoffice/program/libmergedlo.so

but not with master sources updated today.

Perhaps it's already fixed in next 7.2.3 which will be released very soon (see https://wiki.documentfoundation.org/ReleasePlan/7.2) or the fix is only from 7.2.4 or even later in future 7.3.0 (which will be released at the end of January 2022, see https://wiki.documentfoundation.org/ReleasePlan/7.3)
Comment 6 Caolán McNamara 2021-11-21 19:38:44 UTC
I can't reproduce this, but I assume its with x11 rather than wayland, and I'd guess it is something to do with the funky grab_broken handlers of vcl/unx/gtk3/gtkinst.cxx
Comment 7 Commit Notification 2021-11-22 08:48:16 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/131c1c7da8c567636ca55751e49d24cb6d6c9b9e

Related: tdf#145786 cooperate between our own grabs

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Caolán McNamara 2021-11-22 09:06:32 UTC
its possible the above improves this, there is a backport of same to 7-2 in gerrit now
Comment 9 Commit Notification 2021-11-22 10:51:57 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/b80b17884962c5e2f50c734f153825c0e37605e2

Related: tdf#145786 cooperate between our own grabs

It will be available in 7.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Tom 2021-11-23 01:36:45 UTC
(In reply to Caolán McNamara from comment #6)
> I can't reproduce this, but I assume its with x11 rather than wayland, and
> ...

Yes, I can confirm that's on x11 not wayland
Comment 11 Tom 2021-11-23 01:38:48 UTC
(In reply to Commit Notification from comment #9)
> Caolán McNamara committed a patch related to this issue.
> It has been pushed to "libreoffice-7-2":
> ...
> It will be available in 7.2.4.
> 
> Affected users are encouraged to test the fix and report feedback.

Thank you for looking into this.
I'll test the referred daily builds as soon as these are available.
Comment 12 Tom 2021-11-25 07:50:00 UTC
(In reply to Commit Notification from comment #9)
> Caolán McNamara committed a patch related to this issue.
> It has been pushed to "libreoffice-7-2":
> 
> https://git.libreoffice.org/core/commit/
> b80b17884962c5e2f50c734f153825c0e37605e2
>
> ... 
>
> Affected users are encouraged to test the fix and report feedback.

Unfortunately I could still reproduce this with the most recent daily builds:

LibreOfficeDev 7.2.4.0.0 9c0b3697084cdda149705789365f63e8293e0092
LibreOfficeDev 7.3.0.0.alpha1 515682539623c9d61921c4f89302ffa0a4cb8d24

Is there anything else I could do to help out?
Comment 13 Caolán McNamara 2021-11-25 12:36:03 UTC
ok, I can reproduce this now and I have a plan B
Comment 14 Commit Notification 2021-11-25 14:06:01 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d69b3007b6417395ac726c1c3ef1466f7cb2f829

Resolves: tdf#145786 get the correct bounds with window scaling enabled

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Caolán McNamara 2021-11-25 14:07:07 UTC
looks good in trunk, backport to 7-2 in gerrit
Comment 16 Commit Notification 2021-11-26 10:36:32 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/26227a0bf6adc64e1a94fd655782054ac92d0993

Resolves: tdf#145786 get the correct bounds with window scaling enabled

It will be available in 7.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Tom 2021-11-27 09:48:07 UTC
I can confirm it now works as expected in the following daily build:

LibreOfficeDev 7.2.4.0.0 26227a0bf6adc64e1a94fd655782054ac92d0993

Thank you for fixing this.
Comment 18 Christian Lohmaier 2021-12-06 13:28:48 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard
Comment 19 Commit Notification 2021-12-09 08:33:07 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/27487243c3ee31927e17a0859614ffa0df7881d7

Related: tdf#145786 cooperate between our own grabs

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2021-12-09 08:34:22 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/53200987febc88b0f6f1a8fb15dee7ada9cf805f

Related: tdf#145786 cooperate between our own grabs

It will be available in 7.3.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 BogdanB 2022-01-21 01:50:57 UTC
Verified. 

No crash in
Version: 7.3.1.0.0+ / LibreOffice Community
Build ID: 216ad305810d1d36cf5874fd9842111d426899a8
CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded