Bug 149529 - Calc Insert Sheet + save Freeze
Summary: Calc Insert Sheet + save Freeze
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: All All
: high major
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0 target:7.4.0.0.beta2 tar...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Crash
  Show dependency treegraph
 
Reported: 2022-06-12 02:53 UTC by ib.200906
Modified: 2022-06-17 11:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
isolated tab that was causing the freeze when inserted into other files, including new blank files (21.87 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-06-12 20:20 UTC, ib.200906
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ib.200906 2022-06-12 02:53:19 UTC
Description:
When you right-click at the bottom bar to insert a new sheet, choose a particular sheet from an existing other file, insert it, and then attempt to save, calc freezes with the "save document" bar about 95% complete and needs to have the process ended through task manager. Sometimes other documents and windows in LO are able to opened, saved, closed, etc. during the freeze, only the .ods file where the sheet insert was made is affected. other times LO quits entirely without warning. It seems to be tied to a sheet in a specific file, which is odd because that sheet has no formulas, only text and numbers. Behavior is consistent over network and local saves. FILESAVE 

Steps to Reproduce:
1.see summary
2.
3.

Actual Results:
see summary

Expected Results:
see suammry


Reproducible: Always


User Profile Reset: Yes



Additional Info:
see summary
Comment 1 Timur 2022-06-12 07:59:32 UTC
If this happens with specific file, you need to attach it. Please make it minimal and without personal information (replace chars with X) and test that it still freezes.
Comment 2 ib.200906 2022-06-12 20:20:13 UTC
Created attachment 180694 [details]
isolated tab that was causing the freeze when inserted into other files, including new blank files
Comment 3 QA Administrators 2022-06-13 03:26:47 UTC Comment hidden (obsolete)
Comment 4 Timur 2022-06-13 07:35:34 UTC Comment hidden (obsolete)
Comment 5 Timur 2022-06-13 07:39:39 UTC
Repro 7.4+ for insert and save. 
Also: after that sheet was inserted and LO closed without saving, it crashes.
That's a new bug from 7.1. In 7.0, crash happened on insert sheet.
Comment 6 m_a_riosv 2022-06-14 18:13:50 UTC
Sorry, I can't reproduce. Maybe I'm not following the right steps.
Version: 7.4.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 66b1ebd4ddc7127a923bf81eb569e7f99dd52022
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: threaded
Comment 7 Timur 2022-06-16 09:25:42 UTC
This was an ugly bibisect. 4.2 deletes app macro, or crashes with it, so by-foot. 

Insert and save was good (10 times in a row) until this commit where my Calc was broken:
author	Noel Grandin <noel@peralex.com>	2013-05-21
commit 2750fe97c5a2c5b374542e3383dfc75ec099c7af
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
and remove unnecessarily storing the global XComponentContext

My Calc started to work later but save after insert was problematic (1st time may pass but on 2nd or 3d would crash):
author	Caolán McNamara <caolanm@redhat.com>	2013-07-16
commit 52bce8fadde39e32c0008babadc2c22cc501f753
convert versions of dialog to .ui

There was also a change where insert would immediately crash Calc:
author	Kohei Yoshida <kohei.yoshida@collabora.com>	2013-11-05
commit 7045802f27f3efe74b4ed9146d33abe253df043a
Add mutex to guard the shared string pool content.

I add Noel and Kohei to CC.
Comment 8 Caolán McNamara 2022-06-16 12:47:26 UTC
I see a ScColorScaleEntry which contains a pointer to the temp ScDocument which was created on loading the file from the insert sheet dialog and not a pointer to the document it is cloned to be inserted into.

Assuming that's right, then 

commit 46419cd7a2d453c6f252c28dfb9dbfb08605e1c4
Date:   Tue Jun 18 15:11:30 2013 -0400

    ScFormulaCell is no longer a child class of ScBaseCell.
    
    Change-Id: Id33072f193045e2eaf51373b47dac803f9a5d52c

might have been the problematic commit
Comment 9 Caolán McNamara 2022-06-16 12:53:23 UTC
https://gerrit.libreoffice.org/c/core/+/135998 for that idea
Comment 10 Commit Notification 2022-06-16 15:45:20 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/10404751bcb643605c50d530e3855ae005e60a5e

tdf#149529 crash on deref deleted ScDocument*

It will be available in 7.5.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.
Comment 11 Caolán McNamara 2022-06-16 15:46:30 UTC
backport to 7-4 and 7-3 in gerrit now
Comment 12 Commit Notification 2022-06-16 18:14:23 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/12e8dd5c12918ba9c2a048a8a26e830455d1e302

tdf#149529 crash on deref deleted ScDocument*

It will be available in 7.4.0.0.beta2.

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.
Comment 13 Commit Notification 2022-06-16 19:13:47 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/7e259e7b6e28e08a1ac2055b5a4c9d6bc97f78d2

tdf#149529 crash on deref deleted ScDocument*

It will be available in 7.3.5.

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.
Comment 14 Commit Notification 2022-06-17 11:24:24 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1328ff3ddc2646b6061baf31ebe5d7c84513d263

tdf#149529: sc: Add UItest

It will be available in 7.5.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.