Bug 148982 - Multiple Operations fail to work with long sequences of dependent cells
Summary: Multiple Operations fail to work with long sequences of dependent cells
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL: https://ask.libreoffice.org/t/calc-ge...
Whiteboard:
Keywords:
: 148977 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-05-08 09:26 UTC by Mike Kaganski
Modified: 2022-07-06 21:38 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Demonstration of the milit of 400 formula steps (33.73 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-06-07 10:55 UTC, Wolfgang Jäger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2022-05-08 09:26:24 UTC
1. In a new Calc document, put number '1' to A1.
2. Put '=A1+1' to A2.
3. Copy A2, and paste into A3:A300000
4. Check that A300000 shows '300000'
5. Put number '2' to B1
6. Select B1:C1
7. Run Data->Multiple Operations
8. Put 'A300000' to Formulas, 'A1' to 'Column input cell', and click OK.

=> Err:522 ("Circular reference") is shown in C1, and also in some bottommost cells in A column (A299999 and A300000)

9. Put cursor to C3, and hit F9 (recalculate)

=> more cells show Err:522 in column A (starting from A299600).

10. Delete B1:C1, and hit Ctrl+Shift+F9 (hard recalc)

=> Err:522 is still shown in A299600:A300000.

11. Save and reload

=> all cells in A show expected numbers again.

This is repro also in OO0 3.3.0; in current LO, it doesn't depend on OpenCL and/or multi-threaded calculations.
Comment 1 Regina Henschel 2022-05-08 13:26:08 UTC
Same as in bug 148983.
"A cell, which contains the current value must not depend on cells which are used in the sample calculation, neither directly nor indirectly."

*** This bug has been marked as a duplicate of bug 148983 ***
Comment 2 Mike Kaganski 2022-05-08 13:28:04 UTC
(In reply to Regina Henschel from comment #1)

OMG.
Please read the comment in bug 148983 that explains that the quote has nothing to do with the problem there; and also please execute what is explained here to see that this is completely different both to the quote and to the bug 148983.
Comment 3 Regina Henschel 2022-05-08 14:45:24 UTC
Sorry Mike, you are right.
I do not get an error, but a wrong result. That is worse than an error.

Curious, =MULTIPLE.OPERATIONS(A$401;A1;$B1) has correct result, whereas =MULTIPLE.OPERATIONS(A$402;A1;$B1) is wrong.


In addition there is an update problem in column A. If you change the value in A1, values below row 53 (about) are not updated. But you need to hard recalculate.
Comment 4 snarfolus 2022-06-07 09:11:52 UTC
I am experiencing what appears to be the same bug in LibreOffice 6.4.7.2 (build ID: 1:6.4.7-0ubuntu0.20.04.4).
Comment 5 Wolfgang Jäger 2022-06-07 10:55:04 UTC
Created attachment 180618 [details]
Demonstration of the milit of 400 formula steps

Experimenting with Mike's model (in V 7.3.3.2 -64- under Win10) I got a maximum of 400 steps (result formula from A$401) MULTIPLEOPERATIONS() worked correctly with. 
Very strange! Looks like the consequence of an arbitrary decision which didn't find its way into specifying/helping texts.
See attachment.
Comment 6 Wolfgang Jäger 2022-06-07 10:59:32 UTC
(In reply to snarfolus from comment #4)
> I am experiencing what appears to be the same bug in LibreOffice 6.4.7.2
> (build ID: 1:6.4.7-0ubuntu0.20.04.4).

Sorry. You won't get fixed old versions. 
I veryfied the bug as showing in my example also with LibO V3.3 Portable.
That's the all-heritage version.
Comment 7 Eike Rathke 2022-07-06 21:22:38 UTC
This is a problem of MULTIPLE.OPERATIONS() (TableOp) accessing the recursion in column A (through the A$1 or A$255 or A$401 or A$402 "replacements"). The maximum recursion limit is 400 after which further blocks of recursions are assembled in reverse (logically forward) order and if completed all cells are iterated. In a TableOp scenario this seems to prematurely end, hence it works until A$401 but not from A$402 on.
Needs further investigation.
Comment 8 Eike Rathke 2022-07-06 21:34:22 UTC
*** Bug 148977 has been marked as a duplicate of this bug. ***
Comment 9 Eike Rathke 2022-07-06 21:38:33 UTC
When fixing, https://bugs.documentfoundation.org/attachment.cgi?id=179987 of bug 148977 should be confirmed or that bug reopened.