Bug 125588 - EDITING: Wrong formula computed values and crash with formulas pasted on whole columns
Summary: EDITING: Wrong formula computed values and crash with formulas pasted on whol...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.6.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-30 08:42 UTC by Matteo Italia
Modified: 2019-05-31 02:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screencast of the repro, as seen on LO 5.1.6.2 on Linux/x86-64 (335.48 KB, video/mp4)
2019-05-30 08:45 UTC, Matteo Italia
Details
Screenshot of "incorrect formula value" repro on LO 6.1.6.3 on Windows 7 (x86-64) (89.76 KB, image/jpeg)
2019-05-30 08:46 UTC, Matteo Italia
Details
Screenshot of crash repro on LO 6.1.6.3 on Windows 7 (x86-64) (78.97 KB, image/jpeg)
2019-05-30 08:47 UTC, Matteo Italia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Italia 2019-05-30 08:42:56 UTC
Description:
Pasting trivial formulas referencing different rows into a whole column results in either incorrect results, or outright crashes.

We managed to reproduce this easily:

- on 5.1.6.2, Ubuntu 16.04/x86-64 (libreoffice package)
- on 6.1.6-1, Arch Linux/x86-64 (libreoffice-still package)
- on 6.1.6.3, Windows 7/x86-64 (official package, "still" distribution)

This is 100% reproducible on 3 machines out of 5 we tested; on the two machines where we couldn't reproduce it there wasn't any particular pattern in version difference - one was an Ubuntu 18.04 machine running LO 6.0.7, the other was another Arch machine, presumably recently updated.

Steps to Reproduce:
- create a new spreadsheet;
- write the number 4 for 10 rows in column A;
- in cell B2 insert the formula =A2-A1; it will produce 0, as expected;
- select cell B2, copy;
- click on the B column header, selecting it;
- paste (Ctrl-V, didn't try pressing Enter)

Actual Results:
You'll get 4 in all the cells on the right of the range you initially filled, zero in the other cells.

Expected Results:
it should be 0 everywhere except for the first cell of column B outside the range that was initially filled with 4, where it should be -4.


Reproducible: Always


User Profile Reset: No



Additional Info:
To instead get a crash, do the same as above, but use = A2-A3 as formula. You'll get a fatal error saying something like

multi_type_vector::position#1528: block position not found! (logical pos=1048576, block size=2, logical size=1048576).

Screencast of the bug repro: https://www.youtube.com/watch?v=gjsylUJO8gw
Comment 1 Matteo Italia 2019-05-30 08:45:20 UTC
Created attachment 151775 [details]
Screencast of the repro, as seen on LO 5.1.6.2 on Linux/x86-64
Comment 2 Matteo Italia 2019-05-30 08:46:34 UTC
Created attachment 151776 [details]
Screenshot of "incorrect formula value" repro on LO 6.1.6.3 on Windows 7 (x86-64)
Comment 3 Matteo Italia 2019-05-30 08:47:25 UTC
Created attachment 151777 [details]
Screenshot of crash repro on LO 6.1.6.3 on Windows 7 (x86-64)
Comment 4 m_a_riosv 2019-05-30 08:52:18 UTC
No repro
Version: 6.2.4.1 (x64)
Build ID: 170a9c04e0ad25cd937fc7a913bb06bf8c75c11d
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US
Calc: CL
Comment 5 Matteo Italia 2019-05-30 08:54:03 UTC
Ok, the one Arch machine where we couldn't reproduce this has 6.2.3.2, so it seems that "fresh" versions are ok.
Comment 6 Xisco Faulí 2019-05-30 10:28:56 UTC
(In reply to Matteo Italia from comment #5)
> Ok, the one Arch machine where we couldn't reproduce this has 6.2.3.2, so it
> seems that "fresh" versions are ok.

Thanks for retesting with the latest version.
Setting to RESOLVED WORKSFORME as the commit fixing this issue hasn't been identified.
Comment 7 Matteo Italia 2019-05-30 11:55:29 UTC
TBH given that this seems to come and go (5.1.6 bad, 6.0.7 good, 6.1.6 bad, 6.2.3 good) my fear is that there's undefined behavior going on, and it's mostly luck whether the problem is visible in one version or not.
Comment 8 QA Administrators 2019-05-31 02:51:17 UTC Comment hidden (obsolete)
Comment 9 raal 2019-05-31 02:59:54 UTC
Thank you for testing. According to https://wiki.documentfoundation.org/ReleasePlan/6.1 , the 6.1.6 is last version, so we can close the bug - it's fixed in 6.2