Bug 117795 - Base crashes when selecting all controls on a Report and trying to change the font
Summary: Base crashes when selecting all controls on a Report and trying to change the...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:6.2.0 target:6.1.1 target:6.0.7
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2018-05-25 09:56 UTC by Vas
Modified: 2018-08-16 15:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test database (8.77 KB, application/octet-stream)
2018-05-29 08:08 UTC, Vas
Details
Screenshot of active Format menu in report design mode when all report objects selected (292.76 KB, image/png)
2018-05-29 13:31 UTC, Alex Thurgood
Details
Screen shot of changing font (50.60 KB, image/png)
2018-05-29 13:58 UTC, Vas
Details
bt with debug symbols (11.57 KB, text/plain)
2018-08-11 20:43 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vas 2018-05-25 09:56:34 UTC
Description:
When I create a font and I want to change all of the fonts to be the same, I selected all controls, forgetting that there were some lines and boxes included. I go to change the font and LO crashes straight away.

Steps to Reproduce:
1. Create a Report in Base
2. Press Ctrl+A to select all controls regardless of font control or not
3. Go and change the font
4. LO crashes

Actual Results:  
I get an error box stating

---------------------------
LibreOffice 6.0 - Fatal Error
---------------------------
CharFontName
---------------------------
OK   
---------------------------

I click OK and LO closes. I need to recover the database when I reopen LO.

Expected Results:
Fonts are changed where they can be changed. All objects where this property cannot be changed or is not available, is ignored.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.0.4.2 (x64)
Build ID: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf
CPU threads: 4; OS: Windows 6.1; UI render: default; 
Locale: en-GB (en_GB); Calc: group



User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.183 Safari/537.36 Vivaldi/1.97.1183.3
Comment 1 Drew Jensen 2018-05-25 14:11:57 UTC
I don't have Windows to test on but I did try this with 64bit Linux, using 6.0.4.2 released. 

Unable to reproduce this - selecting all controls on a report that have a font attribute I can change them all. If any of the selected controls do not have a font attribute then the ability to change the font setting is disabled, by design.

HOWEVER - this is using Report Builder reports. By chance are you using the default report type? The report wizard that is available if the Report Builder extension is not available.
Comment 2 Vas 2018-05-25 14:34:52 UTC
Hi, I'm creating a report via the built-in system, not another external tool. My database is embedded not external.
Comment 3 Vas 2018-05-25 14:49:06 UTC
Let me clarify. When I select the Report Icon on the left hand side, I have two options "Create Report in Design view" and "Use Wizard..."

I normally use the wizard to generate the first pass of the report, then I go in afterwards and make the changes I need. Either way, it is the same front end to design the form by the look of it.

I had assumed you were talking about an external tool, as I don't know of another way to generate a report other than what I have said just now.
Comment 4 Drew Jensen 2018-05-25 18:17:22 UTC
Your using the Report Builder extension, the libreoffice folks just include by default.

Anyway, tried a few other builds still can't reproduce it. So perhaps it is Windows only.

An example database with the report that crashes the application when you change fonts would be helpful.
Comment 5 Xisco Faulí 2018-05-28 17:30:38 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
Comment 6 Vas 2018-05-29 08:08:52 UTC
Created attachment 142370 [details]
Test database

Added database as requested
Comment 7 Vas 2018-05-29 08:10:06 UTC
Hi, sorry for the late reply, I was busy over the weekend. I have created a fresh database, and a single report that contains the same controls as my version.

I selected everything as before, changed the font and got the same error. Base didn't crash, but it managed to lockup Base to the point where I had to restart the computer in order to close it.
Comment 8 Alex Thurgood 2018-05-29 09:10:38 UTC
(In reply to Drew Jensen from comment #1)
> I don't have Windows to test on but I did try this with 64bit Linux, using
> 6.0.4.2 released. 
> 
> Unable to reproduce this - selecting all controls on a report that have a
> font attribute I can change them all. If any of the selected controls do not
> have a font attribute then the ability to change the font setting is
> disabled, by design.
> 

Confirming Drew's findings.

If I open a Report in Edit mode, and select all objects with Cmd-A (on Mac), then setting a Font property is not available (because some of the objects don't have a font property) - this works as designed.

@Vas : please explain how you select the controls and which controls you mean.

Please also indicate if you are doing anything different to what I have indicated above in my test reproduction scenario.
Comment 9 Alex Thurgood 2018-05-29 09:14:07 UTC
I tested with

Version: 6.2.0.0.alpha0+
Build ID: 7f3c2ee6c135773c98ded063bdf10ec8900bf00f
CPU threads: 4; OS: Mac OS X 10.13.4; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group threaded
Comment 10 Alex Thurgood 2018-05-29 09:20:33 UTC
Using the test database provided by the OP :

1) Open the ODB file in LO.
2) Select Reports
3) Right-mouse button click on the only report listed and choose Edit

4) Click on the loaded report design page and select all objects (Ctrl-A or Cmd-A).
5) Notice how the properties dialog only displays a limited subset of properties, i.e. those that are common to all objects and which can be edited.

6) Unselect all objects. Now using Shift and Left mouse button, select only the objects that have a font property (textboxes and labels).

7) Notice that the Font property is listed as one of the many editable properties. 
8) Click on the ellipsis to select a new font - the Font character dialog is displayed.
9) Choose a different font.
10) Click on OK.
11) All of the objects that were selected receive the new font choice - no crash.
12) Save report, then close the report designer.
13) Double-click on the report to open it.
Comment 11 Vas 2018-05-29 11:27:06 UTC
This is what I do;

I click in an empty area first, then Ctrl+A to select everything, then go to the font selection at the top of the window, not the font selection in the control properties box and change the font (in fact, there is no font properties available anyway for the selection). I select the dropdown menu and select any font, in this case it was Arial.

Immediately, I get this error

---------------------------
LibreOffice 6.0 - Fatal Error
---------------------------
CharFontName
---------------------------
OK   
---------------------------

I click ok, and as previously, Base is now locked up and completely unresponsive.

Font size is not available to change, so only the font is available. Selecting only those controls where the font can be changed is no problem, it's just when I select everything.

Ok, i've narrowed it down to the horizontal line. If I select everything either one by one or via lasso, including the boxes, but excluding the horizontal line, it's all ok. If I select everything either one by one or via lasso or via Ctrl+A so it includes the horizontal line, that's when it fails. The horizontal line is the problem when it is included in the selection and trying to change the font via the Font dropdown menu.
Comment 12 Alex Thurgood 2018-05-29 13:30:15 UTC
Still no repro on MacOSX, the Character entry in the menu Format doesn't become active if I select all objects laid out in the report designer. Am enclosing screenshot of what I see.
Comment 13 Alex Thurgood 2018-05-29 13:31:19 UTC
Created attachment 142379 [details]
Screenshot of active Format menu in report design mode when all report objects selected
Comment 14 Alex Thurgood 2018-05-29 13:36:02 UTC
Oddly enough, if I select just one of the coloured bar shapes, I can change its font properties...and I still don't get a crash.

Perhaps this is a Windows only bug ?
Comment 15 Vas 2018-05-29 13:58:31 UTC
Created attachment 142381 [details]
Screen shot of changing font

I am using this method to change the fonts (see attachment).

It's not the thicker blue boxes that's the issue, it's the thin black line. Strangely, you can change the font on those blue boxes.

With all selected, there is no font selection either in the control properties menu or in the format menu, but the Font listbox menu (as in my screen shot), does allow a font change still. The font size listbox is correctly greyed out when a control is selected where there is no font selection allowed.
Comment 16 Xisco Faulí 2018-05-29 14:39:44 UTC
it crashes with gtk3 and gen with a ChartFontName Error and it freezes in gtk2

Version: 6.1.0.0.beta1+
Build ID: da49f4aeb8d5e9a7d2cba8855d911e7cc1d2f1e2
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: x11; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 17 Xisco Faulí 2018-05-29 14:43:25 UTC
Reproduced back to

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 18 Alex Thurgood 2018-05-29 15:30:24 UTC
Ah, finally, I understand, and yes I can reproduce with the exact same error message. 

I don't seem to be able to get a backtrace on this though, as LO exits my lldb debug session without giving me time to intervene. I guess a break point needs to be set higher up the stack somewhere.
Comment 19 Vas 2018-05-29 15:59:24 UTC
I guess a simple fix would be to use the same bit of code for the Font selection, that disables the Font size listbox for any selection that contains non-adjustable font settings.
Comment 20 Julien Nabet 2018-08-11 20:43:12 UTC
Created attachment 144114 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.

I got a bt by break gdb just before selecting font, then "catch throw" and reproduced the crash.
Comment 21 Julien Nabet 2018-08-12 09:43:59 UTC
I submitted a patch to review on gerrit:
https://gerrit.libreoffice.org/#/c/58895/

Lionel: I hesitated between SAL_WARN and DBG_UNHANDLED_EXCEPTION but the last one generates bigger logs.
Comment 22 Commit Notification 2018-08-15 19:24:35 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

tdf#117795: not all elements have ChartFontName property

It will be available in 6.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 23 Commit Notification 2018-08-16 06:58:25 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=97af032407344766658608838ca1eb02ce72b46e&h=libreoffice-6-1

tdf#117795: not all elements have ChartFontName property

It will be available in 6.1.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 24 Commit Notification 2018-08-16 06:58:33 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

Related tdf#117795: comment fix

It will be available in 6.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 25 Julien Nabet 2018-08-16 07:28:08 UTC
Let's put this one to FIXED.

If some people think it'd be useful to backport in 6.0 branch, just tell, I'll make the cherry-pick.
Here's the release plan for 6.0:
https://wiki.documentfoundation.org/ReleasePlan/6.0
Comment 26 Xisco Faulí 2018-08-16 07:33:15 UTC
(In reply to Julien Nabet from comment #25)
> Let's put this one to FIXED.
> 
> If some people think it'd be useful to backport in 6.0 branch, just tell,
> I'll make the cherry-pick.
> Here's the release plan for 6.0:
> https://wiki.documentfoundation.org/ReleasePlan/6.0

it's a crash, so I would say, go for it...
Comment 27 Julien Nabet 2018-08-16 07:39:47 UTC
(In reply to Xisco Faulí from comment #26)
> ...
> it's a crash, so I would say, go for it...
https://gerrit.libreoffice.org/#/c/59151
Comment 28 Commit Notification 2018-08-16 15:51:58 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

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

tdf#117795: not all elements have ChartFontName property

It will be available in 6.0.7.

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.