Bug 88985 - Writer crashes document if closed while macro running
Summary: Writer crashes document if closed while macro running
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.3.2 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.3.0 target:7.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-31 18:20 UTC by g1234
Modified: 2020-05-31 20:22 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Writer will crash when closed while endless loop macro running (17.89 KB, application/vnd.oasis.opendocument.text)
2015-01-31 18:20 UTC, g1234
Details
this moves the crash from the current place to later on (4.95 KB, patch)
2016-06-10 16:35 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description g1234 2015-01-31 18:20:36 UTC
Created attachment 113002 [details]
Writer will crash when closed while endless loop macro running

Writer will chrash when closed while a macro is still running.

Attached is a document which demonstrates it by starten an endless loop macro.

This behavior was not like this in LibreOffice 3.5
Comment 1 Julien Nabet 2015-02-02 21:23:41 UTC
On pc Debian x86-64 with LO Debian package 4.3.3, I could reproduce this.
However, I don't reproduce this with:
- master sources (future 4.5.0) updated today.
- 4.4 sources updated 2 days ago
- 4.3 sources updated some days ago.

Could you give a try to last stable LO version (4.3.5)?
Comment 2 g1234 2015-02-03 06:47:34 UTC
I verified LibreOffice 4.3.5 on Debian 7.8 , it also chashes the document.

To be presice I used
Version: 4.3.5.2 Build-ID: 3a87456aaa6a95c63eea1c1b3201acedf0751bd5

I also found a workaround! If I start the macro, then (instead of closing the application window) just close the document by clicking the x olmost in the upper right of the window and after that close the application window by clicking the x in the upper right - than the document is not chrashed after a restart of writer.
Comment 3 g1234 2015-02-03 07:15:22 UTC
Sorry, I just found out, my workaround does not work in all cases.

It just works, if I give the application a little time, between closing the document and closing the application. If I am very fast, close the document and in the same second also close the application window, the macro seems to be still running and therfore still chrashes the document.
Comment 4 g1234 2015-02-06 02:51:26 UTC
Well, how come nothing happens? The needed info is given tree days ago:

LibreOffice still crashes!

I expect either more qustions or a status change.

By the way, OpenOffice crashes even harder...
Comment 5 Julien Nabet 2015-02-06 06:34:03 UTC
Thank you for your feedback. For the test, could you rename your LO directory profile (see https://wiki.documentfoundation.org/UserProfile) and give it a new try?
Put it at NEW meanwhile since I reproduced it too.
Comment 6 g1234 2015-02-06 08:18:33 UTC
OK, so what I did and found out:

I renamed ~/.config/libreoffice to ~/.config/libreofficeXXX
I started libreoffice 4.3.5.2 Writer installed without languagepack
I recognized the File/Recent Documents list was not empty, but reset to an old one, so I figured: "It still gets some defaults from somewhere"
I found and renamed ~/.openoffice.org
Still the old Recent Documents list, but macrosecurity went up to high
I set macrosecutity to medium so I can execute the unsigned macro
I opend the attached CrashWriterMacro.odt, answered to enable macros, clickt the CommandButton and closed the application window.
I started LibreOffice Writer again, it shows the LibreOffice Document Recovery window with CrashWriterMacro.odt in the list with status not recovered yet
Comment 7 QA Administrators 2016-02-21 08:36:01 UTC Comment hidden (obsolete)
Comment 8 Caolán McNamara 2016-06-10 16:35:23 UTC
Created attachment 125590 [details]
this moves the crash from the current place to later on

Not a particularly useful patch unfortunately. We will still crash later. Basically we have quit during execution of the macro, which is a tricky problem.
Comment 9 Caolán McNamara 2016-06-22 09:09:42 UTC
https://gerrit.libreoffice.org/#/c/26565/ is a fix which seems to work well for me, detect exit during macro execution, stop all macros, block quit, wait until that macro inner-event-loop finishes, then relaunch quit
Comment 10 Commit Notification 2016-06-22 10:34:43 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=68cf256f506d4601a2d2cf3ec2d56713afd491e6

Resolves: tdf#88985 block app from exiting during macro execution

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 11 Commit Notification 2020-05-31 20:22:16 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a97e344ba06b92e5f1fc96062a5ad03fb732615e

Revert "tdf#88985 block app from exiting during macro execution"

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.