Bug 101648 - GSoC table template: Crash on Modify custom table style or creating New (in context menu)
Summary: GSoC table template: Crash on Modify custom table style or creating New (in c...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: highest critical
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.4.0 target:5.3.1
Keywords: haveBacktrace
: 101997 103247 103393 104054 104140 104168 105347 105779 105804 105923 105978 106381 106429 (view as bug list)
Depends on:
Blocks: Table-Styles Writer-Tables-Style
  Show dependency treegraph
 
Reported: 2016-08-21 23:36 UTC by Regina Henschel
Modified: 2017-05-01 23:40 UTC (History)
36 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with symbols (9.10 KB, text/plain)
2016-08-22 20:40 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2016-08-21 23:36:47 UTC
After I have opened a file which has a table-template element, I see this template in the new category "Table" in the Style&Formatting pane in the sidebar. If I right-click the item I get a context menu with the items New, Modify and Delete. After I click item Modify, I get the error message

Fatal Error
file:///F:/LO_daily/program/../share/config/soffice.cfg/modules/swriter/ui/templatedialog32.ui

After I click the OK-button (no other option exists) LibreOffice crashes.

The file templatedialog32.ui does not exist, templatedialog16.ui is the last one. I have used version Version: 5.3.0.0.alpha0+
Build ID: 6431e91eca9e44684066a32ed3d6411509dac781
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-08-21_06:34:00
Locale: de-DE (de_DE); Calc: group


Expected behavior: In case an option is not finished, it should not be offered or it shows a message box "not yet implemented", but never crashes.

For testing you can use the attachment from bug 101647.
Comment 1 Cor Nouws 2016-08-22 08:22:11 UTC
I get the same error and crash when I chose New.
Comment 2 Julien Nabet 2016-08-22 20:40:17 UTC
Created attachment 126975 [details]
bt with symbols

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

I included some extra gdb traces.

The problem is http://opengrok.libreoffice.org/xref/core/sw/source/ui/fmtui/tmpdlg.cxx#76
     76     : SfxStyleDialog(pParent,
     77                     "TemplateDialog" + OUString::number((sal_uInt16)nRegion),
     78                     "modules/swriter/ui/templatedialog" +
     79                         OUString::number((sal_uInt16)nRegion) + ".ui",
     80                     rBase)

nRegion = SfxStyleFamily::Table
(sal_uInt16)nRegion = 32

See also http://opengrok.libreoffice.org/xref/core/include/rsc/rscsfx.hxx#33
     31 // This is used as a flags enum in sw/, but only there,
     32 // so I don't pull in o3tl::typed_flags here
     33 enum class SfxStyleFamily {
     34     None    = 0x00,
     35     Char    = 0x01,
     36     Para    = 0x02,
     37     Frame   = 0x04,
     38     Page    = 0x08,
     39     Pseudo  = 0x10,
     40     Table   = 0x20,
     41     Cell    = 0x40,
     42     All     = 0x7fff
     43 };
Comment 3 Yousuf Philips (jay) (retired) 2016-09-03 14:25:31 UTC
Yes the dialog wasnt created during GSoC and not sure if it will be. Likely the entry should be disabled in the menu for the time being.

@ubap: Any plans to do this now that GSoC is over?
Comment 4 Maxim Monastirsky 2016-09-08 18:59:00 UTC
*** Bug 101997 has been marked as a duplicate of this bug. ***
Comment 5 Maxim Monastirsky 2016-10-15 22:49:00 UTC
*** Bug 103247 has been marked as a duplicate of this bug. ***
Comment 6 m_a_riosv 2016-10-21 21:09:19 UTC
*** Bug 103393 has been marked as a duplicate of this bug. ***
Comment 7 Maxim Monastirsky 2016-11-20 18:24:31 UTC
*** Bug 104054 has been marked as a duplicate of this bug. ***
Comment 8 Xisco Faulí 2016-11-24 11:08:16 UTC
*** Bug 104140 has been marked as a duplicate of this bug. ***
Comment 9 Xisco Faulí 2016-11-25 17:14:00 UTC
*** Bug 104168 has been marked as a duplicate of this bug. ***
Comment 10 deepjungle.maca 2017-01-11 13:15:54 UTC
The same problem with LO 5.3.0.1 on macOS.

file:///Applications/LibreOffice.app/Contents/Resources/../Resources/config/soffice.cfg/modules/swriter/ui/templatedialog32.ui
Comment 11 Maxim Monastirsky 2017-01-15 17:42:24 UTC
*** Bug 105347 has been marked as a duplicate of this bug. ***
Comment 12 blendergeek 2017-01-19 20:37:40 UTC
Just confirmed that this bug still exists in 5.3.0RC2.

1. Open document.
2. Open Styles and Formatting tab on the sidebar.
3. Click on the 'Table Styles' icon to bring up the 'Table Styles' tab.
4. Right click on any style and in the context menu click either 'New' or 'Modify'.

At this point a dialog pops up. It is titled: 'LibreOffice 5.3 - Fatal Error'. It contains the following error message: 'file:///home/timothy/Downloads/opt/LibreOffice_5.3.0.2_Linux_x86-64_deb/DEBS/install/opt/libreoffice5.3/program/../share/config/soffice.cfg/modules/swriter/ui/templatedialog32.ui'. 

When the user clicks okay, LibreOffice immediately exits.
Comment 13 RGB 2017-01-19 21:19:08 UTC
I also confirm this on 5.3.0rc2. It is important to note that this crash can also result on INFORMATION LOSS:

1- Open a new document and insert a table with some data on it
2- Apply a table style to that table
3- Now right click on the style used → Modify

As commented, Writer crash. When you open it again it starts the "file recovery" menu as expected, BUT the recovered document is completely EMPTY.
Comment 14 RGB 2017-01-24 22:09:35 UTC
The bug lists provided on the release notes for RC2 does NOT include this bug, which is a big problem: it seems that LibO 5.3 will be released with this quite evident and critical bug, a bug that can lead to data loss (see my previous comment), a bug that was reported on the pre alphas. 

IMO any bug like this one should be considered a "release stopper".
Comment 15 Julien Nabet 2017-01-24 22:57:46 UTC
QA/UI team: This patch allows to disable table list in sidebar.
Should I submit it as a bandaid on gerrit?

diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index bd574866f7f9..8a8377940e5a 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -424,11 +424,12 @@ SfxStyleFamilies* SwModule::CreateStyleFamilies()
                                                     SW_RESSTR(STR_LISTSTYLEFAMILY),
                                                     Image(BitmapEx(SW_RES(BMP_STYLES_FAMILY_LIST))),
                                                     SW_RES(RID_LISTSTYLEFAMILY)));
-
+/* FIXME (see tdf#101648)
     pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Table,
                                                     SW_RESSTR(STR_TABLESTYLEFAMILY),
                                                     Image(BitmapEx(SW_RES(BMP_STYLES_FAMILY_TABLE))),
                                                     SW_RES(RID_TABLESTYLEFAMILY)));
+*/
 
     return pStyleFamilies;
 }
Comment 16 Mike Kaganski 2017-01-25 11:43:35 UTC
@Julien: is it possible to follow the solution offered by Samuel's work: https://wiki.documentfoundation.org/UnderTheHood/5.3#UI-related

> Commands can be given an 'IsExperimental' flag so they will show up in the menu/toolbar only if "Experimental features" are active.
Comment 17 Roman Kuznetsov 2017-01-25 11:46:02 UTC
(In reply to Julien Nabet from comment #15)
> QA/UI team: This patch allows to disable table list in sidebar.
> Should I submit it as a bandaid on gerrit?

may be just disable context menu? or create micro-window for context menu with message "This function don't work now"?
why disable ALL new functional?
Comment 18 Julien Nabet 2017-01-25 19:28:32 UTC
(In reply to Mike Kaganski from comment #16)
> @Julien: is it possible to follow the solution offered by Samuel's work:
> https://wiki.documentfoundation.org/UnderTheHood/5.3#UI-related
> 
> > Commands can be given an 'IsExperimental' flag so they will show up in the menu/toolbar only if "Experimental features" are active.

keyId for table style is ob4wq. A search on https://translations.documentfoundation.org/fr/libo_ui/translate/#search=ob4wq&sfields=source,target,notes
app.src STR_TABLESTYLEFAMILY string.text

I didn't find isExperimental in src file, only on ui file.
Comment 19 RGB 2017-01-25 19:40:27 UTC
(In reply to kompilainenn from comment #17)
 
> may be just disable context menu? or create micro-window for context menu
> with message "This function don't work now"?

The second option will be perfect for this situation, I think. 

> why disable ALL new functional?

Indeed.
Comment 20 Enio Gemmo 2017-01-26 15:08:18 UTC
n the LibreOffice 5.3.0.2 64bit Windows version don't have the bug posted here
Comment 21 Ljiljan 2017-01-26 15:13:09 UTC
Ubuntu 64 bit 5.3.1.0.0+ the bug is still present.
Comment 22 Thomas Krumbein 2017-01-26 15:45:43 UTC
(In reply to  Enio Gemmo  from comment #20)

oh shure - the bug is still present on Win 64. Just checked.

My System: 

Version: 5.3.0.2 (x64)
Build-ID: 5ad7b2889021c491af62f7930a4b1cb631392f16
CPU-Threads: 4; BS-Version: Windows 6.19; UI-Render: Standard; Layout-Engine: neu; 
Gebietsschema: de-DE (de_DE); Calc: group
Comment 23 Thomas Krumbein 2017-01-26 15:49:20 UTC Comment hidden (obsolete)
Comment 24 Yousuf Philips (jay) (retired) 2017-01-28 10:45:08 UTC
(In reply to Julien Nabet from comment #15)
> QA/UI team: This patch allows to disable table list in sidebar.
> Should I submit it as a bandaid on gerrit?

(In reply to Mike Kaganski from comment #16)
> @Julien: is it possible to follow the solution offered by Samuel's work:
> https://wiki.documentfoundation.org/UnderTheHood/5.3#UI-related

Disabling the table list in the sidebar or putting it in experimental mode isnt a preferable fix. It would be best to disable the modify entry in the context menu when opened within the table list.

@Kendy, @Miklos: This has been created by our student, who unfortunately hasnt fix it, and it would be good if we could rectify it soon.
Comment 25 Jean-Francois Nifenecker 2017-01-29 08:17:53 UTC
I agree with RGB in https://bugs.documentfoundation.org/show_bug.cgi?id=101648#c14

This show stopper bug should lead to either (1) fix it or, if not possible anytime soon, (2) suppress the table styles functionality from the application next version.

Leaving such a bug, which makes table styles unusable, is very bad marketing. Hiding the dust under the carpet with the experimental option is, IMO, worse marketing.

As a summary: the table styles are known to crash. They may induce data loss, as shown in comment https://bugs.documentfoundation.org/show_bug.cgi?id=101648#c13. Leaving such a functionality, experimental or not, is very bad.
Comment 26 Peter Moon 2017-02-05 09:04:23 UTC
Same behaviour occurs in Windows and OSX.
Comment 27 Telesto 2017-02-05 21:45:09 UTC
*** Bug 105779 has been marked as a duplicate of this bug. ***
Comment 28 Mike Saunders 2017-02-06 11:43:52 UTC
A few people have mentioned this problem on social media. Given that this is one of the highlighted new features in 5.3, if we can't fix it for 5.3.1, can we at least remove the Modify menu option temporarily until it is fixed?
Comment 29 Julien Nabet 2017-02-06 13:21:39 UTC
Let's put maximum priority since:
- it's a crash
- it's a new feature that people will try because we've talked about it on release notes
- it impacts every env
- it's not basic case but not a corner case too
Comment 30 Julien Nabet 2017-02-06 19:24:13 UTC
*** Bug 105804 has been marked as a duplicate of this bug. ***
Comment 31 Commit Notification 2017-02-09 16:36:03 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#101648 disable new/modify of table styles

It will be available in 5.4.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 32 Caolán McNamara 2017-02-09 16:37:32 UTC
lets just disable the edit/new menu entries for table styles for now cause there's no matching ui for them. backport to 5-3 in gerrit
Comment 33 Xisco Faulí 2017-02-10 17:06:07 UTC
*** Bug 105923 has been marked as a duplicate of this bug. ***
Comment 34 Kevin Suo 2017-02-11 00:14:15 UTC
The patch was already commited to libreoffice-5-3 but we did not receive notification here. Updated whiteboard accordingly.

https://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-5-3&id=5f8b6166115cd92bed202d3d8f2ce2d3f74256d4
Comment 35 Commit Notification 2017-02-11 10:27:16 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

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

Resolves: tdf#101648 disable new/modify of table styles

It will be available in 5.3.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 36 Heiko Tietze 2017-02-11 10:35:17 UTC
New and Modify are hidden now.
Comment 37 Julien Nabet 2017-02-13 13:51:04 UTC
*** Bug 105978 has been marked as a duplicate of this bug. ***
Comment 38 Julien Nabet 2017-03-07 12:37:04 UTC
*** Bug 106381 has been marked as a duplicate of this bug. ***
Comment 39 Xisco Faulí 2017-03-08 09:21:39 UTC
*** Bug 106429 has been marked as a duplicate of this bug. ***