Bug 75387 - String results become upcased when using the "software interpreter"
Summary: String results become upcased when using the "software interpreter"
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.1.1 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0 target:5.1.5 target:5.2.0.2
Keywords:
: 76167 99753 99854 100803 102079 (view as bug list)
Depends on:
Blocks: OpenCL
  Show dependency treegraph
 
Reported: 2014-02-22 22:35 UTC by Andras Timar
Modified: 2016-09-12 15:28 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Bugdoc (11.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-06-28 09:09 UTC, Tor Lillqvist
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Timar 2014-02-22 22:35:29 UTC
Turn on OpenCL computing. Tools - Options - LibreOffice Calc - Formula - Detailed Calculation Settings - Custom - Details... - Enable OpenCL for some formula computation: True

In A1 enter 'aaaa'. In B1 enter '=A1'. B1 will contain 'aaaa'. Now enter 'bbbb' in A2. In B2 enter '=A2'. B1 and B2 will contain '#NULL'.
Comment 1 Andras Timar 2014-02-22 22:38:54 UTC
My OpenCL driver is 'Internal, software interpreter'.
Comment 2 Markus Mohrhard 2014-02-22 23:50:04 UTC
Hey Andras. The Internal, software interpreter is not an OpenCL device/driver. It is a internal version for testing and might sadly still expose some bugs.

If you want to test the OpenCL driver and don't have a suitable graphics driver you can use the AMD OpenCL SDk which works with any CPU.
Comment 3 Andras Timar 2014-03-22 09:14:38 UTC
*** Bug 76167 has been marked as a duplicate of this bug. ***
Comment 4 Andras Timar 2014-03-27 15:43:33 UTC
Confirmed by duplicate.
Comment 5 Kohei Yoshida 2014-04-17 00:24:55 UTC
Yup. This is a known issue. It started doing it all of a sudden, and I haven't come around to look into it yet.
Comment 6 Kohei Yoshida 2014-05-12 14:06:30 UTC
I believe this was caused by the earlier implementation of kernel precompilation.  We decided to disable that later, so the latest version shouldn't do this anymore.
Comment 7 Andras Timar 2014-05-12 16:40:36 UTC
(In reply to comment #6)
> I believe this was caused by the earlier implementation of kernel
> precompilation.  We decided to disable that later, so the latest version
> shouldn't do this anymore.

Yes, current build from libreoffice-4-2 does not do it any more. It exhibits a different bug now. :)

In A1 enter 'aaaa'. In B1 enter '=A1'. B1 will contain 'aaaa'. Now enter 'bbbb' in A2. In B2 enter '=A2'. B1 and B2 will contain 'AAAA' and 'BBBB' respectively.
Comment 8 Kohei Yoshida 2014-05-12 18:11:59 UTC
That's currently by design, unfortunate it may be.  String handling with OpenCL backend is extremely limited.
Comment 9 Markus Mohrhard 2014-07-02 22:35:44 UTC
Let us remove the regression keyword as it is related to a new feature.
Comment 10 QA Administrators 2015-07-18 17:43:20 UTC Comment hidden (obsolete)
Comment 11 Aron Budea 2016-06-05 03:58:50 UTC
*** Bug 99753 has been marked as a duplicate of this bug. ***
Comment 12 Aron Budea 2016-06-05 04:07:20 UTC
It seems that the setting described here is an addition since this bug report: https://bugs.documentfoundation.org/show_bug.cgi?id=99753#c20

You have to have at least as many references as set as minimum data size for OpenCL here: 'Tools -> Options... -> LibreOffice Calc -> Formula -> Detailed Calculation Settings -> Custom -> OpenCL Settings -> Minimum data size for OpenCL use' (100 by default)

If that's met, the bug still occurs in current master build.
Comment 13 Aron Budea 2016-06-22 02:34:08 UTC
Kohei, the issue is in sc/source/core/data/column2.cxx.

I'd point to [1] in this case, but there are a couple of other getDataIgnoreCase() in calls that might also be relevant.

[1] (*rColArray.mpStrArray)[nPos] = itData->getDataIgnoreCase();
http://opengrok.libreoffice.org/xref/core/sc/source/core/data/column2.cxx#2340
Comment 14 Aron Budea 2016-06-23 02:55:45 UTC
*** Bug 99854 has been marked as a duplicate of this bug. ***
Comment 15 Tor Lillqvist 2016-06-23 12:31:27 UTC
Can the original problem really be reproduced? (With more than 100 copies of the rows.) If not, surely this should be resolved, instead of being kept open without any clear description of what the actual bug is.

The intent has definitely been for quite some time that nothing using strings should go through OpenCL at all any longer. The OpenCL implementation of string stuff was indeed fairly broken, one thing indeed being that strings were uppercased at some stage.
Comment 16 Aron Budea 2016-06-23 21:02:30 UTC
The issue described in Comment 7 can be reproduced. See it described with specific steps in duplicate report bug 99753, comments 17 and 21 (though the steps described in Comment 7 here is equally adequate knowing it's related to the Software Interpreter, which is implied in Comment 1).
Comment 17 Tor Lillqvist 2016-06-27 12:16:58 UTC Comment hidden (obsolete)
Comment 18 Tor Lillqvist 2016-06-27 12:21:32 UTC
Ah! Indeed, now I can reproduce. So it is the infamous "software interpreter" indeed. (And not OpenCL.) Sigh... Editing the bug title to match reality, there is no such thing as an "OpenCL interpreter" in LibreOffice. "cell group interpreter" would be more correct. But sure, let's just call it "software interpreter".
Comment 19 Tor Lillqvist 2016-06-27 12:30:12 UTC
I mean "formula group", not "cell group", sorry. "Formula group" is the term used in the code.
Comment 20 Tor Lillqvist 2016-06-28 09:09:36 UTC
Created attachment 125959 [details]
Bugdoc

It is of course trivial and fast to construct a reproducing document manually, but anyway here is also a ready-made such document, for completeness.
Comment 21 Tor Lillqvist 2016-06-28 09:26:06 UTC
Suggested patch at https://gerrit.libreoffice.org/#/c/26729/ . But I am a bit scared to approve it. Will it break something else instead?
Comment 22 Commit Notification 2016-06-28 13:15:34 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

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

tdf#75387: Don't case-fold strings for formula group calculations

It will be available in 5.3.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 23 Tor Lillqvist 2016-06-29 12:02:51 UTC
Looked harder and am now fairly convinced that the patch will not break anything else. Patch is in master, awaiting review in Gerrit for 5.2 and 5.1. Resolving as fixed.
Comment 24 Commit Notification 2016-06-29 13:46:01 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

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

tdf#75387: Don't case-fold strings for formula group calculations

It will be available in 5.1.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.
Comment 25 Commit Notification 2016-06-29 13:47:27 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6fd975b1f6aca9fd26a202b4997a0485e1b8de46&h=libreoffice-5-2

tdf#75387: Don't case-fold strings for formula group calculations

It will be available in 5.2.0.2.

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 26 Aron Budea 2016-07-08 02:59:12 UTC
*** Bug 100803 has been marked as a duplicate of this bug. ***
Comment 27 Aron Budea 2016-09-12 15:28:29 UTC
*** Bug 102079 has been marked as a duplicate of this bug. ***