Consider the following macro that runs Goal Seek (using seekGoal from the UNO API): Sub TestGoalSeek oSheet = ThisComponent.Sheets(0) oTargetCell = oSheet.getCellRangeByName("D1") oVariableCell = oSheet.getCellRangeByName("C1") oResult = Thiscomponent.seekGoal(oTargetCell.CellAddress, oVariableCell.CellAddress, "100") MsgBox oResult.Result End Sub If you create a blank Calc document and run the macro (without changing anything in the document), LO will crash. Steps to reproduce: 1) Copy the macro above to any module in the Standard library (so that it can be run from any document) 2) Create a blank new Calc document 3) Go to Tools - Macro - Run Macro and choose the macro TestGoalSeek 4) Run the macro 5) CRASH The weird thing is that if you simply change the values in cells C1 or D1, the crash won't happen. For instance: 0) Create a blank Calc document 1) Enter any value in cell D1 2) Delete this value and leave the cell empty 3) Run the macro 4) No crash... the macro works, even though the document is empty
Reproduced. Crash reports: - 7.4.0.3 with signature ScColumn::SetError(int, FormulaError) : https://crashreport.libreoffice.org/stats/crash_details/6c57d5aa-7196-4622-92c4-8054a47fa9bb - 7.6.7.2, same signature: https://crashreport.libreoffice.org/stats/crash_details/3ac22139-1e15-4f08-9136-ba59c4a0c8e5 - 24.2.3.2, "name omitted" signature: https://crashreport.libreoffice.org/stats/crash_details/243dde02-3b67-4144-bc13-a9bd2b131ea0 No repro in 7.3.0.3 -> regression Bibisected with linux-64-7.4 to first bad build [d14c498f036bf5f6f99503115eeec2a72bd1ba83] which is: commit 9e2d48b9e04f7ea895fb095699c32ed8a44eb129 author Luboš Luňák Wed Mar 30 11:58:04 2022 +0200 committer Luboš Luňák Thu Apr 28 05:51:53 2022 +0200 reduce Calc's INITIALCOLCOUNT to 1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133311 Setting priority to "high" because it's a regression and Luboš is not active. Not setting severity to "critical" because it's a corner case, one would rarely run a goal seek on empty target and variable cells. No crash when using the GUI because it stops at checking that D1 contains a formula.
https://gerrit.libreoffice.org/c/core/+/168767
Note that even before that specific change, it would nicely crash e.g. using column like ZZ for variable cell. Just C1 was in the first pre-allocated columns before. The real cause was the Noel's work on large tables (16K columns), where the limit of pre-allocated columns was introduced.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/231722a7791df5e4315aefa1cc902bc1c0dc2e00 tdf#161511: create column if not exists It will be available in 25.2.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.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/9e426e966528a7e0eb357cfe2aaf4091134d80b1 tdf#161511: create column if not exists It will be available in 24.8.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.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/280bb546140a519aac54f9865a3db8dd50e779e7 tdf#161511: create column if not exists It will be available in 24.2.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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f1872f6e47478dfd990c0031e823624de60fa079 tdf#161511: sc_goal_seek: Add unittest It will be available in 25.2.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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/cee79f814756c0461e2793d5b01bb96e70b232af tdf#161511: sc_goal_seek: Add unittest It will be available in 24.8.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.