Bug 148197 - LibreOffice crashes when I try to dock floating Navigator window (GTK3)
Summary: LibreOffice crashes when I try to dock floating Navigator window (GTK3)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.1.3 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.4.0 target:7.3.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2022-03-26 07:59 UTC by Gerry
Modified: 2022-05-13 15:57 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Backtrace gdbtrace.log of crash (12.66 KB, text/x-log)
2022-03-26 07:59 UTC, Gerry
Details
Output of "gdb --pid=$(pidof soffice.bin)" .txt (5.00 KB, text/plain)
2022-03-26 08:11 UTC, Gerry
Details
New gdbtrace.log with debug symbols (13.25 KB, text/x-log)
2022-04-16 09:10 UTC, Gerry
Details
New output (with debug symbols) of "gdb --pid=$(pidof soffice.bin)" .txt (6.58 KB, text/plain)
2022-04-16 09:37 UTC, Gerry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerry 2022-03-26 07:59:18 UTC
Created attachment 179117 [details]
Backtrace gdbtrace.log of crash

In LibreOffice Writer 7.3.1, I noticed that the Navigator was not docked, but in a floating window. When I try to dock the Navigator window pressing Ctrl+Shift+F10, LibreOffice immediately crashes.

This is 100% reproducible.

Steps to reproduce:
1. Open Writer and open the Navigator F5
[2. Undock Navigator window, if it is not yet a floating window]
3. Mouse click into the Navigator window
4. Press Ctrl+Shift+F10 to dock the Navigator window -> Immediate crash


System: Ubuntu 21.10 with Gnome Shell
LibreOffice Version: 7.3.1.3 / LibreOffice Community
Build ID: 30(Build:3)
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Ubuntu package version: 1:7.3.1~rc3-0ubuntu0.21.10.1~lo2
Calc: threaded
[This is the version from the LibreOffice Fresh PPA]

I tested in a new LibreOffice profile.
Comment 1 Gerry 2022-03-26 08:11:49 UTC
Created attachment 179118 [details]
Output of "gdb --pid=$(pidof soffice.bin)" .txt
Comment 2 Gerry 2022-04-01 22:07:09 UTC
Crash reproducible in the new version 7.3.2.2 

The crashes also appear if I deactivate hardware acceleration in options -> view.

Version: 7.3.2.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Ubuntu package version: 1:7.3.2~rc2-0ubuntu0.21.10.1~lo1
Calc: threaded
Comment 3 Gerry 2022-04-09 17:50:54 UTC
As it might be relevant for this bug: 

processor: AMD® Ryzen 7 pro 4750u with radeon graphics × 16 
graphics: AMD® Renoir

06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev d1) (prog-if 00 [VGA controller])
        Subsystem: Lenovo Renoir
        Kernel driver in use: amdgpu
Comment 4 Xisco Faulí 2022-04-11 09:28:12 UTC
Reproduced in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: b812150696c574aea0a173d11f178e8d458b1a3e
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 5 Xisco Faulí 2022-04-11 09:49:35 UTC
Regression introduced by:

author	Jim Raykowski <raykowj@gmail.com>	2021-10-19 02:10:41 -0800
committer	Jim Raykowski <raykowj@gmail.com>	2021-10-22 04:19:10 +0200
commit 58a3e2a6fad68d8d5e6091e063c0b26e3608f998 (patch)
tree 4a911eaea8dea82b947da8143f4a7bab6d70de3c
parent cb56ec6aa8f03fbc70c808bd4f519ce9d3c21f7d (diff)
tdf#144999 SwNavigator: Add way to collapse all categories

Bisected with: bibisect-linux64-7.3

Adding Cc: to Jim Raykowski
Comment 6 Xisco Faulí 2022-04-11 09:50:42 UTC
Only reproducible with GTK3. @Caolán, I thought you might be interested in this issue
Comment 7 Jim Raykowski 2022-04-11 20:16:59 UTC
Seems odd that that patch would cause crash on Ctrl+Shift+F10.

I can't repro using:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 7a16002ede5fd31ae8f3358136ad49de40465ac1
CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 8 Xisco Faulí 2022-04-13 08:44:36 UTC
(In reply to Jim Raykowski from comment #7)
> Seems odd that that patch would cause crash on Ctrl+Shift+F10.
> 
> I can't repro using:
> 
> Version: 7.4.0.0.alpha0+ / LibreOffice Community
> Build ID: 7a16002ede5fd31ae8f3358136ad49de40465ac1
> CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: gtk3
> Locale: en-US (en_US.UTF-8); UI: en-US
> Calc: threaded

In my case, it crashes with the following steps:
1. Clean the user profile
2. Launch Writer
3. Open the Navigator
4. Resize the navigator window
5. Ctrl+Shift+F10

-> Crash
Comment 9 Jim Raykowski 2022-04-13 20:50:40 UTC
(In reply to Xisco Faulí from comment #8)
> In my case, it crashes with the following steps:
> 1. Clean the user profile
> 2. Launch Writer
> 3. Open the Navigator
> 4. Resize the navigator window
> 5. Ctrl+Shift+F10
> 
> -> Crash

I still don't repro crash. 

This message shows in the terminal each time the focus is in the navigator content tree and Ctrl+Shift+F10 is done:

(soffice:3009942): Gtk-CRITICAL **: 12:26:16.305: gtk_tree_row_reference_new_proxy: assertion 'path->depth > 0' failed

Possibly the version of gtk3 has something to do with not being able to repro crash?

gtk-launch --version
3.24.20
Comment 10 Gerry 2022-04-13 21:22:55 UTC
(In reply to Jim Raykowski from comment #9)
> (In reply to Xisco Faulí from comment #8)
> 
> Possibly the version of gtk3 has something to do with not being able to
> repro crash?
> 
> gtk-launch --version
> 3.24.20


I get the crashes with following gtk3 version (on Ubuntu 21.10):
~$ gtk-launch --version
3.24.30

By the way, I only have to follow the following 3 steps (that Xisco mentioned) to crash LibreOffice 
2. Launch Writer
3. Open the Navigator
5. Ctrl+Shift+F10

-> immediate crash, 100% reproducible
Comment 11 Caolán McNamara 2022-04-14 08:20:47 UTC
I don't get a crash, but I do see the warning of comment #9 in trunk. For the warning I have https://gerrit.libreoffice.org/c/core/+/132996 to resolve that
Comment 12 Commit Notification 2022-04-14 10:17:02 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#148197 gtk_tree_row_reference_new_proxy warning on docking navigator

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 13 Gerry 2022-04-14 11:34:46 UTC
(In reply to Caolán McNamara from comment #11)
> I don't get a crash, but I do see the warning of comment #9 in trunk. For
> the warning I have https://gerrit.libreoffice.org/c/core/+/132996 to resolve
> that

@Caolán: Were the attached gdb logs helpful to identify the cause of the crashes? Or do you require any other backtrace / log ...?
Comment 14 Caolán McNamara 2022-04-14 11:42:50 UTC
The original backtraces are:
#0  0x00007fcdeb112e2a in gtk_tree_model_get_iter () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#1  0x00007fcdeb113091 in gtk_tree_model_get_iter_first () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#2  0x00007fcdeb6dfd33 in ?? () from /usr/lib/libreoffice/program/libvclplug_gtk3lo.so
#3  0x00007fcdb58f503e in ?? () from /usr/lib/libreoffice/program/libswlo.so

and lack symbols to see what line numbers in writer trigger the problem you have (which *might* be the same problem I saw). Your distro and libreoffice are the ubuntu ones so installing "libreoffice-dbg" might give a better backtrace.
Comment 15 Gerry 2022-04-16 09:10:23 UTC
Created attachment 179605 [details]
New gdbtrace.log with debug symbols

I obtained the dbgsym packages for the LibreOffice Fresh PPA. Here is the gdbtrace.log (soffice --backtrace) with debug symbols.
Comment 16 Gerry 2022-04-16 09:37:46 UTC
Created attachment 179606 [details]
New output (with debug symbols) of "gdb --pid=$(pidof soffice.bin)" .txt

Here the new gdb output with debug symbols.

@caolanm: Please let me know if the two debug outputs were helpful or whether you require anything else.
Comment 17 Caolán McNamara 2022-04-16 11:27:23 UTC
perfect, that gives me what I need to know.

#0  0x00007f37e8625e2a in gtk_tree_model_get_iter () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#1  0x00007f37e8626091 in gtk_tree_model_get_iter_first () from /lib/x86_64-linux-gnu/libgtk-3.so.0
#2  0x00007f37e8bf3eb3 in virtual thunk to (anonymous namespace)::GtkInstanceTreeView::get_iter_first(weld::TreeIter&) const () at ./vcl/unx/gtk3/gtkinst.cxx:12846
#3  0x00007f37c56c7eee in SwContentTree::CommandHdl (this=0x55b6c3e5a5e0, rCEvt=...) at /usr/include/c++/11/bits/unique_ptr.h:173
#4  0x00007f37e8c14cc7 in (anonymous namespace)::GtkInstanceWidget::signalPopupMenu (pWidget=0x7ffe668b3590, widget=0x55b6c3e67a50) at ./vcl/unx/gtk3/gtkinst.cxx:2639
...
#19 0x00007f37e8682a5b in gtk_window_propagate_key_event () from /lib/x86_64-linux-gnu/libgtk-3.so.0

so this suggests that the context menu is triggered by the keystroke and the problem is with the context menu when nothing is selected in the treeview, but focus is in there.

And I can reproduce by launching the navigator, click a row in the treeview, click the row again to unselect it (but focus is still in there) and press (on my keyboard) the dedicated "menu" button.
Comment 18 Commit Notification 2022-04-16 13:22:11 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/95ee4f074f387b498a9083524a13dff636446fe7

Resolves: tdf#148197 crash on launching context menu with no row selected

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 19 Caolán McNamara 2022-04-16 13:23:24 UTC
done in trunk, backports to 7-3 and 7-3-3 in gerrit
Comment 20 Commit Notification 2022-04-16 19:52:46 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/a24a97f7d3ae88d81df3341bfc4296ab4a7237fb

Resolves: tdf#148197 crash on launching context menu with no row selected

It will be available in 7.3.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 21 Commit Notification 2022-04-19 10:10:55 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-3-3":

https://git.libreoffice.org/core/commit/0fc0d1a9fb14a23357219e797e1b35092f7d8ee6

Resolves: tdf#148197 crash on launching context menu with no row selected

It will be available in 7.3.3.

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 22 Commit Notification 2022-04-19 11:56:25 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/ffa172fc6b98d7d7dd3928693035a34cd331fe12

tdf#148197 gtk_tree_row_reference_new_proxy warning on docking navigator

It will be available in 7.3.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 23 Commit Notification 2022-04-24 20:01:05 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-3-3":

https://git.libreoffice.org/core/commit/2f41ffb8e4a76aedd96240a32d09d8217815cde5

tdf#148197 gtk_tree_row_reference_new_proxy warning on docking navigator

It will be available in 7.3.3.

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 24 Commit Notification 2022-05-13 15:57:43 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5fa5a6b4353d47ab286e16e72bd4c440a95b2bdb

Related: tdf#148197 gtk_tree_view_scroll_to_cell needs either path or column

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.