Bug 105926 - TEMPLATE UPDATE ISSUE: Writer crashes when closing document (comment 3) (unix)
Summary: TEMPLATE UPDATE ISSUE: Writer crashes when closing document (comment 3) (unix)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
: 119510 (view as bug list)
Depends on:
Blocks: Templates
  Show dependency treegraph
 
Reported: 2017-02-10 23:42 UTC by Gabriele Ponzo
Modified: 2020-02-06 11:04 UTC (History)
8 users (show)

See Also:
Crash report or crash signature: ["SfxShell::SetDisableFlags(SfxDisableFlags)"]


Attachments
My Invoice Template (28.59 KB, application/vnd.oasis.opendocument.text-template)
2017-02-14 15:12 UTC, Gabriele Ponzo
Details
GDB trace of the crash with 5.4 master (18.00 KB, text/plain)
2017-02-16 18:56 UTC, Buovjaga
Details
Another template, made from scratch. I just deleted the company name. (13.16 KB, application/vnd.oasis.opendocument.text-template)
2018-11-14 19:37 UTC, Gabriele Ponzo
Details
bt with debug symbols (6.40 KB, text/plain)
2019-02-09 17:07 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriele Ponzo 2017-02-10 23:42:08 UTC
Description:
If you open a document that was originated from a template which has been modified, LO asks if you want to re-apply the template to the document.
Whatever you answer, when you'll close that document (saving it or not) Writer crashes.

It looks like it happens just with my template… Should I attach it, or just forget about this issue?

It happens on Linux AND on Mac from LO 5.0 (If I recall well).

Steps to Reproduce:
1. Open Writer
2. Create a new file from MY template
3. Save and close it
4. Open the Template
5. Modify something
6. Save it as the same template (overwrite)
7. Open the document saved before
8. LO will ask you if to update from the new template or not
9. Answer whatever you prefer
10. LO will open your saved document and will set it as modified (even if you have answered to NOT apply changes)
11. Close LO
12. It will prompt to save the document
13. Answer whatever you prefer
14. Writer crashes

Actual Results:  
Writer first sets document as modified and closing crashes

Expected Results:
It shouldn't set file as modified if I answered to "keep old styles", and most of all shouldn't crash when closing file.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
Comment 1 Buovjaga 2017-02-12 16:12:58 UTC
No crash here.

Maybe you could try to take a backtrace of the crash on Linux: https://wiki.documentfoundation.org/QA/BugReport/Debug_Information
Notice you have to install the debug package like advised in the article.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: ac8197327d3ef4f3c94fb0746393863404df086b
CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on February 11th 2016
Comment 2 Gabriele Ponzo 2017-02-14 15:12:11 UTC
Created attachment 131206 [details]
My Invoice Template

As said, it could be something on my Invoice Template...

Anyway, I believe LO shouldn't crash :|

I've cleaned it up from my personal info and tried again: the problem still happens, so please try with the attached file ;)

Steps to Reproduce:

1. Create a new file from MY template
2. Save and close it
3. Open the Template
4. Modify something
5. Save it as the same template (overwrite)
6. Open the document saved before
7. LO will ask you if to update from the new template or not
8. Answer whatever you prefer
9. LO will open your saved document and will set it as modified (even if you have answered to NOT apply changes)
10. Close LO
11. It will prompt to save the document
12. Answer whatever you prefer
13. Writer crashes
Comment 3 Buovjaga 2017-02-16 18:56:14 UTC
Created attachment 131282 [details]
GDB trace of the crash with 5.4 master

Backtrace of the crash.

Shortest way to crash:

1. Manage Templates
2. Right-click Fattura_2017
3. Update styles
4. Close document

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: ac8197327d3ef4f3c94fb0746393863404df086b
CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on February 11th 2016
Comment 4 Marco Alici 2017-02-18 11:31:19 UTC
Crash confirmed here:
Version: 5.3.0.3
Build ID: 1:5.3.0~rc3-0ubuntu1~trusty1.1
Comment 5 Xisco Faulí 2017-02-27 11:24:32 UTC
Confirmed in

Version: 5.4.0.0.alpha0+
Build ID: e9e6228533b336317aa809a7aaaa4fd1c338d4f7
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

but not in

Version: 5.4.0.0.alpha0+
Build ID: eb7b03b052ffe8c2c577b2349987653db6c53f76
CPU threads: 1; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2017-02-26_22:34:18
Locale: en-GB (es_ES); Calc: group
Comment 6 Gabriele Ponzo 2017-02-27 19:21:43 UTC
But it happens also in MacOs. So correct Hardware Field should be "All but Windows" :)
Comment 7 silvia 2017-05-29 13:53:12 UTC
On Windows Professional SP1 vers. Italian when you modify the Template, reopening the file generated by that template, it doesn't ask for updating the file from new template at all.

Versione: 5.3.1.2
Build ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2
Thread CPU: 4; Versione SO: Windows 6.1; Resa interfaccia: predefinito; Motore layout: nuovo; 
Versione locale: it-IT (it_IT); Calc: group
Comment 8 Gabriele Ponzo 2018-02-05 15:40:11 UTC
It still happens in 6.1:

Version: 6.1.0.0.alpha0+
Build ID: 33f0eefd60c9f0ae56593583f094f025e00f3d35
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-02-04_23:51:32
Locale: it-IT (it_IT.UTF-8); Calc: group
Comment 9 Xisco Faulí 2018-08-31 19:42:22 UTC
*** Bug 119510 has been marked as a duplicate of this bug. ***
Comment 10 Gabriele Ponzo 2018-11-03 09:34:34 UTC
This time I'm not working with my invoice template, but with a brand new one.

This is the crash report:
crashreport.libreoffice.org/stats/crash_details/a91c5b75-962b-4057-b770-4827a11df1e0
Comment 11 Xisco Faulí 2018-11-14 19:08:42 UTC
(In reply to Gabriele Ponzo from comment #10)
> This time I'm not working with my invoice template, but with a brand new one.
> 
> This is the crash report:
> crashreport.libreoffice.org/stats/crash_details/a91c5b75-962b-4057-b770-
> 4827a11df1e0

I can't reproduce it with a new template created from scratch

Versión: 6.1.3.2
Id. de compilación: 86daf60bf00efa86ad547e59e09d6bb77c699acb
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: es-ES (es_ES); Calc: group threaded

Could you please share it as well ?
Comment 12 Gabriele Ponzo 2018-11-14 19:37:37 UTC
Created attachment 146633 [details]
Another template, made from scratch. I just deleted the company name.

Another template, made from scratch. I just deleted the company name.
Comment 13 Julien Nabet 2019-02-09 17:07:31 UTC
Created attachment 149053 [details]
bt with debug symbols

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

I noticed this on console:
warn:legacy.tools:765:765:sfx2/source/control/dispatch.cxx:1436: wrong SfxShell popped
Comment 14 Julien Nabet 2019-02-09 17:44:59 UTC
I also noticed these on console, perhaps it'd help:
warn:sfx.doc:2171:2171:sfx2/source/doc/objstor.cxx:2882: Base implementation, must not be called in general!
warn:legacy.osl:2171:2171:sw/source/core/unocore/unoobj2.cxx:1248: no parent text?
warn:legacy.osl:2171:2171:sw/source/core/unocore/unoobj2.cxx:1248: no parent text?
Comment 15 Michael Meeks 2020-02-04 10:48:28 UTC
Thanks for the trace Julien - looks like a nasty use-after-free, but hard to diagnose - and shutdown is somewhat 'tricky' ;-)

What would really help is a valgrind trace; any chance of one Gabriele - you will need to install debuginfo packages, and run from the console something like:

soffice --valgrind >& /tmp/log.txt

then reproduce the problem - at 150x slower ;-) and attach the log.ttxt

Thanks !
Comment 16 Julien Nabet 2020-02-04 20:09:21 UTC
On pc Debian x86-64 with master sources updated today, when trying to open the ott file, LO opened it with "Untitled1" for name.
Is it normal? (I don't remember what there was last time)

About this test:
1. Manage Templates
2. Right-click Fattura_2017
3. Update styles
4. Close document
I don't see the template at step2.
Anyway, when right clicking on a existing template, I don't have "Update style" entry.

=> I'm stuck
Comment 17 Gabriele Ponzo 2020-02-05 14:48:34 UTC
Th(In reply to Julien Nabet from comment #16)
> On pc Debian x86-64 with master sources updated today, when trying to open
> the ott file, LO opened it with "Untitled1" for name.
> Is it normal? (I don't remember what there was last time)
> 
> About this test:
> 1. Manage Templates
> 2. Right-click Fattura_2017
> 3. Update styles
> 4. Close document
> I don't see the template at step2.
> Anyway, when right clicking on a existing template, I don't have "Update
> style" entry.
> 
> => I'm stuck

This is a simplified procedure.
Please refer to my submission if you feel uncomfortable with it, reported below for your convenience.

First you have to download this attachment:
https://bugs.documentfoundation.org/attachment.cgi?id=131206

Then you'll have a file named Modello_Fattura.ott
1. Open Modello_Fattura.ott (by double clicking on it)
2. Write something in the Untitled file created (it's normal and expected)
3. Save it with a name and close it
4. Open the Template (through File -> Open and specifying template as File Type)
5. Modify something
6. Save it as the same template (overwrite) and then close it
7. Open the document saved before
8. LO will ask you if to update from the new template or not
9. Answer whatever you prefer
10. LO will open your saved document and will set it as modified (even if you have answered to NOT apply changes)
11. Close LO
12. It will prompt to save the document
13. Answer whatever you prefer
14. Writer crashes
Comment 18 Gabriele Ponzo 2020-02-06 11:01:36 UTC
BTW I've just checked again and it looks like the bug was solved, at least from 6.0.7.3 version, if not before.

So thank you all, I'm closing the issue.
Comment 19 Julien Nabet 2020-02-06 11:04:22 UTC
Since there's no specific fix, let's rather put WFM then.
Thank you for this new feedback.