Bug 131915 - CALC freezes on undo or delete of long column
Summary: CALC freezes on undo or delete of long column
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha0+
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: Undo-Redo
  Show dependency treegraph
 
Reported: 2020-04-05 21:03 UTC by thatho
Modified: 2020-07-08 15:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
minimal example to start with (8.41 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-05 21:05 UTC, thatho
Details
Perf flamegraph (27.41 KB, image/svg+xml)
2020-06-22 16:57 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thatho 2020-04-05 21:03:31 UTC
Description:
by generating a long column of values and trying to delete it or by applying undo CALC freezes and it is 'waiting for response'.

Steps to Reproduce:
1. Open attached file. The file contains three sheets. Sheet1: 2-by-2 matrix filled with single digit integers. Sheet2: 2-by-1 matrix filled with single digit integers. Sheet3: 2-by-1 matrix filled with integers generated by {=MMULT($Sheet1.A1:B2;$Sheet2.A1:A2)}
2. Select Column A
3. Click into the Formula bar, select the whole formula '=MMULT($Sheet1.A1:B2;$Sheet2.A1:A2)' and copy it
4. ESC (the column A remains selected)
5. press Del (delete the column)
6. Click into the Formula bar, paste the formula '=MMULT($Sheet1.A1:B2;$Sheet2.A1:A2)' and press CTRL+ENTER to apply array formula
7. the whole column A is filled with #N/A except the first to cells
8. The user finds out the mistake -- the user should have deselected the column and enter the formula only into the first cell of the column.
9. press CTRL+Z
10. CALC freezes (better to kill CALC and let it recover the file)

There is no workaround, when the user saves the file with the generated super-long column. CALC is not able to delete such a long column either. One has to create a new file and copy the content of the sheets.

Note: The example given does not make sense in such a small example. The example is very specific and the user may avoid the freeze by not applying the array formula onto the whole column -- only to the first cell, CALC would fill in the column to the last meaningful cell.

The example makes sense when updating the calculation and changing the size of the original matrix in size 123-by-123 in Sheet1 and finally deleting the whole column in Sheet3 -- which was my case.

Actual Results:
Waiting for response, CALC window freezes.

Expected Results:
CALC shall undo the column edit and clear the column in no time.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.2.2 (x64)
Build ID: 4e471d8c02c9c90f512f7f9ead8875b57fcb1ec3
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: cs-CZ (cs_CZ); UI-Language: en-US
Calc: threaded
Comment 1 thatho 2020-04-05 21:05:46 UTC
Created attachment 159351 [details]
minimal example to start with

The file itself is not considered faulty. It is only a special example, how to generate a column full of values. Follow the steps above to reproduce the freeze and crash.
Comment 2 Buovjaga 2020-06-22 16:57:11 UTC
Created attachment 162316 [details]
Perf flamegraph

Repro. Note: Ctrl-Shift-Enter to accept array formula

Arch Linux 64-bit
Version: 7.1.0.0.alpha0+
Build ID: ae3d26ba925f74c992a2d5cdfd44ed5d43968689
CPU threads: 8; OS: Linux 5.7; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 20 June 2020
Comment 3 Buovjaga 2020-06-22 17:35:25 UTC
I tried in old versions. First tests on Windows:
4.4.7: 30 sec
6.1: 55 sec

However, the freeze is not yet in the latest commit of Win 6.3 bibisect repo, but is already in the oldest of 6.4 repo. Then, even weirder, the freeze is both in the oldest and latest of Linux 6.3 repo.

Maybe someone else has better luck.
Comment 4 thatho 2020-07-07 06:02:58 UTC
Works for me in 

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 7dc3a20cab712ee987ea25a8f5728529521485b7
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL: win
Locale: cs-CZ (cs_CZ); UI: en-US
Calc: CL

The bug is not present in the latest alpha
Comment 5 Buovjaga 2020-07-08 15:09:22 UTC
Indeed, there is no delay anymore

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 9af38b4504ccda57a0c32eb8bdd03e5a8ca29ddc
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded