Bug 95748 - FILEOPEN: erroneous circular reference (Err:522) when loading a .xls file
Summary: FILEOPEN: erroneous circular reference (Err:522) when loading a .xls file
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.2.0 target:5.1.0.1 target:5...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-11 17:21 UTC by Ruslan Fatakhov
Modified: 2016-10-25 19:11 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
File with problem (83.50 KB, application/vnd.ms-excel)
2015-11-11 17:21 UTC, Ruslan Fatakhov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Fatakhov 2015-11-11 17:21:00 UTC
Created attachment 120482 [details]
File with problem

In cell G3 formula is =F3*L3, where L3 is percent value. Instead value i get error:522. For ods, xlsx this problem doesn't exist
Comment 1 Eike Rathke 2015-11-11 18:45:07 UTC
A hard recalculate (Shift+Ctrl+F9) or even a simple reload solves the problem. Not sure yet what's going on there..
Comment 2 MM 2015-11-11 22:02:34 UTC
Does turning off OpenCL fix the problem ???
Maybe the same as bug 94924 then ?!
Comment 3 Eike Rathke 2015-11-17 02:04:15 UTC
This is indeed due to OpenCL being enabled, though it is not OpenCL that fails..

@tml (as you were lately working on OpenCL and group calculation):
Breaking in ScFormulaCell::Interpret() in if(bRunning) and going up the stack reveals that calculation was entered through ScFormulaCell::InterpretFormulaGroup() and ScGroupTokenConverter::convert() and ScColumn::FetchVectorRefArray(). In appendBlock() of sc/source/core/data/column2.cxx for sc::element_type_formula blocks the sc::FormulaResultValue is checked for ScErrorCodes::errCircularReference and the formula cell is reset (with comment "This cell needs to be recalculated on next visit."). However, if the calculation dependencies involved other cells that already resulted in errCircularReference which then is propagated, resetting only that cell doesn't help, actually all cells that it depends on and their predecessors would have to be reset as well.

This first happens for cell J4 on sheet 2 (ScAddress ScFormulaCell::aPos == {nRow = 3, nCol = 9, nTab = 1})

To me that approach can not work as the reverse dependency information is not available and I'd entirely disable handling sc::element_type_formula in appendToBlock() and immediately return false instead.

Other opinions?
Comment 4 Eike Rathke 2015-12-01 10:27:38 UTC
I'm trying some different approach first.
Comment 5 Commit Notification 2015-12-01 13:14:38 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d46203b55d92185ab2c1d3ac79761100d26aaee3

Resolves: tdf#95748 no group interpreter when calculations are running

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2015-12-01 13:23:34 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=14096319475eca0c738cbd71267a1f2123361897&h=libreoffice-5-1

Resolves: tdf#95748 no group interpreter when calculations are running

It will be available in 5.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Eike Rathke 2015-12-01 13:37:44 UTC
Pending review https://gerrit.libreoffice.org/20328 for 5-0
Comment 8 Commit Notification 2015-12-03 12:24:04 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e389e2b2d9bc87e451628e6f3f227d0eb781cf8b&h=libreoffice-5-0

Resolves: tdf#95748 no group interpreter when calculations are running

It will be available in 5.0.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.