Bug 157277 - CRASH Writer crashing when hiding Sidebar and using Navigator to go to bookmark
Summary: CRASH Writer crashing when hiding Sidebar and using Navigator to go to bookmark
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:24.2.0 target:7.6.2
Keywords: haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2023-09-16 18:34 UTC by Peter Zwitser
Modified: 2023-09-18 18:38 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Very short example (12.90 KB, application/vnd.oasis.opendocument.text)
2023-09-16 18:34 UTC, Peter Zwitser
Details
bt with debug symbols (7.33 KB, text/plain)
2023-09-16 19:42 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Zwitser 2023-09-16 18:34:39 UTC
Created attachment 189629 [details]
Very short example

1) Uncheck View → Sidebar.

2) Visit a bookmark from within Navigator.

3) Crash.

4) Writer restarts and repairs document.

5) Check View → Sidebar.

6) Visit a bookmark from within Navigator.

7) Works perfect.

8) Uncheck View → Sidebar.

9) Visit a bookmark from within Navigator.

10) Crash.

Etc., very consistent behaviour.

This started only after updating to version 7.2.5.2 few days ago.

Going to a bookmark from within the document itself using a hyperlink works fine, with or without View → Sidebar checked.

Navigating to images, frames and hyperlinks from within Navigator works also fine, with or without View → Sidebar checked. It only happens with bookmarks.

This is very consistent behaviour. It doesn't matter if it are (very) old documents or newly made like the very simple attachment.

In version 7.2.5.1 this still worked like it should.
Comment 1 Julien Nabet 2023-09-16 19:42:26 UTC
Created attachment 189632 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.

Remark: the file contains 2 bts:
- the initial one which doesn't provide much info
- a second one (I used "catch throw" in gdb) which indicates the location of root problem.
Comment 2 Julien Nabet 2023-09-16 19:44:59 UTC
With LO Debian package 7.5.6.2, no crash
=> regression.

(Peter: I suppose you meant 7.5.2.2)
Comment 3 Julien Nabet 2023-09-16 19:48:51 UTC
László: it seems to be related with c5b1578784c7179bde458640d78e1384ef190a21
"tdf#154521 sw navigator: allow to query selected bookmark via UNO"
Comment 4 Peter Zwitser 2023-09-16 20:19:58 UTC
Oops, my last version was indeed not 7.2.5.1, but the last version before 7.6.1.2
(I don't know the exact number, because the log doesn´t say number of the previous version.)
Comment 5 Julien Nabet 2023-09-16 20:26:16 UTC
Patch waiting for review here:
https://gerrit.libreoffice.org/c/core/+/156978
Comment 6 Julien Nabet 2023-09-17 08:03:12 UTC
László:
a QA test fails with the patch so there's something wrong.
Since it's not obvious to me, I did some other tests without the patch) and noticed these logs when selecting a bookmark:
(soffice:18491): Gtk-CRITICAL **: 09:54:58.775: gtk_tree_store_get_path: assertion 'iter->stamp == priv->stamp' failed

(soffice:18491): Gtk-CRITICAL **: 09:54:58.775: gtk_tree_path_compare: assertion 'b != NULL' failed

using export G_DEBUG=fatal-warnings, I retrieved a bt, here's the relevant part:
#3  0x00007f058bd0887f in (anonymous namespace)::GtkInstanceTreeView::iter_compare(weld::TreeIter const&, weld::TreeIter const&) const (this=0x562744bec4a0, a=..., b=...)
    at /home/julien/lo/libreoffice/vcl/unx/gtk3/gtkinst.cxx:15776
#4  0x00007f05635ef723 in SwContentTree::MouseMoveHdl(MouseEvent const&) (this=0x562744bec030, rMEvt=...) at /home/julien/lo/libreoffice/sw/source/uibase/utlui/content.cxx:1169
#5  0x00007f05635eed4d in SwContentTree::LinkStubMouseMoveHdl(void*, MouseEvent const&) (instance=0x562744bec030, data=...) at /home/julien/lo/libreoffice/sw/source/uibase/utlui/content.cxx:1159

a bit confusing here...
Comment 7 Julien Nabet 2023-09-17 08:08:37 UTC
Forget about last comment, I must have done something else during my test.
Comment 8 Commit Notification 2023-09-17 09:36:49 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8f55b9fccda8abe690693d8630a9a52369f984ec

tdf#157277: fix Writer crash when hiding Sidebar + using bookmark in Navigator

It will be available in 24.2.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 9 Julien Nabet 2023-09-17 09:38:58 UTC
Patch for 7.6 branch waiting for review here:
https://gerrit.libreoffice.org/c/core/+/156954
Comment 10 Peter Zwitser 2023-09-17 15:19:58 UTC
I've downloaded the daily build and tried to crash the documents I've tried before: no crash. So it seems to be fixed.

I've reported quite a lot of bugs, this is the first time I did it for LibreOffice. I've never seen a patch this fast. Compliments!

And installing the daily build was extremely easy. Actually it took more time to make - to be sure - a backup then it took to install the daily build :o)

Thanks for the fast fix!

(And next time I'll try not to mix up the versions...)
Comment 11 Commit Notification 2023-09-17 18:10:28 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#157277: fix Writer crash when hiding Sidebar + using bookmark in Navigator

It will be available in 7.6.2.

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 12 Julien Nabet 2023-09-18 18:38:34 UTC
(In reply to Peter Zwitser from comment #10)
> I've downloaded the daily build and tried to crash the documents I've tried
> before: no crash. So it seems to be fixed.
Great! Let's put this one to VERIFIED then. 

> I've reported quite a lot of bugs, this is the first time I did it for
> LibreOffice. I've never seen a patch this fast. Compliments!
We were lucky it was not a complicate one and easy to reproduce.

> 
> And installing the daily build was extremely easy. Actually it took more
> time to make - to be sure - a backup then it took to install the daily build
> :o)
> 
> Thanks for the fast fix!
> ...
You're welcome! :-)