Bug 99053 - Software interpreter: Absolute and relative cell references produce unexpected results when using summation function
Summary: Software interpreter: Absolute and relative cell references produce unexpecte...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OpenCL
  Show dependency treegraph
 
Reported: 2016-04-02 21:05 UTC by Harry Friday
Modified: 2016-07-14 13:45 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple summation operations (2.84 MB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-04-02 21:11 UTC, Harry Friday
Details
LibreOffice log file (requested) (289 bytes, text/plain)
2016-04-04 01:28 UTC, Harry Friday
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harry Friday 2016-04-02 21:05:05 UTC
User-Agent:       Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36
Build Identifier: LibreOffice 5.1.0.3

In Calc, the summation function gives incorrect results, depending on whether absolute or relative cell references are used.  Details appear on the affected spreadsheet.  The problem seem related to my earlier bug report 98966.

Reproducible: Always

Steps to Reproduce:
1.See attached spreadsheet (if requested):
2.Place cursor in (for example) cell I840
3.Cycle function key F4, note incorrect results in cell I840
4.Move cursor to another cell in column I, repeat cycling and observe result
Actual Results:  
1.Cell I840 is initially correct in the file as saved, but becomes wrong when F4 is cycled.
2. With only cell I840 selected, ENTIRE column I is affected by cycling F4

Expected Results:  
1.Cell I840 should sum to 12
2.Cycling F4 should not alter the value (12) and should not affect all of column I

[Information automatically included from LibreOffice]
Locale: en-US
Module: StartModule
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no


Reset User Profile?No
Comment 1 Harry Friday 2016-04-02 21:11:03 UTC
Created attachment 124033 [details]
Simple summation operations

This is the second file recently submitted in which the summation function produces incorrect results.  There are some differences in the behavior of summation function in the two files.  Please also see bug report 98966.
Comment 2 m_a_riosv 2016-04-02 22:20:29 UTC
Works fine for me, Win10x64.
Version: 5.1.2.2 (x64)
Build ID: d3bf12ecb743fc0d20e0be0c58ca359301eb705f
CPU Threads: 4; OS Version: Windows 6.19; UI Render: GL; 

Please test disabling Menu/Tools/Options/LibreOffice/OpenCl - OpenCL.
Comment 3 Harry Friday 2016-04-03 21:24:08 UTC
Menu/Tools/Options/LibreOffice/OpenCl

Allow use of Software Interpreter   | 1| 0| 1| 0|
Allow the use of OpenCL             | 0| 1| 1| 0|
Error(NG) or No error(OK)           |NG|OK|NG|OK|

Notes:

A) In chart: "1" = selected

B) With "Allow use of Software Interpreter" checked, The example file 
initially sums correctly, but begins to error when F4 is toggled.  Only 
reloading file will again show a correct summation.
Comment 4 m_a_riosv 2016-04-03 21:59:35 UTC
I can't confirm because for me it's always fine.

As OpenCL is hardware/software dependant, please attach the file:
C:\Users\USER??\AppData\Roaming\LibreOffice\4\cache\opengl_device.log

It has the information about graphics harware.

Mine is:
DriverVersion: 15.300.1025.0
DriverDate: 11-17-2015
DeviceID: PCI\VEN_1002&DEV_68E0&SUBSYS_03471025&REV_00
AdapterVendorID: 0x1002
AdapterDeviceID: 0x68e0
AdapterSubsysID: 0x03471025
DeviceKey: System\CurrentControlSet\Control\Video\{A117FD0C-8634-4653-B103-3717F28D56EA}\0000
DeviceString: AMD Mobility Radeon HD 5000 Series
Comment 5 Harry Friday 2016-04-04 01:28:34 UTC
Created attachment 124050 [details]
LibreOffice log file (requested)

Here's the requested log file.
Comment 6 m_a_riosv 2016-04-04 10:38:05 UTC
Thanks Harry.
Comment 7 orchard.green 2016-06-01 16:24:10 UTC
when using sum it does not always incorporate every cell highlighted but misses first cell.
sum also does not add column correctly. many times it is .01, .02 out.
Comment 8 orchard.green 2016-06-01 16:26:15 UTC Comment hidden (no-value)
Comment 9 How can I remove my account? 2016-06-22 05:13:53 UTC Comment hidden (obsolete)
Comment 10 How can I remove my account? 2016-06-22 05:18:21 UTC
This is not related to OpenGL. The opengl_device.log file is not relevant.
Comment 11 How can I remove my account? 2016-06-22 05:19:40 UTC
OpenGL is not the same as OpenCL. OpenGL is a *graphics* API, OpenCL is a much newer *computation* API.
Comment 12 How can I remove my account? 2016-06-23 15:23:20 UTC
As comment #3 clearly indicates, this is most likely a problem with the "software interpreter", not OpenCL, thus not directly related to what GPU hardware you have or its drivers.

(It is indirectly related in the sense that if you don't have OpenCL-capable hardware, or it is not good enough (blacklisted or otherwise noticed to lack required capabilities), then the software interpreter will be used. Ideally OpenCL should be used.)
Comment 13 How can I remove my account? 2016-06-23 16:54:22 UTC
Sorry, can not reproduce with a fresh master build, and not with the TDF builds 5.1.0.2  or 5.1.4.1 either. For each, I did: 1) delete my profile (in the case of installations done with the "Separate Install GUI" tool, the 'user' and 'cache' subdirectories), 2) start the soffice.exe in question, Tools:Options:OpenCL, turn off 'Allow use of OpenCL' but keep the 'Allow use of Software Interpreter' on, 3) exit and start LibreOffice again, 4) load the attached document and try what it says. The column I stays as is.
Comment 14 How can I remove my account? 2016-06-23 16:55:33 UTC
orchard.green: You need to give a much more specific and detailed description of the problem you are seeing, and in a separate bug report, please, for it to be taken seriously.
Comment 15 Harry Friday 2016-06-23 18:48:27 UTC
I'm not sure it's relevant, but while the problem (see comment 3) exists in version 5.1.0.3 (32 bit) installed on one of my machines, it does not occur with version 5.1.3.2 (64 bit) installed on my other machine.
Comment 16 How can I remove my account? 2016-06-28 09:29:13 UTC
Please try 5.1.3 or 5.1.4.
Comment 17 Michael Meeks 2016-06-29 14:39:32 UTC
$ git log libreoffice-5.1.0.2..libreoffice-5.1.3.2 -- sc/source/core/inc/arraysumfunctor.hxx

commit 9b7f72203f2b9f6b95d927c695f7f48b86b251ee
Author: Marco Cecchetti <marco.cecchetti@collabora.com>
Date:   Mon Feb 29 22:18:23 2016 +0100

    tdf#97369/#97587 - Further fix SUMming in the software interpreter

commit aa064e8209e57ac91f16305d38e657d12a42093f
Author: Tor Lillqvist <tml@collabora.com>
Date:   Fri Feb 5 14:58:11 2016 +0200

    tdf#97587: Treat plain NaNs as zero in the software interpreter for SUM

Could be a duplicate of either of these fixes; feedback appreciated =)
Comment 18 Michael Meeks 2016-07-12 09:41:10 UTC
Assuming fixed by the aforementioned commits. Please do test however with any recent 5.1.x or 5.2.x pre-release.

Thanks !
Comment 19 Harry Friday 2016-07-13 17:55:01 UTC
I rechecked the behavior of LibreOffice version 5.1.0.3, confirming that the reported problem was repeatable.  I then installed 5.1.4.2 on my WinXP SP3 machine where the summation problem first appeared.  The summation function now operates correctly.  Repeating my earlier tests of the OpenCL and Software Interpretor settings, I tabulated the following result:

Menu/Tools/Options/LibreOffice/OpenCL

Allow use of Software Interpreter   | 1| 0| 1| 0|
Allow the use of OpenCL             | 0| 1| 1| 0|
Error(NG) or No error(OK)           |OK|OK|OK|OK|

Again, the summation problem appears to be resolved and fixed.  Thanks!
Comment 20 Michael Meeks 2016-07-14 13:45:14 UTC
Thanks; changing resolution then =)