Bug 163019 - Calc 24.8.1 crashes if Copy Paste Paste special are executed (steps in comment 6)
Summary: Calc 24.8.1 crashes if Copy Paste Paste special are executed (steps in commen...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.1.2 release
Hardware: All All
: highest critical
Assignee: Andreas Heinisch
URL:
Whiteboard: target:25.2.0 target:24.8.3 target:24...
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2024-09-17 21:36 UTC by tv.kleef
Modified: 2024-10-30 13:09 UTC (History)
5 users (show)

See Also:
Crash report or crash signature: b1d41920-e6b6-48a8-812b-a578af1bc7e6


Attachments
Picture Paste Special Menu (217.91 KB, image/png)
2024-09-18 17:08 UTC, tv.kleef
Details
Sample spread sheet to demonstrate failure (21.72 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-09-25 21:19 UTC, Robert Deacle
Details
Pasting a formula using paste special (1.58 MB, image/gif)
2024-09-26 08:10 UTC, Andreas Heinisch
Details
"About" image from build that I tested that works. (126.19 KB, application/vnd.oasis.opendocument.text)
2024-10-06 19:50 UTC, Robert Deacle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tv.kleef 2024-09-17 21:36:02 UTC
Description:
Calc 24.8.1 crashes if Copy Paste Paste special are executed and
Different Context Menu commands 24.2.6 versus 24.8.1 I used old version a lot, now it is gone, not happy.

Actual Results:
Sheet crashing

Expected Results:
Just normal copy and paste, paste special like in 24.2.6


Reproducible: Always


User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no
Comment 1 m_a_riosv 2024-09-18 00:13:24 UTC
Please test in safe mode, Menu/Help/Restart in Safe Mode
Comment 2 tv.kleef 2024-09-18 07:16:45 UTC
Sorry, but I went back to version 7.6 with everything in place what I need and no crashes!
Comment 3 Xisco Faulí 2024-09-18 07:21:02 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Comment 4 tv.kleef 2024-09-18 17:08:16 UTC
Created attachment 196526 [details]
Picture Paste Special Menu

This (see picture) used to be Paste Special menu but now it is gone. Where did it go? One important function I use is substracting numbers from one colm to another in one big operation...
The Copy function now works better after first removing LO completly including the user profile. I hope it stays this way.
Comment 5 Robert Deacle 2024-09-25 21:14:51 UTC
I am experiencing the same issue.
Installed Calc 24.8.1 last night.

Click on cell (with a formula) to select it.
Right Click, Copy 
Right Click, Paste Special / Number

Crash.

This happens in safe mode.

Most recent crash that was uploaded:

b1d41920-e6b6-48a8-812b-a578af1bc7e6

I will try to upload my simplified/sanitized spread sheet.
Comment 6 Robert Deacle 2024-09-25 21:19:28 UTC
Created attachment 196698 [details]
Sample spread sheet to demonstrate failure

Cell E39 contains a formula, and displays a value.

Try to replace the formula with the numerical value.

Right Click, Copy
Right Click, Paste Special / Number

crashes.

Even in safe mode
Comment 7 Robert Deacle 2024-09-25 22:13:40 UTC
Version 24.2.6 works as expected,
        24.8.1.2 (X86_64) crashes. Windows 11, 16 CPU threads. 
        24.8.1.2 was downloaded 2024-09-25 about 22:00 UTC
Comment 8 Xisco Faulí 2024-09-26 06:24:44 UTC
Reproduced in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4787fd4fc86230893a6da309f45964116b3a67df
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 9 Xisco Faulí 2024-09-26 06:29:59 UTC
Regression introduced by:

commit e747986af4dbb6b48957092dadce26a95b910a82	[log]
author	Andreas Heinisch <andreas.heinisch@yahoo.de>	Sat Jul 20 21:45:34 2024 +0200
committer	Andreas Heinisch <andreas.heinisch@yahoo.de>	Fri Aug 02 10:32:56 2024 +0200
tree 67e12dcb258f2441759faa9b6a90e3bda0746582
parent d5ad9c0777602541fb39dea5da71e7bfd70595fb [diff]

tdf#161189 - CopyFromClip: improve handling of deleting notes

Bisected with: bibisect-linux64-25.2
Comment 10 Andreas Heinisch 2024-09-26 08:10:45 UTC
Created attachment 196707 [details]
Pasting a formula using paste special

I could not reproduce the error in my build:

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: edc20f4d34d102b385ece53a60abad0047661661
CPU threads: 32; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded

Could anybody provide me the exact steps to reproduce the error?
Comment 11 Xisco Faulí 2024-09-26 08:13:38 UTC
Hi Andreas,
I can reproduce it following the steps from comment 6
Comment 12 Andreas Heinisch 2024-09-26 08:14:07 UTC
Ok, now I could reproduce the error. You have to copy paste to the SAME cell.
Comment 13 Andreas Heinisch 2024-09-26 08:38:07 UTC
The problem arises in the redraw process of the dirty cells: https://opengrok.libreoffice.org/xref/core/sc/source/core/data/column4.cxx?r=97649f5d#1897

const ScFormulaCellGroupRef& mxGroupChild = (*itCell)->GetCellGroup();
ScFormulaCell* pChildTopCell = mxGroupChild ? mxGroupChild->mpTopCell : *itCell;

where mpTopCell is a null pointer.

An attempted fix: https://gerrit.libreoffice.org/c/core/+/173975
Comment 14 Pit Hauge 2024-09-30 15:05:42 UTC
I cannot reproduce the error with version 28.4.2.1, so possibly the fix was successful.
Comment 15 Andreas Heinisch 2024-09-30 15:12:43 UTC
We did not made any change yet. I could reproduce it using the samples spreadsheet.
Comment 16 Commit Notification 2024-10-04 16:56:36 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9a2c38530dd5e479a96953980ee7f6c448dce87a

tdf#163019 - Remove the formula of a cell during paste special

It will be available in 25.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 17 Robert Deacle 2024-10-06 19:45:41 UTC
I downloaded and installed this development build:

https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb78-pollux-TDF_wix/2024-10-06_05.46.41/LibreOfficeDev-25.2.0.0-64.msi

I believe the issue of paste special number into the same cell which had a formula is fixed.

I am also uploading an image of the "About" page with further details.

Thank you for resolving issue.
Comment 18 Robert Deacle 2024-10-06 19:50:26 UTC
Created attachment 196936 [details]
"About"  image from build that I tested that works.

Screen shot of Help/About from the build that fixes the paste special number into the same cell containing the formula.
Comment 19 m_a_riosv 2024-10-06 20:10:56 UTC
(In reply to Robert Deacle from comment #18)
> Created attachment 196936 [details]
> "About"  image from build that I tested that works.
> 
> Screen shot of Help/About from the build that fixes the paste special number
> into the same cell containing the formula.

No need to attach the image, in the middle there is a button to copy the information as text.
Comment 20 Commit Notification 2024-10-07 08:31:18 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#163019 - Remove the formula of a cell during paste special

It will be available in 24.8.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 21 Xisco Faulí 2024-10-07 08:58:19 UTC
(In reply to Robert Deacle from comment #17)
> I downloaded and installed this development build:
> 
> https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb78-pollux-
> TDF_wix/2024-10-06_05.46.41/LibreOfficeDev-25.2.0.0-64.msi
> 
> I believe the issue of paste special number into the same cell which had a
> formula is fixed.
> 
> I am also uploading an image of the "About" page with further details.
> 
> Thank you for resolving issue.

Thanks for verifying it. Setting to VERIFIED based on this comment
Comment 22 Robert Deacle 2024-10-11 20:20:38 UTC
Downloaded and tested:

Version: 24.8.3.0.0+ (X86_64) / LibreOffice Community
Build ID: 6d37d3ae03694657a3e808e8395614138161daab
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

The copy, paste special sequence works without crashing.

I did notice that sometimes actions seem to hang until the pointer (mouse pointer) is moved out of the data area into the area with all of the tool bars. It happened several times in the 10 minutes I was updating my spread sheet, but I could not produce it consistently.   1 occurrence was during a paste special / values operations.   The data did not appear in the cells until I moved the pointer into the tool bar area.   "Enter" and the cursor keys did not have any effect until the mouse was moved.
Comment 23 Commit Notification 2024-10-25 19:37:42 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#163019 - Remove the formula of a cell during paste special

It will be available in 24.2.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 24 Commit Notification 2024-10-28 13:02:52 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-7":

https://git.libreoffice.org/core/commit/62923e5fb48a52754c57100442c61a3170b93fa5

tdf#163019 - Remove the formula of a cell during paste special

It will be available in 24.2.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 25 Robert Deacle 2024-10-30 13:09:38 UTC
Installed Release Candidate and it is working fine.  I Thank you all!

Version: 24.8.3.1 (X86_64) / LibreOffice Community
Build ID: 65412f067af443213e726c93f137ccc85c9a1e06
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded