Bug 116468 - Crash in: formula::FormulaCompiler::CreateStringFromToken(rtl::OUStringBuffer &,formula::FormulaToken const *,bool) (steps in comment 15)
Summary: Crash in: formula::FormulaCompiler::CreateStringFromToken(rtl::OUStringBuffer...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: highest critical
Assignee: Eike Rathke
URL:
Whiteboard: target:6.1.0 target:6.0.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2018-03-18 13:20 UTC by c18florentino
Modified: 2018-04-03 10:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["formula::FormulaCompiler::CreateStringFromToken(rtl::OUStringBuffer &,formula::FormulaToken const *,bool)"]


Attachments
Selecting desired function (24.66 KB, image/png)
2018-03-19 12:49 UTC, c18florentino
Details
On trying insert formula Base crashes (57.01 KB, image/png)
2018-03-19 12:52 UTC, c18florentino
Details
BEFORE (77.11 KB, image/png)
2018-03-19 14:48 UTC, c18florentino
Details
AFTER (469.31 KB, image/png)
2018-03-19 14:52 UTC, c18florentino
Details
before crash in example DB (86.08 KB, image/png)
2018-03-19 19:33 UTC, c18florentino
Details
crash with no recovery (472.89 KB, image/png)
2018-03-19 19:34 UTC, c18florentino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description c18florentino 2018-03-18 13:20:54 UTC
This bug was filed from the crash reporting server and is br-7412a6b2-8f92-4a61-891f-2ba9b8a7dc26.
=========================================
REPORT BUILDER
When trying to insert (apparently any) function in report control (text box) via Function Wizard, LO crashes.
Comment 1 Buovjaga 2018-03-18 14:23:06 UTC
Ok, I did Insert - Report controls - Text box, what do I do next?
Comment 2 c18florentino 2018-03-19 12:49:16 UTC
Created attachment 140706 [details]
Selecting desired function
Comment 3 c18florentino 2018-03-19 12:52:12 UTC
Created attachment 140707 [details]
On trying insert formula Base crashes
Comment 4 c18florentino 2018-03-19 12:55:31 UTC
Try inserting (apparently any) function from thw wizard -- e.g. into a conditional formatting.
When Next pressed Base crashes.
Comment 5 Buovjaga 2018-03-19 13:02:22 UTC
(In reply to c18florentino from comment #2)
> Created attachment 140706 [details]
> Selecting desired function

How do I get this?
Comment 6 c18florentino 2018-03-19 14:29:55 UTC
Say you have field1 and desires to have report line (detail section) of field2 printed only IF field1 IS NOT NULL.
How do you do it in Report Builder?
Comment 7 c18florentino 2018-03-19 14:34:24 UTC
CONDITIONAL FORMATTING >
=NOT(IS BLANK(field1))

But note that apparently this happens with any function in the expression builder.
And only in 6.x
I've never noted this in previous versios of LO Base.
Comment 8 c18florentino 2018-03-19 14:48:50 UTC
Created attachment 140709 [details]
BEFORE

selecting desired function BEFORE trying to insert
Comment 9 c18florentino 2018-03-19 14:52:08 UTC
Created attachment 140710 [details]
AFTER

When try to insert the formula LO crashes immediately
Comment 10 c18florentino 2018-03-19 14:54:47 UTC
Another example from
ANOTHER MACHINE with W-10 1709 32bits
6.0.2.1
ANOTHER DATABASE

Same crash
Comment 11 Buovjaga 2018-03-19 15:30:25 UTC
(In reply to c18florentino from comment #8)
> Created attachment 140709 [details]
> BEFORE
> 
> selecting desired function BEFORE trying to insert

Please tell me exactly what I have to do to get this dialog.
Comment 12 Xisco Faulí 2018-03-19 15:58:42 UTC Comment hidden (obsolete)
Comment 13 c18florentino 2018-03-19 17:23:20 UTC
Build a query (I think it could be just 1 field);
build a report on the query;
try to add a function (e.g. as I've exemplified above) in the field's datasource ("formula or field" property).
Best yet: check the report error and o you should be able to check the log.
I am not (able to do so)...
Comment 14 c18florentino 2018-03-19 17:31:07 UTC
SELECT field1, field2 FROM your_table;
REPORT DESIGNER ADD >> field1 filed2
Let's say you want a conditional formatting so to field2 just gets printed (in report's detail) if field1 IS NOT NULL

But take notice that this is just an example. It appears that the proplem is with ANY function in the wizard.
So, I think best is not to fous on a particular example but to look into the log as it shows that the problem happened and where in the code.
Comment 15 Buovjaga 2018-03-19 18:01:48 UTC
Ok, I can repro.

Steps:

1. Open any database, for example attachment 140158 [details]
2. Click Reports - Create report in design view
3. Insert - Report controls - Text box
4. In the Data deck of the sidebar, click the "..." next to "Data field"
5. Double-click any function

Bisected to https://cgit.freedesktop.org/libreoffice/core/commit/?id=bf1ffc64128f5b96d7c2fcc7adc81cbc25e232fd

FormulaDlg_Impl::UpdateValues: evaluate in force-array context if present

Arch Linux 64-bit
Version: 6.1.0.0.alpha0+
Build ID: c70471a0f984f1c5be7cb5eeaf88e71b17c903ee
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 19th 2018
Comment 16 Xisco Faulí 2018-03-19 18:08:53 UTC
Adding Cc: to Eike Rathke
Comment 17 c18florentino 2018-03-19 19:33:30 UTC
Created attachment 140721 [details]
before crash in example DB
Comment 18 c18florentino 2018-03-19 19:34:36 UTC
Created attachment 140722 [details]
crash with no recovery
Comment 19 c18florentino 2018-03-19 19:43:27 UTC
In the example DB let's say want to conditional format field txt on
ISEVEN(ID)
txt > Properties > CF >
1. Select ISEVEN conditional [before crash in example DB]
2. Next (to insert the function) [crash with no recovery]
Absolute crash with no immediate recovery. Needed to call Task Manager >
End Task LO
before recovery of .odb
Comment 20 Eike Rathke 2018-03-20 10:23:43 UTC
Taking.
Comment 21 Commit Notification 2018-03-20 13:29:12 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#116468 do not check array/matrix context for reportdesign

It will be available in 6.1.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 22 Eike Rathke 2018-03-20 13:36:17 UTC
Pending review
https://gerrit.libreoffice.org/51642 for 6-0
https://gerrit.libreoffice.org/51643 for 6-0-3
Comment 23 Commit Notification 2018-03-21 16:18:48 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

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

Resolves: tdf#116468 do not check array/matrix context for reportdesign

It will be available in 6.0.4.

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 24 Commit Notification 2018-03-29 10:56:00 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-0-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=084e02969dad50e6a5e636bb6391f52113dec096&h=libreoffice-6-0-3

Resolves: tdf#116468 do not check array/matrix context for reportdesign

It will be available in 6.0.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.