Bug 161968 - UI Assign macro to shape crashes CALC
Summary: UI Assign macro to shape crashes CALC
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.3.2 release
Hardware: x86-64 (AMD64) All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0 target:24.8.3
Keywords: bibisected, bisected, haveBacktrace, regression
: 163189 163224 163530 (view as bug list)
Depends on:
Blocks: Macro Shapes Crash
  Show dependency treegraph
 
Reported: 2024-07-09 12:41 UTC by Hardy
Modified: 2024-10-31 14:07 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Calc file with a shape and macro (15.22 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-07-09 14:52 UTC, Rafael Lima
Details
Video of calc crashing (8.80 MB, video/quicktime)
2024-07-10 20:58 UTC, Hardy
Details
Callstack by Visual Studio (3.88 KB, text/plain)
2024-07-27 17:15 UTC, Regina Henschel
Details
screencast (2.70 MB, video/mp4)
2024-07-29 08:32 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hardy 2024-07-09 12:41:13 UTC
Description:
Calc crashes when trying to assign a macro to a shape.

Steps to Reproduce:
- Open LO Calc then add shape to a blank worksheet. 
- Right click on shape and select Assign Macro

Actual Results:
The program crashes.

Expected Results:
A box presenting either a macro to select or some option to create a new one.

Even if we create a very short macro before trying to assign a macro to the shape, it still crashes.

Reproducible: Always

User Profile Reset: Yes
Also tried in Safe mode

Env:
Windows 10 home, Ver 22H2 build 19045.4529

History
I have a spreadsheet with macros that worked for a long time.  Then I added a new sheet and some macros and at open point it crashed.  After this, the crashing issue happens whenever I try and run the macro from a button on the sheet (actually a box shape with rounded edges)
I can open the basic macros and edit and run them from within the macro editor but cannot trigger them from the button without crashing Calc.
I had assigned a macro to a shape in the past.  Now it fails.
Have tried with a new blank spreadsheet
Also tried safe mode, and tried user profile rests using the LO tools
Also tried application repair and lastly installed the 24.2.4.2 over the top of 24.2.3 that this started with.  Still happening.
Comment 1 ady 2024-07-09 13:04:35 UTC
(In reply to Hardy from comment #0)
> Also tried application repair and lastly installed the 24.2.4.2 over the top
> of 24.2.3 that this started with.  Still happening.

When you say "24.2.3 that this started with", what was the prior version you actually tried this procedure and it worked as expected?

Was this not happening with LO 24.2.2?
Comment 2 Rafael Lima 2024-07-09 14:52:01 UTC
Created attachment 195187 [details]
Calc file with a shape and macro

I am unable to reproduce this issue. I've created a Calc file with a shape on it and then I assigned a macro to the shape. It is working fine (see attached file).

Tested with

Version: 24.2.4.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.4-0ubuntu0.24.04.2
Calc: threaded

Can you share a sample file where the bug happens?
Comment 3 Mudge 2024-07-09 19:19:09 UTC
Also could not reproduce, successfully created shape, assigned macro
Comment 4 Hardy 2024-07-10 11:35:41 UTC
(In reply to ady from comment #1)
> (In reply to Hardy from comment #0)
> > Also tried application repair and lastly installed the 24.2.4.2 over the top
> > of 24.2.3 that this started with.  Still happening.
> 
> When you say "24.2.3 that this started with", what was the prior version you
> actually tried this procedure and it worked as expected?
> 
> Was this not happening with LO 24.2.2?

Prior to 24.2.3 I was using 7.0.5.
Honestly can't remember which of those two versions I was using when I created the working linked shape.
Comment 5 Hardy 2024-07-10 11:53:24 UTC
(In reply to Rafael Lima from comment #2)
> Created attachment 195187 [details]
> Calc file with a shape and macro
> 
> I am unable to reproduce this issue. I've created a Calc file with a shape
> on it and then I assigned a macro to the shape. It is working fine (see
> attached file).
> 
> Tested with
> 
> Version: 24.2.4.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.4-0ubuntu0.24.04.2
> Calc: threaded
> 
> Can you share a sample file where the bug happens?

I can, but you already did.  It happens with the file you attached.
I can edit and run your macro.  It works fine when I click the button too.
But if I select the shape and right click - assign macro, then calc crashes again.
Comment 6 Hardy 2024-07-10 11:53:58 UTC
(In reply to Mudge from comment #3)
> Also could not reproduce, successfully created shape, assigned macro

Are you in Windows environment Mudge ?
Comment 7 Hardy 2024-07-10 12:12:12 UTC
ok.  I thought I might delete all my registry settings but seems there are none.
So I creates a new test user on this system and signed in as that user.  Complete fresh profile.
Start calc. Create a simple macro with "Hello" message.  Test run from the macro editor - fine.
Add a rectangle to the worksheet.
Right click, assign macro
CRASH!
Comment 8 Hardy 2024-07-10 12:48:16 UTC
Just made a test on a second computer.  HP Laptop running Win 10 Pro 64 bit.
Same test as previous and same result.  LO Version is also 24.2.3.2
Win updates on this will be a little older than my main PC.
Comment 9 ady 2024-07-10 18:55:33 UTC
@Hardy,

Please open LO > Help > About. There is an icon in-there to copy the info to the clipboard. Please paste the info in your next comment.

This info is relevant for when the problem shows up (i.e. with your current settings).

Please paste that info before any additional tests and/or changes (see below) as this info might change too.


Additionally (please save all your docs before testing)...

* Open Calc > Tools > Options > LibreOffice > OpenCL. Is OpenCL set to ON? What happens with your tests if you set it to OFF (and OK > restart LO)?

* Open Calc > Tools > Options > LibreOffice > View > (Graphics Output). Which settings are you using? What happens if you disable all the check boxes in that area (4 check boxes as of LO 24.2) (and then OK > restart LO)?


Testing with the aforementioned changes might have different resulting behavior; they _might_ avoid the crash, and _might_ have some impact on performance. The point is to narrow down the source of the problem, so similar conditions might be met by someone else (and then reproduce the behavior).
Comment 10 Hardy 2024-07-10 20:58:46 UTC
Created attachment 195221 [details]
Video of calc crashing
Comment 11 Hardy 2024-07-10 21:07:31 UTC
ok.  Info.

Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-AU (en_AU); UI: en-US
Calc: threaded

Suggestions to test with OpenCL switched off - Same result
Also disabled all 4 graphics options in View.  Same result - crashed.

I mentioned earlier that I get a similar crash if I use the Tools -> Macros -> Run Macro menu.
I dont get a list of macros - just crash.
I tested this also in Impress app and it also crashes.  Also for Writer (although I didn't actually create a macro in Writer before trying this option.  I did make a basic macro in Impress first though.

One thought comes to mind.  

There are these built in "Application Macros & Dialogues" when I open the Macro editor.
About the time this crashing started - I was trying to use a dictionary object and was playing around looking at these 'built in' macros.  Is it possible to corrupt them ?
If yes - how can I restore them ?  I already tried an application repair as previously mentioned.
Thanks
Comment 12 Hardy 2024-07-10 21:08:46 UTC
Actually - I dont see how that last comment is relevant given that this happens on both my computers.
Comment 13 ady 2024-07-10 21:49:45 UTC
(In reply to Hardy from comment #12)
> Actually - I dont see how that last comment is relevant given that this
> happens on both my computers.

ATM, no one else has reproduced the issue. With the info you provided, there might be someone with similar settings/context that might be able to reproduce it. There might be other factors in place (extension, java, graphic driver, clipboard history manager,...).

Pasting the info from your other system might (or might not) help.

JIC, I am still not able to reproduce the crash on Windows 10 and LO in Safe Mode (UI render: default).
Comment 14 Stéphane Guillou (stragu) 2024-07-25 15:24:17 UTC
Could not reproduce with:

Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: x11
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

If you are up for it, you can collect a backtrace of the crash: https://wiki.documentfoundation.org/How_to_get_a_backtrace_with_WinDbg
Comment 15 Hardy 2024-07-26 22:48:10 UTC
Thanks.  I'll do this and post the results.
Comment 16 Regina Henschel 2024-07-27 17:15:57 UTC
Created attachment 195552 [details]
Callstack by Visual Studio

I can reproduce the crash. Callstack from Visual Studio is attached.
Comment 17 Stéphane Guillou (stragu) 2024-07-29 01:14:47 UTC
Still can't reproduce with:

Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Regina, what steps exactly did you use?
Comment 18 Regina Henschel 2024-07-29 08:32:29 UTC
Created attachment 195573 [details]
screencast

The used macro is

sub showHello
msgbox "hello"
end sub

Tested in Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: dc9486f2443fa52588b625c0a2a288bff56a7a45
CPU threads: 32; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded
Comment 19 Rafael Lima 2024-07-30 12:28:04 UTC
(In reply to Regina Henschel from comment #18)
> Created attachment 195573 [details]
> screencast

Thanks Regina... I can now reproduce the issue.

As soon as I click "Ok" I get the crash.

Version: 24.8.0.1.0+ (X86_64) / LibreOffice Community
Build ID: 9bba9dede3def626e3adab6696a911762e25b7ff
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
Comment 20 Stéphane Guillou (stragu) 2024-07-31 12:30:06 UTC
Interesting, I can't reproduced in 24.2.5 but I can in:

Version: 24.8.0.1 (X86_64) / LibreOffice Community
Build ID: 6fd6cae02baed1e82d14ed2da1f2458092354dab
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

And in a recent daily build:

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 233af54afb6e493c3538efe7c93d0f53f1b4c3ab
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

So started at different commits in Windows vs Linux?

Bibisected with linux-64-24.8 to first bad build [444cca7899d05d072a95ee3bf0c2b8eb94c009f0] which is:

commit f690e8218a74a0f7792407a1d46198883d2528ff
author	Noel Grandin Tue Jan 23 13:24:29 2024 +0200
committer	Noel Grandin 	Tue Jan 23 14:32:25 2024 +0100
make event config dialog async
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162434

Noel, can you please have a look?

Would be interesting to see when it started on Windows, if someone can please check.
Comment 21 Commit Notification 2024-08-01 11:10:59 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/514d7384470434a0b0b119e369ff615e2a1499c9

tdf#161968 UI Assign macro to shape crashes CALC

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.
Comment 22 Hardy 2024-08-10 12:09:30 UTC
Sorry it's taken me a while to test this update.
I've installed the dev that should be fixed.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3ee53d75d253fb7fe2eb8db44afca95fda7f156d
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win
Locale: en-AU (en_AU); UI: en-US
Calc: CL threaded



I still get crashing in both cases.
- Assign macro to shape
- Run Macro menu option.

Not sure if the original version I had should be uninstalled before testing.  I did rename the subdirectory Libreoffice and am now running scalc.exe directly from the dev folder:  C:\Program Files\LibreOfficeDev 25\program

Can others still reproduce this with the Dev ?
Comment 23 Xisco Faulí 2024-08-19 19:02:02 UTC
@Regina, @Rafael Lima, is the issue still reproducible for you ?
Comment 24 Regina Henschel 2024-08-19 20:30:21 UTC
It no longer crashes with Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6c640ee2662318f32a22d8293ad7498109681933
CPU threads: 32; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded
Comment 25 Rafael Lima 2024-08-19 23:03:32 UTC
(In reply to Xisco Faulí from comment #23)
> @Regina, @Rafael Lima, is the issue still reproducible for you ?

No crashes in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a05432f02b6441b66addc0f22f1b8444557ac37b
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
Comment 26 ady 2024-09-29 12:49:42 UTC
*** Bug 163189 has been marked as a duplicate of this bug. ***
Comment 27 Xisco Faulí 2024-10-14 07:48:09 UTC
I guess we can close this issue now.
At least for me the following steps are fixed after 514d7384470434a0b0b119e369ff615e2a1499c9

1. In Calc insert a shape
2. Choose "Assign Macro" from the right-click menu
3. In the "Assign Macro" dialog select the said macro and press "Assign"
4. Press "OK"

For related issues, please create a new report
Comment 28 Commit Notification 2024-10-14 12:35:20 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/1683eb45c59a8609215685e31efb1bda707f6066

tdf#161968 UI Assign macro to shape crashes CALC

It will be available in 24.8.3.

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 29 Julien Nabet 2024-10-27 09:15:45 UTC
*** Bug 163530 has been marked as a duplicate of this bug. ***
Comment 30 Gabor Kelemen (allotropia) 2024-10-31 14:07:17 UTC
*** Bug 163224 has been marked as a duplicate of this bug. ***