Bug 88792 - Calc crashes when applying subtotals
Summary: Calc crashes when applying subtotals
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.4.0.2 rc
Hardware: Other Windows (All)
: high critical
Assignee: Eike Rathke
URL:
Whiteboard: target:4.5.0 target:4.4.1 target:6.1.0
Keywords:
Depends on:
Blocks: mab4.4
  Show dependency treegraph
 
Reported: 2015-01-25 20:14 UTC by Robert Gonzalez MX
Modified: 2019-12-07 19:23 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
backtrace (15.95 KB, text/plain)
2015-01-25 20:14 UTC, Robert Gonzalez MX
Details
Test file (71.88 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-01-25 20:14 UTC, Robert Gonzalez MX
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Gonzalez MX 2015-01-25 20:14:06 UTC
Created attachment 112793 [details]
backtrace

When applying subtotals to a range of data, LO 4.4.0.2 (RC2) chrases.

Steps to reproduce:

Open the test file
go to cell A1
Select from the menu bar Data
Select option subtotal
Subtotal dialog displays
Select group by: Category
Select calculate subtotals for the months
Select tab options
select option include formats
apply with OK

LO crashes
Backtrace 
sclo!sc::FormulaGroupAreaListener::notifyBulkChange+0xd7:
5b08b627 8b01            mov     eax,dword ptr [ecx]  ds:002b:00000000=????????

After recovery the subtotals are applied but not calculated
Comment 1 Robert Gonzalez MX 2015-01-25 20:14:50 UTC
Created attachment 112794 [details]
Test file
Comment 2 Robert Gonzalez MX 2015-01-25 20:15:59 UTC
Tested in Windows 8.1
Comment 3 m_a_riosv 2015-01-25 21:27:11 UTC
Reproducible:
Win7x64
Version: 4.4.0.3 Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7

Last working for me
Version: 4.3.7.0.0+ Build ID: db4be3fee9369d8a0bb2df07c25564f19eb564ed
 TinderBox: Win-x86@51-TDF, Branch:libreoffice-4-3, Time: 2015-01-23_21:42:55
Comment 4 Eike Rathke 2015-01-27 15:35:28 UTC
I'm investigating.
Comment 5 Eike Rathke 2015-01-29 21:30:55 UTC
This one is giving me hard times. Findings so far: during inserting the rows for the subtotals there are FormulaGroupAreaListener::Notify() called on instances that have a mppTopCell member pointing to an invalid ScFormula*. It seems the FormulaGroupAreaListener instance is consistent in itself, but something altered underlying structures without taking care for the group area listeners.

Postponing work until after FOSDEM, I'd be glad if Kohei could take over.
Comment 6 Kohei Yoshida 2015-02-04 20:27:52 UTC
Maybe I can take a stab at it this weekend, but no guarantee.
Comment 7 Eike Rathke 2015-02-05 10:17:19 UTC
I found the cause and am preparing a fix. The mppTopCell ScFormulaCell** is invalid because a formula cell is inserted into the mdds tree at a position such that a new storage segment is created.
Comment 8 Commit Notification 2015-02-05 10:54:19 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#88792 do not hold a ScFormulaCell** in group area listener

It will be available in 4.5.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 9 Eike Rathke 2015-02-05 12:06:01 UTC
Pending review for 4-4 at https://gerrit.libreoffice.org/14332
Comment 11 Commit Notification 2018-03-07 06:42:39 UTC
Zdeněk Crhonek committed a patch related to this issue.
It has been pushed to "master":

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

uitest - calc subtotals; tdf#114720 tdf#88792 tdf#88735 tdf#56958 tdf#55734

It will be available in 6.1.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 12 raal 2019-12-07 19:23:49 UTC
The test exist, set status to Verified.