Bug 163083 - Data -> Goal seek function not working
Summary: Data -> Goal seek function not working
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.1.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0 target:25.2.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Clipboard GoalSeek
  Show dependency treegraph
 
Reported: 2024-09-21 16:07 UTC by Bruh
Modified: 2025-01-10 15:47 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Macro using Visual Basic on calc (421.86 KB, text/plain)
2024-09-21 17:26 UTC, Bruh
Details
Sample (261.27 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-09-22 10:45 UTC, Bruh
Details
b. Análise de Sensibilidade - Tesouro Direto rev1 (224.71 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-12-15 15:51 UTC, Bruh
Details
test_macro1 (225.67 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-01-03 08:43 UTC, Saburo
Details
some macro (253.06 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-01-05 09:37 UTC, Saburo
Details
windbg-debug (154.60 KB, text/plain)
2025-01-07 23:04 UTC, Saburo
Details
windbg-dump (20.92 KB, text/plain)
2025-01-07 23:05 UTC, Saburo
Details
Dumpfile (14.15 MB, application/octet-stream)
2025-01-08 09:57 UTC, Saburo
Details
Dumpfile(24.8.4.2) (13.97 MB, application/octet-stream)
2025-01-08 13:30 UTC, Saburo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruh 2024-09-21 16:07:24 UTC
Hello,

A have a sheet with a macro with many "Data -> Goal seek" functions  that used to work on LibreOffice_24.2.6 calc. In this new release 24.8.1 it doesn't work.

Had to re-install LibreOffice_24.2.6 calc and my sheet worked again.

Best,
Bruh
Comment 1 Rafael Lima 2024-09-21 17:11:52 UTC
Can you share a sample file where the problem is happening?

Please remove all personal data before uploading the file.
Comment 2 Rafael Lima 2024-09-21 17:12:21 UTC
Or maybe simply share the code for your macro, so we can test and verify the issue.
Comment 3 Bruh 2024-09-21 17:26:01 UTC
Created attachment 196594 [details]
Macro using Visual Basic on calc
Comment 4 Bruh 2024-09-21 17:26:52 UTC
Ok. Please mind you I can't really code and I believe it could be done better using "for" loops.
Comment 5 raal 2024-09-22 06:51:45 UTC
Please can you share sample file with macro?
Comment 6 Bruh 2024-09-22 10:45:46 UTC
Created attachment 196600 [details]
Sample
Comment 7 Bruh 2024-09-30 22:25:18 UTC
Hello,

Did the macro/spreadsheet freeze with you too?
Comment 8 Rafael Lima 2024-10-01 12:30:51 UTC
(In reply to Bruh from comment #7)
> Did the macro/spreadsheet freeze with you too?

When I run the "Macro0" in your document, my whole machine freezes completely.

But the freeze happens both in 24.2 and 24.8.

Tested with

Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.5-0ubuntu0.24.04.2
Calc: threaded

And With

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded

No idea why it is freezing.

How long does it usually take to run this macro on your machine?
Comment 9 Bruh 2024-10-01 20:46:45 UTC
(In reply to Rafael Lima from comment #8)
> (In reply to Bruh from comment #7)
> > Did the macro/spreadsheet freeze with you too?
> 
> When I run the "Macro0" in your document, my whole machine freezes
> completely.
> 
> But the freeze happens both in 24.2 and 24.8.
> 
> Tested with
> 
> Version: 24.2.5.2 (X86_64) / LibreOffice Community
> Build ID: 420(Build:2)
> CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
> Locale: pt-BR (pt_BR.UTF-8); UI: en-US
> Ubuntu package version: 4:24.2.5-0ubuntu0.24.04.2
> Calc: threaded
> 
> And With
> 
> Version: 24.8.2.1 (X86_64) / LibreOffice Community
> Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
> CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
> Locale: pt-BR (pt_BR.UTF-8); UI: en-US
> Calc: CL threaded
> 
> No idea why it is freezing.
> 
> How long does it usually take to run this macro on your machine?

Heu, I'm using Libreoffice on Windows 10.

The macro takes around 7-8min to finish on 24.2.6.2.
Comment 10 Buovjaga 2024-12-03 17:37:44 UTC
I have the same issue as Rafael, running the macro never seems to finish. I waited for like 15 mins. Can you create a simpler example?

Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 94afced0195ef824e575176e33c79ca57484cd5c
CPU threads: 2; OS: Windows 11 X86_64 (10.0 build 22621); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 11 Bruh 2024-12-09 18:37:00 UTC
Hello,

I reduced the macro lines. It worked fine on 24.2.6.2

Then I installed the new 24.8.3.2 . It froze. Problem seems to be at the end   (after Y24 cell calculatiosn). Please try coping the sheets of the ealier attached file to another blank .ods file and then copy/paste the macro below.

I tried the following Macro:

Sub Macro0()

Sheets("NTN-B 2055 cupom1").Select
	Range("AK6").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("A24")
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("B23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("B24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
	
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("c23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("c24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("d23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("d24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("e23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("e24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("f23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("f24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("g23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("g24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("h23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("h24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("i23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("i24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("j23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("j24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("k23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("k24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("l23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("l24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("m23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("m24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("n23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("n24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("o23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("o24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
	
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("p23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("p24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("q23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("q24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("r23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("r24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("s23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("s24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("t23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("t24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("u23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("u24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("v23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("v24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("w23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("w24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("x23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("x24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
	
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("y23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("y24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
		

	
	Sheets("NTN-B 2055 cupom1").Select
	Range("AK2").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("D11")
	Range("AK6").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("A24")
    Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("Q23")
	
	
	Sheets("Central1").Select
	Range("A1").Select
	
	
End Sub
Comment 12 Buovjaga 2024-12-14 16:12:44 UTC
(In reply to Bruh from comment #11)
> Hello,
> 
> I reduced the macro lines. It worked fine on 24.2.6.2
> 
> Then I installed the new 24.8.3.2 . It froze. Problem seems to be at the end
> (after Y24 cell calculatiosn). Please try coping the sheets of the ealier
> attached file to another blank .ods file and then copy/paste the macro below.

I get

BASIC runtime error.
Sub-procedure or function procedure not defined.

pointing to line:
Sheets("NTN-B 2055 cupom1").Select

Plz help.
Comment 13 Bruh 2024-12-15 15:49:52 UTC
(In reply to Buovjaga from comment #12)
> (In reply to Bruh from comment #11)
> > Hello,
> > 
> > I reduced the macro lines. It worked fine on 24.2.6.2
> > 
> > Then I installed the new 24.8.3.2 . It froze. Problem seems to be at the end
> > (after Y24 cell calculatiosn). Please try coping the sheets of the ealier
> > attached file to another blank .ods file and then copy/paste the macro below.
> 
> I get
> 
> BASIC runtime error.
> Sub-procedure or function procedure not defined.
> 
> pointing to line:
> Sheets("NTN-B 2055 cupom1").Select
> 
> Plz help.

Ok, made it work on 24.8.3.2.

Macro is now way simpler, only "Central1.B24" (please execute the macro on the file attached) is solved: 

"
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub Macro0()

Sheets("NTN-B 2055 cupom1").Select
	Range("AK6").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("A24")
	Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("B23")
    Range("AI1").GoalSeek Goal:=60951, ChangingCell:=Range("AK2")
    Range("AK2").Select
    Selection.Copy
    Sheets("Central1").Select
    Range("B24").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
	Range("A22").Select
	
Sheets("NTN-B 2055 cupom1").Select
	Range("AK2").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("D11")
	Range("AK6").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("A24")
    Range("AK7").Select
    ActiveCell.FormulaR1C1 = Sheets("Central1").Range("Q23")
	
	
	Sheets("Central1").Select
	Range("A1").Select
	
	
End Sub
"
Comment 14 Bruh 2024-12-15 15:51:35 UTC
Created attachment 198119 [details]
b. Análise de Sensibilidade - Tesouro Direto rev1

File with the simpler macro
Comment 15 Buovjaga 2024-12-15 16:08:13 UTC
(In reply to Bruh from comment #14)
> Created attachment 198119 [details]
> b. Análise de Sensibilidade - Tesouro Direto rev1
> 
> File with the simpler macro

Thanks, now it works. What should I look out for? What is the good result in 24.2 and what is the bad result in 24.8?

I see that after running the macro, B24 gets a value: 81,583000

Arch Linux 64-bit
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d65d8a3adc9691451bfa21ca8c574b77e54a3290
CPU threads: 8; OS: Linux 6.12; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 15 December 2024
Comment 16 Bruh 2024-12-15 16:20:20 UTC
(In reply to Buovjaga from comment #15)
> (In reply to Bruh from comment #14)
> > Created attachment 198119 [details]
> > b. Análise de Sensibilidade - Tesouro Direto rev1
> > 
> > File with the simpler macro
> 
> Thanks, now it works. What should I look out for? What is the good result in
> 24.2 and what is the bad result in 24.8?
> 
> I see that after running the macro, B24 gets a value: 81,583000
> 
> Arch Linux 64-bit
> Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: d65d8a3adc9691451bfa21ca8c574b77e54a3290
> CPU threads: 8; OS: Linux 6.12; UI render: default; VCL: kf6 (cairo+wayland)
> Locale: fi-FI (fi_FI.UTF-8); UI: en-US
> Calc: CL threaded
> Built on 15 December 2024

Hey, glad it's not a particular problem from my end (running Libreoffice on a Windows 10 machine).

ok, in the file Sample.ods (2024-09-22 10:45 UTC, Bruh) all cells from Central1.B24 to Central.AF55 must have a (slightly diferent) result the same way you found on B24 (derived from a Goal seek function on the macro).

Problem is the macro gets stuck around the 20th cell (?) (V24?). It's like the sequential goal seek function executions mess up on 24.8.3.2. And they don't on 24.2.
Comment 17 Buovjaga 2024-12-15 16:58:50 UTC
(In reply to Bruh from comment #16)
> Hey, glad it's not a particular problem from my end (running Libreoffice on
> a Windows 10 machine).
> 
> ok, in the file Sample.ods (2024-09-22 10:45 UTC, Bruh) all cells from
> Central1.B24 to Central.AF55 must have a (slightly diferent) result the same
> way you found on B24 (derived from a Goal seek function on the macro).
> 
> Problem is the macro gets stuck around the 20th cell (?) (V24?). It's like
> the sequential goal seek function executions mess up on 24.8.3.2. And they
> don't on 24.2.

Thanks for the explanation, but I get the same bad result in 24.2, 7.5, 5.2 when testing with attachment 198119 [details].
Comment 18 Bruh 2024-12-15 17:09:23 UTC
(In reply to Buovjaga from comment #17)
> (In reply to Bruh from comment #16)
> > Hey, glad it's not a particular problem from my end (running Libreoffice on
> > a Windows 10 machine).
> > 
> > ok, in the file Sample.ods (2024-09-22 10:45 UTC, Bruh) all cells from
> > Central1.B24 to Central.AF55 must have a (slightly diferent) result the same
> > way you found on B24 (derived from a Goal seek function on the macro).
> > 
> > Problem is the macro gets stuck around the 20th cell (?) (V24?). It's like
> > the sequential goal seek function executions mess up on 24.8.3.2. And they
> > don't on 24.2.
> 
> Thanks for the explanation, but I get the same bad result in 24.2, 7.5, 5.2
> when testing with attachment 198119 [details].

Now, that's awkward.

Maybe if you tried to incrementally add cycles to the Macro0:

B24 - working;
B24, C24 - ?
B24, C24, D24 - ?
.
.
.

till it freezes.
Comment 19 Bruh 2024-12-15 17:10:41 UTC
Remembered of something.

The file was originally a .xls file. Then I conveted it to .ods (with adjustments to work on Libreoffice).
Comment 20 Saburo 2025-01-03 08:43:53 UTC
Created attachment 198365 [details]
test_macro1

Windows Only?
bibisect
https://git.libreoffice.org/core/+/b9d32aa128ca1c8096a43c8d564a38330f1fc85c%5E%21

repro
Version: 24.8.4.2 (X86_64) / LibreOffice Community
Build ID: bb3cfa12c7b1bf994ecc5649a80400d06cd71002
CPU threads: 12; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded

no repro
Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 12; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded

Version: 24.8.3.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 4; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded
Comment 21 Buovjaga 2025-01-03 09:24:48 UTC
(In reply to Saburo from comment #20)
> Created attachment 198365 [details]
> test_macro1
> 
> Windows Only?
> bibisect
> https://git.libreoffice.org/core/+/
> b9d32aa128ca1c8096a43c8d564a38330f1fc85c%5E%21

The commit is about clipboard:
tdf#148647: make sure to update own content on Win clipboard change

The macro does use pasting, so I suppose it is a plausible result. Let's ask Mike about it.
Comment 22 Mike Kaganski 2025-01-03 15:22:15 UTC
I can't repro using Version: 25.2.0.1 (X86_64) / LibreOffice Community
Build ID: ddb2a7ea3a8857aae619555f1a8743e430e146c9
CPU threads: 24; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (ru_RU); UI: en-US
Calc: CL threaded

It may possibly be caused by some third-party application interfering with clipboard. It could be useful to try to find that application, by those who experience the problem.
Comment 23 BogdanB 2025-01-03 18:07:15 UTC
Buovjaga, can you examine the keywords here? Seems bisected.
Comment 24 Saburo 2025-01-05 09:37:50 UTC
Created attachment 198380 [details]
some macro

I am not using any third-party clipboard related applications.

I updated my PC to Win11 24H2.

Macro2, which does not use the clipboard, can be executed.
Macro1 still freezes when executed.
Could this be related to the fact that when I run a macro that uses the clipboard (Module1-Clipboard, Module2-DispatchCopyMacro), the copy sometimes fails?
Comment 25 Mike Kaganski 2025-01-05 09:43:56 UTC
(In reply to Saburo from comment #24)
> I am not using any third-party clipboard related applications.

I wouldn't suspect "MP3Studio YouTube Downloader" to be "clipboard related". Please don't assume things, just try to test shutting down everything that runs.
Comment 26 Saburo 2025-01-05 12:41:02 UTC
(In reply to Mike Kaganski from comment #25)
> (In reply to Saburo from comment #24)
> > I am not using any third-party clipboard related applications.
> 
> I wouldn't suspect "MP3Studio YouTube Downloader" to be "clipboard related".
> Please don't assume things, just try to test shutting down everything that
> runs.

Are you confusing this with some other bug?
I do not use "MP3Studio YouTube Downloader".
It seems to improve somewhat if you close resident apps, but it still happens sometimes.
Comment 27 Mike Kaganski 2025-01-05 13:52:05 UTC
(In reply to Saburo from comment #26)
> Are you confusing this with some other bug?

No. I refer to bug 148647, fixing which is supposedly caused this one. And there, bug 148647 comment 11 was the first one to mention that program, which in the end turned out to be clipboard related. Any program can be.
Comment 28 Saburo 2025-01-07 23:04:16 UTC
Created attachment 198423 [details]
windbg-debug

This is my first time using windbg. Any useful information?
Comment 29 Saburo 2025-01-07 23:05:09 UTC
Created attachment 198424 [details]
windbg-dump
Comment 30 Mike Kaganski 2025-01-08 05:24:14 UTC
(In reply to Saburo from comment #29)

Unfortunately no, these are not dumps. The minidump is mentioned in attachment 198424 [details]: "Loading Dump File [C:\Users\yosi3\AppData\Local\Temp\soffice (2).DMP]" - *that* file could be useful.

The two files only show that indeed, the problem is clipboard-related (as expected):

> ...
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(36) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(37) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(38) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(39) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(40) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(41) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(42) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(43) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(44) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(45) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> com\ole32\ole232\clipbrd\clipapi.cpp(3731)\ole32.dll!00007FFE5A13E1D3: (caller: 00007FFE5A13D0DA) ReturnHr(46) tid(34d4) 800401D0 OpenClipboard ã«å¤±æ•—ã—ã¾ã—ãŸ
> (3338.31d8): Break instruction exception - code 80000003 (first chance)

We have a code that tries to open clipboard ten times before failing: see e.g. https://opengrok.libreoffice.org/xref/core/vcl/win/dtrans/MtaOleClipb.cxx?r=1d91ab661b2fe0f307c0742999b40e6d848117af#449. But that doesn't tell us what holds the clipboard; and there are only two possibilities: either we hold it in another place in the same process (and then the proper dump could show that); or it is another app holding it - which would be comment 22.
Comment 31 Saburo 2025-01-08 09:57:47 UTC
Created attachment 198430 [details]
Dumpfile

I tried to take a dump using procdump.
Comment 32 Mike Kaganski 2025-01-08 10:23:51 UTC
(In reply to Saburo from comment #31)

Are you using master? This makes it impossible to analyze the dump, because the binaries on your system do not match any symbols on our symbol server. Can you please repeat using any released version? Thank you for your effort!
Comment 33 Saburo 2025-01-08 13:30:42 UTC
Created attachment 198431 [details]
Dumpfile(24.8.4.2)
Comment 34 Mike Kaganski 2025-01-09 06:17:17 UTC
Thank you Saburo! The minidump is highly informative.

https://gerrit.libreoffice.org/c/core/+/179984 is my attempt at this. If possible, could you please try it - if you use a self-built master? If not, then you will be able to test as soon as it gets merged, and a daily build is available.
Comment 35 Commit Notification 2025-01-09 07:48:46 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/171acae53f7b5f4f78dd395a10c89f779cb57494

tdf#163083: try to release lock to avoid deadlock

It will be available in 25.8.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 36 Commit Notification 2025-01-09 11:39:18 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/b17ba654e0be32848c78d688563ee6a5ad507407

tdf#163083: try to release lock to avoid deadlock

It will be available in 25.2.0.2.

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 37 Saburo 2025-01-10 14:11:22 UTC
(In reply to Mike Kaganski from comment #34)
> Thank you Saburo! The minidump is highly informative.
> 
> https://gerrit.libreoffice.org/c/core/+/179984 is my attempt at this. If
> possible, could you please try it - if you use a self-built master? If not,
> then you will be able to test as soon as it gets merged, and a daily build
> is available.

It no longer freezes, but sometimes the copy fails.

1. Clear the contents of cells B24:AF30 on the "Central1" sheet.
2. Run "Macro1".
If no problems occur, repeat steps 1 and 2.

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 89c00618b9cee6e786fd11a7fdbf7aaf24e4fbb7
CPU threads: 12; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: CL threaded
Comment 38 Mike Kaganski 2025-01-10 15:47:00 UTC
Please file the "sometimes copy fails" as a separate bug; one bug must cover one problem. The hang is fixed, according to your confirmation - thanks.