Bug 118180 - Assertion failed opening an XLSM with Application.ScreenUpdating set to true
Summary: Assertion failed opening an XLSM with Application.ScreenUpdating set to true
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.2.0
Keywords: haveBacktrace
Depends on:
Blocks: Crash-Assert Macro-VBA
  Show dependency treegraph
 
Reported: 2018-06-15 14:35 UTC by Aron Budea
Modified: 2018-07-02 11:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample XLSM (13.81 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2018-06-15 14:35 UTC, Aron Budea
Details
Backtrace (9.81 KB, text/plain)
2018-06-15 14:36 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2018-06-15 14:35:20 UTC
Created attachment 142772 [details]
Sample XLSM

Open the attached XLSM file in a debug build, with having macros enabled. It has a simple macro function that sets:
Application.ScreenUpdating = True

If the macro is called in a number of rows, the following assert is triggered when opening the file, in ScDocument::UnlockAdjustHeight():
assert(nAdjustHeightLock > 0);
https://opengrok.libreoffice.org/xref/core/sc/source/core/data/document.cxx#1799

No assertion failed if Application.ScreenUpdating isn't set to true.
Interestingly, there's no assertion if spreadsheet only contains 3 rows with the call to the function, but there is when it contains 4.

Observed using an LO 6.2 master build (06014f7a23bbc26c7e3d3b9c0bd4dd972f514433) / Windows 7.
Comment 1 Aron Budea 2018-06-15 14:36:35 UTC
Created attachment 142774 [details]
Backtrace
Comment 2 Julien Nabet 2018-06-18 21:00:50 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 3 Aron Budea 2018-07-02 11:16:18 UTC
I haven't tested, but this should be fixed by Mike's commit, thanks a lot for the fix!

https://cgit.freedesktop.org/libreoffice/core/commit/?id=01f712b6db1fab72abfe46ee6c3868f8b3cd035c
author		Mike Kaganski <mike.kaganski@collabora.com>	2018-06-30 17:34:07 +0200
committer	Mike Kaganski <mike.kaganski@collabora.com>	2018-06-30 19:05:27 +0200

Avoid assertion on user data