Bug 98657 - SUM() isn't implemented according to general rules (with OpenCL active)
Summary: SUM() isn't implemented according to general rules (with OpenCL active)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: x86 (IA32) macOS (All)
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:5.2.0 target:5.1.3
Keywords: regression
Depends on:
Blocks: OpenCL
  Show dependency treegraph
 
Reported: 2016-03-14 20:45 UTC by Rob Tito
Modified: 2016-10-25 19:08 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
simple pressure/weather data (485.37 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-03-14 21:55 UTC, Rob Tito
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Tito 2016-03-14 20:45:38 UTC
SUM() doesn't work properly, it won't allow the summation of a column if it contains literals, such as a heading. it will produce an error (wrong data type) it was working properly in version 5.04xxxx. in version 5.1.xxxx th error was introduced
Comment 1 raal 2016-03-14 21:35:42 UTC Comment hidden (obsolete)
Comment 2 Rob Tito 2016-03-14 21:55:06 UTC
Created attachment 123574 [details]
simple pressure/weather data

If you try to add in tghe rext row a value, or 0, into the free cell AH78 will give you a funny result in the column AI, the sum over AH.
Comment 3 raal 2016-03-14 22:23:05 UTC
I can confirm with Version: 5.2.0.0.alpha0+
Build ID: 98a8eafa915b8d57b8bdccab9981e537d77f6f4a
CPU Threads: 1; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-02-25_00:49:33

after AH78=0   =>  AI78=#VALUE

works in 5.0.5, regression
Comment 4 Dennis Roczek 2016-03-14 23:01:01 UTC
I cannot confirm that!

Version: 5.1.1.3
Build-ID: 89f508ef3ecebd2cfb8e1def0f0ba9a803b88a6d
CPU-Threats: 4; BS-Version: Windows 6.2; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE)

Please (both) try to deactivate OpenCL and OpenGL calculations

I have deactivated OpenGL as it makes some smaller problems on my pc...
Comment 5 Rob Tito 2016-03-14 23:25:18 UTC
Still no answer. Version 5.0.3 works fine. Version 5.1.03 (release evrsion) is showing the mentioned behavior.
On a MAC using OS X 10.11.3 10.11.3 it's imnpossible to "restart OpenCl or OpenGl as there are no prefpanes for them.
Comment 6 raal 2016-03-15 07:52:00 UTC
(In reply to Dennis Roczek from comment #4)

> Please (both) try to deactivate OpenCL and OpenGL calculations


OpenCL doesn't make difference, but option "Allow to use of Software interpreter even when OpenCL is not available" is the culprit (tools/options/OpenCL)
Comment 7 Rob Tito 2016-03-15 17:44:04 UTC
Disabling OpenCl on MAC OS X (LibreOffice/Preferences/OpenCl, disabling both options gave a working SUM() function again.
To me that sounds like a workaround.

Any further comments on this? Will it be restored in the next version of LibreOffice, 5.1.0.3 is the present version in use?
Comment 8 Markus Mohrhard 2016-03-22 22:54:53 UTC
The problem is the SW interpreter which uses NAN to store empty cells. However the NAN special handling only works in the OpenCL backend and not in the SW interpreter which shares most of the code with the matrix backend and the normal interpreter code.

I have gone the easy way and just disabled the SW group interpreter now by default. IMHO the SW group interpreter is not ready for production code.
Comment 9 Commit Notification 2016-03-22 23:50:56 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

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

disable the SW interpreter by default, tdf#98657

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 10 Commit Notification 2016-03-24 13:44:33 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

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

tdf#98657: Fix a corner case when NaN's were added to ScFullMatrix.

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 11 Commit Notification 2016-03-24 13:44:37 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

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

Revert "disable the SW interpreter by default, tdf#98657"

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 12 Jan Holesovsky 2016-03-24 13:47:25 UTC
Now fixed, 5.1 version of the patch pushed to gerrit.
Comment 13 Commit Notification 2016-03-29 10:17:25 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

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

tdf#98657: Fix a corner case when NaN's were added to ScFullMatrix.

It will be available in 5.1.3.

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.