Bug 144135 - Calc causes repeatable fatal crash when I attempted to sort columns
Summary: Calc causes repeatable fatal crash when I attempted to sort columns
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.3.0 target:7.2.2
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks:
 
Reported: 2021-08-27 18:06 UTC by dpkesling
Modified: 2021-09-19 15:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dpkesling 2021-08-27 18:06:41 UTC
Description:
Was trying to sort an 8 x 7550 on two columns, my machines immediately locked up. After power button holddown, shutdown and restart. Tried that same sort again... crashed again. An error report was supposedly sent to you as indicated by a pop-up dialogue.

Steps to Reproduce:
1.Open a 8 x 7500 table.
2.Sort on two columns, one is text, another is floating point number.
3.

Actual Results:
Machine screen freezes, will not accept input from mouse, touchpad, or keyboard. Displays "not responding" message in the title bar.

Expected Results:
not crashed


Reproducible: Always


User Profile Reset: Yes



Additional Info:
This is not a "Normal" bug, but a rather major bug. And this is the second MAJOR bug I've encountered with Calc in the past couple weeks... both involving machine-freezing behavior. I am going to backout 7.2.0.4 and reload 7.1.5 in hope of returning to reliable operation. I fully understand 7.2 is bleeding edge as described, but I expected paper cuts... not fatal wounding.
Comment 1 Roman Kuznetsov 2021-08-28 17:32:08 UTC
Please attach your spreadsheet here
Comment 2 dpkesling 2021-08-28 23:57:09 UTC
I wish I could honor your request, but that data set contains proprietary information. I can tell you that I backed out 7.2.0.4 and installed 7.1.5 and have experienced no difficulty in performing the same sort repeatedly. Would suggest some delta in the code within SORT has caused the issue.
I can tell you with high assurance that, without having examined every character, there are no "non-character" bytes in the file.The same file inputs to downstream R and Python processes without exceptions.
I can tell you the 8 columns are:
Integer, Date (in form of "August 28, 2021"), Floating Point, Floating Point, Text, Text, Text, Text
Comment 3 QA Administrators 2021-08-29 04:09:53 UTC Comment hidden (obsolete)
Comment 4 Timur 2021-08-29 08:27:38 UTC Comment hidden (obsolete)
Comment 5 Telesto 2021-08-29 10:09:26 UTC
(In reply to Timur from comment #4)
> Bug cannot be tested without sample. 
> You can replace all chars with x or delete text, if bug still reproduces
> after that.

Or build a similar file from scratch without confidential data, if it's still reproducible.
Comment 6 dpkesling 2021-08-29 20:05:31 UTC
I just prepared a "stripped-out" version of the .ods file in question and was prepared to send it in... but there is no way I will provide a path to this thing on my computer in an open forum. If you have an address to which I can upload the file, I will be happy to do so.
Comment 7 dpkesling 2021-08-29 20:06:55 UTC Comment hidden (obsolete)
Comment 8 Roman Kuznetsov 2021-08-29 20:22:29 UTC
(In reply to dpkesling from comment #7)
> total file size is 150.4 k

Just click to "Add an attachment" link above
Comment 9 dpkesling 2021-08-29 22:12:54 UTC
I just sent file to you.
To duplicate the problem I had:
1. Select ALL by clicking the little box in upper left hand corner.
2. Select Data -> Sort from toolbar
3. First parameter/slot Column E in ascending order
4. Second parameter/slot Column D in descending order.
5. In my case, Calc immediately threw error and locked machine.

Bear in mind. I have since downgraded Libre to version 7.1.5 from 7.2.0.4
This file was adjusted and filed under 7.1.5... so if the problem involved a "file write" issue, it won't necessarily appear here.
Comment 10 QA Administrators 2021-08-30 03:57:18 UTC Comment hidden (obsolete)
Comment 11 Roman Kuznetsov 2021-08-30 08:24:44 UTC
(In reply to dpkesling from comment #9)
> I just sent file to you.
> To duplicate the problem I had:
> 1. Select ALL by clicking the little box in upper left hand corner.

And it's a root of the problem. Why did you select all cells on the sheet if you have only some cell range with data?

I confirm the crash in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: ac80ec817eb07c77a51bc0729985a473c734182e
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded

but you shouldn't select all sheet for your case.

Eike, Mike, I saw already some bug reports when users select all sheet and then LO hangs or crashes. May be we need some checking before any action if user selected all sheet? If user did it then LO could search a real data range on sheet, drop selecting to only the range and only after it do the action?
Comment 12 Eike Rathke 2021-08-30 09:44:23 UTC
That shouldn't really matter as empty columns are empty and completely empty data isn't copied around while sorting. Automatically shrinking the selection to the data range IIRC isn't done on purpose because attribution (like background colour) on sorted rows but empty cells is to be sorted along with data.

In 90% of all cases it's not even necessary to select anything, if the to be sorted range is contiguous, just place the cell cursor somewhere in the data range and it will get selected for Data -> Sort.

However, I can not reproduce with some smallish test data, neither with 7.2.0 nor 7.3, having selected the entire sheet just works. So can someone attach a reproducing test case please?
Comment 13 Eike Rathke 2021-08-30 09:44:51 UTC
Or it's a Windows-only problem..
Comment 14 Eike Rathke 2021-08-31 20:23:14 UTC
So.. this can happen due to a huge memory allocation if there is visible cell attribution (like cell background colour) across the entire selection (or its end edges) and Sort Option "Include formats" is activated, which is the default.

In fact a regression of fixing bug 126678 with the wish to include sorting of different attribution of trailing empty columns along with their data rows, or vice versa trailing empty rows along with their data columns.

Trying to detect and handle things somewhat smarter there..
Comment 15 Commit Notification 2021-09-12 22:40:03 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#144135 Rework Sort with area extras

It will be available in 7.3.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 16 Eike Rathke 2021-09-12 22:40:47 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/121981 for 7-2
Comment 17 Roman Kuznetsov 2021-09-14 14:18:14 UTC
Verified in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 80a47aae1419842f4496f02028e2b49763aea25b
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded

Thank you Eike!
Comment 18 Mike Kaganski 2021-09-15 16:34:09 UTC
(In reply to Eike Rathke from comment #16)
> Pending review https://gerrit.libreoffice.org/c/core/+/121981 for 7-2

Eike: could you please attach a reproducer? Thank you!
Comment 19 Mike Kaganski 2021-09-15 16:54:43 UTC
(In reply to Mike Kaganski from comment #18)

I was able to repro. Thanks for the fix!
Comment 20 Commit Notification 2021-09-15 16:55:08 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

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

Resolves: tdf#144135 Rework Sort with area extras

It will be available in 7.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 21 dpkesling 2021-09-19 15:20:01 UTC
I have downloaded 7.2.1.2 and have not encountered the originally reported bug. Problem appears to have been resolved. Thank you.