Bug 124270 - Editing: Err:522 on copying of rows with "Calc: threaded" enabled ( steps in comment 6 )
Summary: Editing: Err:522 on copying of rows with "Calc: threaded" enabled ( steps in ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: high major
Assignee: Dennis Francis
URL:
Whiteboard: target:6.4.0 target:6.3.4
Keywords: bibisected, bisected, regression
: 127789 (view as bug list)
Depends on:
Blocks: Calculate Calc-Threaded
  Show dependency treegraph
 
Reported: 2019-03-22 13:09 UTC by b.
Modified: 2019-12-19 19:03 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
calc_6.3.0.0.alpha0_error_522_2 (57.09 KB, image/jpeg)
2019-03-22 13:10 UTC, b.
Details
file where err:522 on insert is reproducible, 6_3_522_on_insert (69.13 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-03-23 08:48 UTC, b.
Details
screenshot with faulty calculation (283.53 KB, image/jpeg)
2019-09-12 11:30 UTC, b.
Details
Sample file showing the bug at opening. (361.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-10-07 20:01 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description b. 2019-03-22 13:09:05 UTC
Description:
when inserting rows in a long file with 'stacked columns' (long columns summed up bottom-to-top with cells from two other columns) and filling the inserted rows with copies from 'working' rows above or below the gap i get error 522 sometimes somewhere - see attached screenshot in next comment. 

ctrl-shift-F9 or inserting other copies corrected the fault up to now, but i think that shouldn't be neccessary, the sheet should be able to insert and calculate the formula in the same way as it does for the other lines. 

Steps to Reproduce:
not so easy, i took one row from my 'big sheet', copied it in rows 1 to 100 on another, inserted lines 6 to 10, copied line 15 to 4 - 12, got the error in lines 1 and two, cutted all stuff around, can provide screenshot, see attached. 

on save-load the error disappears as well as on strg-shift-F9, thus i cannot provide the file with error. 

Actual Results:
a cell with a clear simple formula without any circular references or similar is calculated to Err:522, 

Expected Results:
the cell should be calculated to a proper value instead, strg-shift-F9 or other actions shouldn't be neccessary while autocalculate is on


Reproducible: Sometimes


User Profile Reset: No



Additional Info:
Version: 6.3.0.0.alpha0+ (x64)
Build ID: 5a907fe76bc628629fddb5501727642468d38dae
CPU threads: 8; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-03-22_00:18:04
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

hardware / os: not tested with 'all', only win7(x64) on lenovo notebook, 

it looks like that the error likes to come up when you copy the formula in the gap with some overlap, e.g. insert 5 rows and copy the source row to nine rows two above and two below the gap, thus replacing rows with an identical copy
Comment 1 b. 2019-03-22 13:10:49 UTC
Created attachment 150180 [details]
calc_6.3.0.0.alpha0_error_522_2

screenshot for filed bug ...
Comment 2 b. 2019-03-22 13:21:25 UTC
forgot: the formula in B3 is a relative copy of B4, '=round(B4+sum(C3;D3);2)', 

i found one similar - old - report: 

https://listarchives.libreoffice.org/global/users/msg29316.html
Comment 3 m_a_riosv 2019-03-22 14:53:27 UTC
But without a sample file for test to reproduce the issue, how to find out what it's happening?

Please attach a sample file as simple as possible.
Comment 4 b. 2019-03-23 08:48:58 UTC Comment hidden (obsolete)
Comment 5 b. 2019-03-23 09:47:40 UTC Comment hidden (obsolete)
Comment 6 Oliver Brinzing 2019-03-24 09:04:58 UTC
reproducuble with:

Version: 6.3.0.0.alpha0+ (x64)
Build ID: f8251c40b4c512b6ea54ea2207a3816d8b925711
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

steps to reproduce:
- open attached spreadsheet
- select A2:G1027
- delete content
- select A1:G1
- drag down cell range for ~1000 rows
  -> Err:522
- hard recalc fixes Err:522

but *not* reproducible, if "Calc: threaded" is disabled:

Menu Tools/Options.../LibreOffice Dev Calc/Calculate
CPU threading settings
[ ] Enable multithreaded calculation

restart LO after change
Comment 7 Xisco Faulí 2019-03-25 16:13:08 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=906b505940f6330d2336164f341e338ff4b9b9ee

author	Luboš Luňák <l.lunak@collabora.com>	2019-01-25 15:08:16 +0100
committer	Luboš Luňák <l.lunak@collabora.com>	2019-01-28 11:01:06 +0100
commit 906b505940f6330d2336164f341e338ff4b9b9ee (patch)
tree 87de1e848215c0c0cfb22017fd859d807e87f482
parent 6f5991261a152812d5023fd146398c1528683676 (diff)
avoid a calc threads assert because of an undetected cyclic dependency

Bisected with: bibisect-linux64-6.3 

Adding Cc: to Luboš Luňák
Comment 8 b. 2019-05-15 13:45:48 UTC
nobody worked on it? 

but no-repro in Version: 6.3.0.0.alpha1+ (x64)

can somebody recheck? if no error 'wfm'. 

reg. 

b.
Comment 9 b. 2019-05-16 08:56:12 UTC
forget previous comment, 

it 'happened again', 

on copying! 21 lines in a large sheet with simple! calculations 'stacking up' from each previous line: 'error 522' two lines above! the area touched by insert in every column where the formula is referencing the cell underneath. 

ctrl-shift-F9 corrects the problem, thus a problem of autocalculate, (analysis), 

the problem affects areas with 'shared formulas', thus implementation of that still buggy, (assumption), 

the problem occurred with *threaded* enabled, thus a special case of distribution of shared formulae between threads, (assumption),
Comment 10 b. 2019-09-12 11:30:27 UTC
Created attachment 154135 [details]
screenshot with faulty calculation

hi there, 

sorry for insisting, 

the problem ist still apparent in: 

Version: 6.3.0.0.alpha1 (x64)
Build ID: 547edd20e527fb02900f6174973770d26306e2e7
CPU threads: 8; OS: Windows 6.1; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

cross checked: 

calc set to 'threaded', inserted about 12 empty lines, copied one working line with the formulas to the area 'one line above new space - free space - one line below thenew space' (to correct the 'expanded' formulas where the reference to the line below is held on insert and now points 13 lines below), two lines above the insertion area: error 522 in all columns with stacked formulas. 

calc reset to 'unthreaded', same procedure as above, no error. 

strg-shift-F9 'corrects' the error, thus still a problem of the combination of autocalculate and shared formulas, but occuring only in threaded mode. 

i'd be very happy if someone looks for it and brings calc 'threaded' back to a working state. 

reg.



b.
Comment 11 Xisco Faulí 2019-09-26 14:45:25 UTC
*** Bug 127789 has been marked as a duplicate of this bug. ***
Comment 12 Xisco Faulí 2019-09-26 14:46:07 UTC
Can be easily reproduced by opening https://bugs.documentfoundation.org/attachment.cgi?id=154545

Increasing severity...
Comment 13 b. 2019-09-27 17:56:47 UTC
@Xisco

as you and others can confirm the error, 

and as you know where it's evolving from, 

why not throw out that commit until a repaired version is available? 

- other modules may be affected by the buggy patch? 

that's an argument, but that all subsequent work implies the defect and may produce more erroneus dependencies is an argument not! to keep it. 

- this commit repairs something important? 

then it's urgent to work on it ... 

besides: ver 6.2.7.1 win(x64) looks quite healthy at first, it's the best version i've seen yet, but also in this version i had - very few but i had - appearences of wrong err:522's when working 'threaded'. the 'threading' module - 'i assume' - probably still contains some hard to find bugs. 

reg. 



b.
Comment 14 Dennis Francis 2019-10-07 16:13:18 UTC
I cannot reproduce this using the steps in comment 6 on master branch with HEAD at 46d0afba738d8ee7c9b63384fef513f42ee587f3

Version: 6.4.0.0.alpha0+
Build ID: cf43869d9226444b1295055382e7ff5c2c698e31
CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 15 Xisco Faulí 2019-10-07 16:21:43 UTC
(In reply to Dennis Francis from comment #14)
> I cannot reproduce this using the steps in comment 6 on master branch with
> HEAD at 46d0afba738d8ee7c9b63384fef513f42ee587f3
> 
> Version: 6.4.0.0.alpha0+
> Build ID: cf43869d9226444b1295055382e7ff5c2c698e31
> CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; 
> Locale: en-US (en_US.UTF-8); UI-Language: en-US
> Calc: threaded

Hi Dennis, you can easily reproduce it with this file: https://bugs.documentfoundation.org/attachment.cgi?id=154545 from bug 127789. Check columns H,I,K
Comment 16 Dennis Francis 2019-10-07 18:56:16 UTC
> 
> Hi Dennis, you can easily reproduce it with this file:
> https://bugs.documentfoundation.org/attachment.cgi?id=154545 from bug
> 127789. Check columns H,I,K

Yes I checked that file, but seems it is a different problem (but could be related) because in that document, Err:522 does not go away with a hard-recalc, but the current bug's original reporter says the Err:522 go away with a hard-recalc.
Comment 17 m_a_riosv 2019-10-07 20:01:34 UTC
Created attachment 154806 [details]
Sample file showing the bug at opening.

With 'thread' enable at opening attached file shows the errors, hard recalc works, but after that saving and reopening shows the errors again.
Disabling thread seems to solve the issue.
Comment 18 guillaume.ameline 2019-10-07 20:20:39 UTC
(In reply to m.a.riosv from comment #17)
> Created attachment 154806 [details]
> Sample file showing the bug at opening.
> 
> With 'thread' enable at opening attached file shows the errors, hard recalc
> works, but after that saving and reopening shows the errors again.
> Disabling thread seems to solve the issue.

Hi there,

As stated in my comment 5 here :
https://bugs.documentfoundation.org/show_bug.cgi?id=127789#c5

Disabling thread only seemed to solve the problem. No "Err :522", but erratic result judging by the discontinuous red curve obtained on the graphs, on FiltrageVent sheet.

I tried that on build 6.3.2.2

Best regards,
Guillaume AMELINE
Comment 19 m_a_riosv 2019-10-31 23:14:42 UTC
*** Bug 128517 has been marked as a duplicate of this bug. ***
Comment 20 Commit Notification 2019-11-07 06:57:13 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

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

tdf#124270 : improve formula-group cycle detection

It will be available in 6.4.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 21 Commit Notification 2019-11-07 06:57:22 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/989240664c33bc83800e27c1c0e718294321f46a

tdf#124270 : unit-tests for spurious Err:522 fixes

It will be available in 6.4.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 22 Dennis Francis 2019-11-07 07:04:51 UTC
This is fixed for 6.4, now I need to port my patch to 6.3.
Comment 23 Xisco Faulí 2019-11-08 09:39:19 UTC
(In reply to Dennis Francis from comment #22)
> This is fixed for 6.4, now I need to port my patch to 6.3.

Hi Dennis, thanks for fixing this issue.
Your commits rely on https://cgit.freedesktop.org/libreoffice/core/commit/?id=845e1cdca3349c72e3083186502285d5b776abbe which makes it not straightforward for the backporting
Comment 24 Dennis Francis 2019-11-12 10:35:02 UTC
(In reply to Xisco Faulí from comment #23)
> Hi Dennis, thanks for fixing this issue.
> Your commits rely on
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=845e1cdca3349c72e3083186502285d5b776abbe which makes it not
> straightforward for the backporting

Yes, I'm working on it.
Comment 25 Commit Notification 2019-11-14 10:14:49 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

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

tdf#124270 : improve formula-group cycle detection

It will be available in 6.3.4.

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 26 Commit Notification 2019-11-14 14:25:12 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/94b2724268e8c394b90b8971171f4d038cd74088

tdf#124270 : unit-tests for spurious Err:522 fixes

It will be available in 6.3.4.

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 27 guillaume.ameline 2019-12-19 19:03:15 UTC
Wow...

Thank you very much for the fix!

My project works perfectly on 6.3.4, Windows 8.1 and Windows 10. I will test it with Ubuntu 18.04 soon.

I am just amazed at how complicated it must have been.