Bug 150819 - CRASH & assert after a few paste and undo (Assertion failed: (abs(rNode.GetIndex() - pMoveText->pDestNode->GetIndex()) == SwNodeOffset(1)), function SwClientNotify, file txtfrm.cxx, line 2135)
Summary: CRASH & assert after a few paste and undo (Assertion failed: (abs(rNode.GetIn...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0 target:7.5.1 target:7.5.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Crash
  Show dependency treegraph
 
Reported: 2022-09-06 10:40 UTC by Xisco Faulí
Modified: 2024-04-03 03:57 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (26.00 KB, application/msword)
2022-09-06 10:40 UTC, Xisco Faulí
Details
debug log of assert error. (12.99 KB, text/plain)
2024-04-03 03:55 UTC, Kira Tubo
Details
debug error (171.68 KB, image/png)
2024-04-03 03:57 UTC, Kira Tubo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2022-09-06 10:40:30 UTC
Created attachment 182248 [details]
sample file

Steps to reproduce:
1. Open attached document
2. Select all
3. Copy
4. Paste 5-10 times
5. Undo 5-10 times

-> Crash. if it doesn't crash, repeat steps 4 and 5 a few times

Reproduced in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: ee003ca99f94c9a5517ebba67ed02abb2a60dae8
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 1 Xisco Faulí 2022-09-06 10:41:42 UTC
Regression introduced by:

author	Noel Grandin <noelgrandin@gmail.com>	2022-08-16 18:44:31 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2022-08-17 18:18:52 +0200
commit 3a02b5f8aae803b7b5a232c724135594483627a4 (patch)
tree 3e51ea888f4ed012295a3736cd4cff7d81ba11c5
parent a18a74d6762e56a20093ca51cfd12925697c2524 (diff)
convert more nNode to SwPosition::GetNode

Bisected with: bibisect-linux64-7.5

Adding Cc: to Noel Grandin
Comment 2 Telesto 2022-09-06 12:31:53 UTC
Confirm
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: dc92a4d973086ce8a6a5f75ba0f4d4c9ca05537a
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 3 Noel Grandin 2022-09-06 14:13:59 UTC
Cannot repro this with current master (30a3f2b7343be07f10c8cbf7f4a9e90e16db806e), possibly someone has fixed it already?
Comment 4 Telesto 2023-01-18 20:13:23 UTC
STR in my case
1. Open attached document
2. CTRL+A
3. CTRL+C
4. CTRL+V (5x) -> So with the text at step 2 still selected
5. Press and hold CTRL+Z (or press it one by one, timing doesn't matter)

If I press 6x CTRL+V in step 4 it won't crash. 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 37e3455a13ab5741104bf41d05a80e60a4612682
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded
Comment 5 Noel Grandin 2023-01-19 15:51:54 UTC
I see the same assert in the commit preceeding the bibisect commit referenced here, so I think something went weird in the bibisect process.
Comment 6 Noel Grandin 2023-01-19 18:18:30 UTC
Never mind, the assert and the crash are from different things, have found the bug, will post a patch tomorrow
Comment 7 Commit Notification 2023-01-20 09:33:08 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#150819 crash after a few paste and undo

It will be available in 7.6.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 Commit Notification 2023-01-23 12:05:24 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/4192d8cc3120473d0dbfcc7ff12bf8297ac999db

tdf#150819 crash after a few paste and undo

It will be available in 7.5.1.

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 2023-01-25 08:59:24 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-0":

https://git.libreoffice.org/core/commit/86b69183193706724e5216c4dc26e2bf824a9a4a

tdf#150819 crash after a few paste and undo

It will be available in 7.5.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 10 Kira Tubo 2024-04-03 03:55:18 UTC
Created attachment 193452 [details]
debug log of assert error.

(In reply to Noel Grandin from comment #6)
> Never mind, the assert and the crash are from different things, have found
> the bug, will post a patch tomorrow

@Noel, I'm attempting to write a unit test for this, but I'm running into an issue where errors occur if the bug is reproduced in the dev environment. See attached debug log. May be related to the assert issue that you found.
Comment 11 Kira Tubo 2024-04-03 03:57:38 UTC
Created attachment 193453 [details]
debug error

@Noel, also see attached image for error