Bug 132451 - Wrong calculation after copy/paste of a formula
Summary: Wrong calculation after copy/paste of a formula
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.0.beta1+
Hardware: All All
: high critical
Assignee: Dennis Francis
URL:
Whiteboard: target:7.1.0 target:7.0.0.1 target:6.4.6
Keywords: bibisected, bisected, regression
: 124577 129753 131340 134893 (view as bug list)
Depends on:
Blocks: Calculate
  Show dependency treegraph
 
Reported: 2020-04-27 10:28 UTC by Telesto
Modified: 2021-07-03 06:55 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Bibisect log (2.60 KB, text/plain)
2020-04-27 10:31 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-04-27 10:28:29 UTC
Description:
Recalculation not triggered after copy/paste of a formula 

Steps to Reproduce:
STR
1. Open attachment 157959 [details]
2. CTRL+SHIFT+F9 (fixing the calculation at D5)
3. Copy C6 and paste it at C5 -> Calculation is wrong again

Repro with 7.0 and 6.2 but not with
Version: 6.1.0.0.beta2+
Build ID: 22c451df33b733440f24c1feb6380d31240d55e6
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL

Actual Results:
Wrong result

Expected Results:
Proper result


Reproducible: Always


User Profile Reset: No



Additional Info:
Found in
Version: 7.0.0.0.alpha0+ (x64)
Build ID: f924658e45f256544e43c3fdb2af9b585d0f0933
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win; 
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL

and in 
6.2
Comment 1 Telesto 2020-04-27 10:31:08 UTC
Created attachment 159991 [details]
Bibisect log

Bisected to
author	Dennis Francis <dennis.francis@collabora.co.uk>	2018-06-12 15:04:04 +0530
committer	Dennis Francis <dennis.francis@collabora.co.uk>	2018-06-21 15:04:11 +0200
commit 12782fc917bcdc1c119bda675fc27f77887498e0 (patch)
tree d0d990355644b71d4d8333fc7ffe5adbf3f1ab2e
parent 6b496d6a0f8b9de38fbf6721796104496d927db3 (diff)
Do dependency computation checks for OpenCL and...
software interpreter like in CPU threading.
This patch also reworks the cycle detection
to make it more robust.

Since the dependency computation also does
cycle detection, there is no need to disable
group-calc(threaded/OpenCL/SW Interpreter)
for non-leaf nodes in recursive interpret.

The rework of cycle detection ensures that
it fixes tdf#95748 correctly.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=12782fc917bcdc1c119bda675fc27f77887498e0
Comment 2 Telesto 2020-04-27 10:33:36 UTC
Spin off from bug 124577 comment 10. Setting to NEW
Comment 3 Telesto 2020-04-27 10:34:30 UTC
Adding CC to Dennis Francis
Comment 4 Telesto 2020-04-27 22:49:41 UTC
Caption didn't fit the bill
Comment 5 Telesto 2020-05-17 10:47:05 UTC
@Xisco
Would you mind to confirm (to be sure)..
Comment 6 Xisco Faulí 2020-05-18 09:13:31 UTC
I do confirm it in

Version: 7.0.0.0.alpha1+
Build ID: 56d381c3deb213a40c54ce6e194f79f0334b5d7b
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

the issue is fixed if a recalc is done afterwards
Comment 7 b. 2020-06-01 10:55:39 UTC
@Telesto and @Dennis: 

it's less the copying of a formula failing, but one special cell - second from top - in a shared formula group of 100+ cells being 'weak' regarding autocalculate, 

and! it's only failing if one or both of the parallelizing options openCL and threading are active (enabled and restarted), that was elaborated in the predecessor bugs but not mentioned here, and might produce wrong 'norepro' comments, 

@Xisco: 

> the issue is fixed if a recalc is done afterwards

i've read that quite often since targetting autocalculate weaknesses, NO, it's neither a fix of the issue, just of that step of calculation, the issue persists, nor is it a solution for users, people expect a more reliable behaviour, people aren't aware of when they have to trigger recalc, they get no info or warning about the wrong results on their screen, and it's violating the definition of 'autocalculate', 

[sarcasm] almost every issue of calc is fixed with pencil and paper and a manual recalc [/sarcasm]
Comment 8 b. 2020-06-06 08:49:37 UTC
*** Bug 124577 has been marked as a duplicate of this bug. ***
Comment 9 Commit Notification 2020-06-22 11:47:44 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

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

failed cell dependency check should not set invalid values (tdf#132451)

It will be available in 7.1.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 Commit Notification 2020-06-22 17:19:47 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

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

failed cell dependency check should not set invalid values (tdf#132451)

It will be available in 7.0.0.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 11 b. 2020-06-26 14:07:20 UTC
looks fixed with ver below: 

thanks @Luboš ... :-)

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 006c65bbd472cb1d7d44e095714e28190b76be0d
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL

(--- one bug killed --- [sarcasm] and it took only little more than one year from report to solution (report was tdf#124577!), that's quite fast ... [/sarcasm])
Comment 12 Xisco Faulí 2020-06-30 08:51:22 UTC
Verified in

Version: 7.1.0.0.alpha0+
Build ID: 63f3485b57904de4e77c04f5759e6563fcce6748
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Luboš Luňák, thanks for fixing this issue!
Comment 13 Commit Notification 2020-07-07 09:11:18 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/90e85e829cd2b934c750e005f43975e71ea21caa

failed cell dependency check should not set invalid values (tdf#132451)

It will be available in 6.4.6.

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 14 Luboš Luňák 2020-07-29 11:38:32 UTC
*** Bug 131340 has been marked as a duplicate of this bug. ***
Comment 15 b. 2020-11-01 09:04:20 UTC
*** Bug 134893 has been marked as a duplicate of this bug. ***
Comment 16 Aron Budea 2021-07-03 06:55:03 UTC
*** Bug 129753 has been marked as a duplicate of this bug. ***