Bug 160898

Summary: Crash selecting all (Ctrl+A) in a temporarily visible paragraph under a table inside a table
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: WriterAssignee: Mike Kaganski <mikekaganski>
Status: VERIFIED FIXED    
Severity: critical CC: stephane.guillou
Priority: medium Keywords: bisected, regression
Version: 7.6.0.3 release   
Hardware: All   
OS: All   
URL: https://ask.libreoffice.org/t/table-with-inner-tables-causes-crash-when-ctrl-a/105383
Whiteboard: target:24.8.0 target:24.2.4 target:7.6.8 target:7.6.7
Crash report or crash signature: ["SwCursorShell::MoveStartText()"] Regression By:
Bug Depends on:    
Bug Blocks: 107200, 133092    
Attachments: Table in table

Description Mike Kaganski 2024-05-02 04:00:51 UTC
Created attachment 193929 [details]
Table in table

1. Create a table in a text document
2. Inside that table's cell, create another table (see that there is no paragraphs shown in the outer cell, beside the paragraphs inside the inner table)
3. When the cursor is inside that inner table, press Arrow Down key, and eventually arrive to a place outside the inner table, but inside the outer cell (the hidden paragraph, shown temporarily when the cursor travels there)
4. Press Edit->Select All (Ctrl+A)

=> crash since version 7.6.0.

Regression after commit d81379db730a163c5ff75d4f3a3cddbd7b5eddda (tdf#154877 sw: generalise ExtendedSelectAll(), 2023-05-09)

The attached file contains a simple reproducer. Just press Arrow Down key twice, to arrive into the described temporarily shown paragraph, then Ctrl+A.
Comment 1 Stéphane Guillou (stragu) 2024-05-02 04:06:11 UTC
Reproduced with:

Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

https://crashreport.libreoffice.org/stats/crash_details/85dcb78f-3587-4331-8730-d1126ca5fa0f

And 7.6.6 with signature "SwCursorShell::MoveStartText()": https://crashreport.libreoffice.org/stats/crash_details/ebc1d63d-a141-41b6-b341-fbc40d84c216
Comment 2 Mike Kaganski 2024-05-02 04:13:28 UTC
https://gerrit.libreoffice.org/c/core/+/166990
Comment 3 Commit Notification 2024-05-02 06:57:40 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#160898: check for nullptr

It will be available in 24.8.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 4 Commit Notification 2024-05-02 17:11:42 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#160898: check for nullptr

It will be available in 24.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 5 Commit Notification 2024-05-07 08:07:07 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/278845dddefbd1359b8bd28f87c42f4124be50ca

tdf#160898: check for nullptr

It will be available in 7.6.8.

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 6 Commit Notification 2024-05-07 08:07:10 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-6-7":

https://git.libreoffice.org/core/commit/05057b823e9a9b3b05029aef122c4d0781d8c285

tdf#160898: check for nullptr

It will be available in 7.6.7.

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 7 Stéphane Guillou (stragu) 2024-05-07 13:41:34 UTC
Thanks Mike, fix verified in:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7a895ec4205659038aa95941b65715fed1a3e7be
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded