Bug 160095 - CRASH: using ALT+RETURN twice
Summary: CRASH: using ALT+RETURN twice
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: highest critical
Assignee: Julien Nabet
URL:
Whiteboard: target:24.8.0 target:24.2.2.2
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2024-03-08 09:30 UTC by Xisco Faulí
Modified: 2024-05-08 06:41 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (4.24 KB, text/plain)
2024-03-08 12:54 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2024-03-08 09:30:06 UTC
Steps to reproduce:
1. Open Writer
2. Insert a table
3. Alt+Return
4. Alt+Return

-> Crash

reproduced in

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 825dde03999a55d02e4d5bc88a4d5beacb65e67f
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 1 Xisco Faulí 2024-03-08 09:31:43 UTC
Regression introduced by:

author	Oliver Specht <oliver.specht@cib.de>	2024-02-27 16:43:56 +0100
committer	Michael Stahl <michael.stahl@allotropia.de>	2024-03-01 11:22:16 +0100
commit aebdc79dbc5bf059ee0921a00d2795e526a52c42 (patch)
tree faf88d5dfd75f9d7201711ac0846bd52ed486e50
parent 173a79365b110cf70f628a602a22049562a477f5 (diff)
tdf#146356 insert new paragraph before table of contents

Bisected with: bibisect-linux64-24.8
Comment 2 Julien Nabet 2024-03-08 12:54:59 UTC
Created attachment 193029 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 3 Julien Nabet 2024-03-08 12:57:35 UTC
Some gdb debug:
320	            pSection = &static_cast<const SwSectionNode*>(pSectionNode)->GetSection();
(gdb) p static_cast<const SwSectionNode*>(pSectionNode)
$1 = (const SwSectionNode *) 0x0
(gdb) p pSectionNode
$2 = (const SwNode *) 0x0
Comment 4 Julien Nabet 2024-03-08 13:07:55 UTC
I could also reproduce this with just:
1. Open Writer
2. Alt+Return

This patch prevents from crashing:
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index daaa7296e81e..679b0fb72f3e 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -316,6 +316,9 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
         // find the table/section which is close
         if( pTableNode == nullptr )
         {
+            if ( pSectionNode == nullptr )
+                return nullptr;
+
             pInnermostNode = pSectionNode;
             pSection = &static_cast<const SwSectionNode*>(pSectionNode)->GetSection();
         }
Comment 5 Julien Nabet 2024-03-08 16:37:10 UTC
I've submitted the patch here:
https://gerrit.libreoffice.org/c/core/+/164592
Comment 6 Commit Notification 2024-03-09 08:54:13 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/82e6236cd6ba6f45aa913a3be606e6b00f81fe07

tdf#160095: fix crash when using ALT+RETURN twice

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 7 Commit Notification 2024-03-11 09:01:45 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/1ecbee191411bf340173fd64d56888e245a54e08

tdf#160095: fix crash when using ALT+RETURN twice

It will be available in 24.2.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 8 Commit Notification 2024-03-11 11:58:09 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4c382515069d1ccf9ffc3f647ab3acc26c2aba6f

tdf#160095: sw_uiwriter8: Add unittest

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 9 Commit Notification 2024-03-19 17:51:28 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-2":

https://git.libreoffice.org/core/commit/545179ee711381b641dd6a34e46722353f2b2488

tdf#160095: fix crash when using ALT+RETURN twice

It will be available in 24.2.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 10 kalyl 2024-05-08 03:45:25 UTC Comment hidden (spam)