Bug 51249 - Crash while saving a document with track-changes enabled
Summary: Crash while saving a document with track-changes enabled
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:3.7.0 target:3.6.0.0.beta3 tar...
Keywords:
Depends on:
Blocks: Track-Changes
  Show dependency treegraph
 
Reported: 2012-06-20 02:04 UTC by Lionel Dricot
Modified: 2017-04-14 08:33 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Crasher (8.41 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-06-20 02:04 UTC, Lionel Dricot
Details
Patch disallowing usage of stream copy when "Changes Record" is enabled (1.69 KB, patch)
2012-06-20 04:53 UTC, Pierre-Eric Pelloux-Prayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Dricot 2012-06-20 02:04:57 UTC
Created attachment 63250 [details]
Crasher

This bug is not 100% reproducible so you may have to try multiple times.

To reproduce:

1. Open crash.ods 
2. Modify a cell from the second row in table 1.
3. Save.
Comment 1 Lionel Dricot 2012-06-20 02:07:31 UTC
What is happening ?

According to our investigation, saving a Calc file is done in two steps:

1. For each table, if the table has not been modified, the previous save of the "Styles" of the table is used, else the new "Styles" are computed.

2. For each table, if the table has not been modified, the previous save of the "Content" is used else the new "Content" is computed.


Whit track-changes enabled, the content is computed by replaying all the changes.

It seems that, in some case, replying the file to compute the "content" may be interpreted as "content has changed". But if the table was not modified, "Styles" were not computed but instead copied from the last save. This means that an inconsistency between Styles and Content appear and lead to a crash.


A straightforward solution would be to not allow the direct copy optimisation when track-change is enabled.
Comment 2 Pierre-Eric Pelloux-Prayer 2012-06-20 04:53:16 UTC
Created attachment 63261 [details]
Patch disallowing usage of stream copy when "Changes Record" is enabled

> A straightforward solution would be to not allow the direct copy optimisation
> when track-change is enabled.
This is short patch is an implementation of this, and is enough to prevent the bug.
I'm not sure it's 100% correct though, as I'm not much familiar with this part of the code.
Comment 3 Eike Rathke 2012-06-21 09:39:10 UTC
Good catch :-)  I could reproduce, and with the patch it seems fixed.
The change track replay modifying the document during save in between is awkward.. but as things are the patch is a reasonable workaround.
Comment 4 Not Assigned 2012-06-21 09:48:49 UTC
Pierre-Eric Pelloux-Prayer committed a patch related to this issue.
It has been pushed to "master":

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

fdo#51249 Disable stream copy when saving a file with 'Changes Record' active
Comment 5 Not Assigned 2012-06-21 09:54:58 UTC
Pierre-Eric Pelloux-Prayer committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d62646cf5509b45e664b21fd7896ff9dc2f83b82&g=libreoffice-3-6

fdo#51249 Disable stream copy when saving a file with 'Changes Record' active


It will be available in LibreOffice 3.6.
Comment 6 Not Assigned 2012-06-21 11:20:59 UTC
Pierre-Eric Pelloux-Prayer committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=17c85c9a5c447f9db6f3b91e6840709df8542345&g=libreoffice-3-5

fdo#51249 Disable stream copy when saving a file with 'Changes Record' active


It will be available in LibreOffice 3.5.6.
Comment 7 Not Assigned 2012-06-22 08:26:10 UTC
Pierre-Eric Pelloux-Prayer committed a patch related to this issue.
It has been pushed to "libreoffice-3-5-5":

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

fdo#51249 Disable stream copy when saving a file with 'Changes Record' active


It will be available already in LibreOffice 3.5.5.