Bug 151064 - CRASH: executing macro with .uno:InsertObjectChart
Summary: CRASH: executing macro with .uno:InsertObjectChart
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0 target:7.5.3 target:7.4.7
Keywords: haveBacktrace
Depends on:
Blocks: Chart Macro-StarBasic Crash
  Show dependency treegraph
 
Reported: 2022-09-19 16:04 UTC by Xisco Faulí
Modified: 2024-04-30 15:12 UTC (History)
5 users (show)

See Also:
Crash report or crash signature: ["SwInsertChart::SwInsertChart(Link<com::sun::star::ui::dialogs::DialogClosedEvent *,void> const &)","SwTextShell::ExecInsert(SfxRequest&)"]


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2022-09-19 16:04:42 UTC
1. Open Writer
2. Tools - Macro - Edit Macro
3. Execute

Sub Main

rem define variables
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dim args3(3) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ColHeaders"
args3(0).Value = true
args3(1).Name = "RowHeaders"
args3(1).Value = false
args3(2).Name = "InNewTable"
args3(2).Value = false
args3(3).Name = "RangeList"
args3(3).Value = "Table1.A1:B2"

dispatcher.executeDispatch(document, ".uno:InsertObjectChart", "", 0, args3())

End Sub

-> Crash

Reproduced in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: f0359fb2f01ecf9aed470ae90604f9bd6eec3380
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (C); UI: en-US
Calc: threaded

and

Version: 6.0.0.0.alpha1+
Build ID: 6eeac3539ea4cac32d126c5e24141f262eb5a4d9
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3; 
Locale: en-US (C); Calc: group threaded
Comment 1 Rafael Lima 2022-09-19 23:10:46 UTC
The macro worked for me in:

Version: 7.3.5.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.5-0ubuntu0.22.04.1
Calc: threaded

It also works in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 8b5a989dcdcf4edd50c9fdb092d4180432ce4b6a
CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded

The macro created an empty column chart (I did not have any data in sheet Table1).
Comment 2 Xisco Faulí 2022-09-20 08:44:15 UTC
I can also reproduce it in

Version: 7.4.1.2 (x64) / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 1; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 3 Rafael Lima 2022-09-20 11:45:42 UTC
Today I tried again on a different PC, but it still works:

Version: 7.4.1.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.4.1~rc2-0ubuntu0.22.04.1~lo1
Calc: threaded

Also works in gtk3

Version: 7.4.1.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.4.1~rc2-0ubuntu0.22.04.1~lo1
Calc: threaded

This is weird. Maybe a graphics issue?
Comment 4 raal 2022-09-22 18:26:19 UTC
COnfirm with Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 90861cc6f815b3f34edb88d47afed0d1099e72e7
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 5 Hossein 2022-10-09 20:00:26 UTC
Reproduced with the latest LO 7.5 dev master:

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: b484e5d9e0d22b794c2d1c73741191836158a4ad
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded


Backtace created with Qt Creator:
1  std::__uniq_ptr_impl<SwWrtShell, std::default_delete<SwWrtShell>>::_M_ptr  unique_ptr.h  173  0x7fff61467bda 
2  std::unique_ptr<SwWrtShell, std::default_delete<SwWrtShell>>::get  unique_ptr.h  422  0x7fff614656ae 
3  std::unique_ptr<SwWrtShell, std::default_delete<SwWrtShell>>::operator *  unique_ptr.h  407  0x7fff61465642 
4  SwView::GetWrtShell  view.hxx  413  0x7fff614640ca 
5  SwInsertChart::SwInsertChart  chartins.cxx  130  0x7fff6280e33a 
6  SwTextShell::ExecInsert  textsh.cxx  376  0x7fff6279f5cf 
7  SfxStubSwTextShellExecInsert  swslots.hxx  3093 0x7fff6279db73 
8  SfxDispatcher::Call_Impl  dispatch.cxx  254  0x7ffff482cdda 
9  SfxDispatcher::Execute_  dispatch.cxx  753  0x7ffff483030e 
10 SfxDispatcher::Execute  dispatch.cxx  811  0x7ffff48306a6 
11 SfxDispatchController_Impl::dispatch  unoctitm.cxx  681  0x7ffff48ea046 
12 SfxOfficeDispatch::dispatchWithNotification  unoctitm.cxx  279  0x7ffff48e80f3 
13 framework::DispatchHelper::executeDispatch  dispatchhelper.cxx  163  0x7ffff5ce06d8 
14 framework::DispatchHelper::executeDispatch  dispatchhelper.cxx  120  0x7ffff5ce038e 
15 gcc3::callVirtualMethod  callvirtualmethod.cxx 77  0x7fffe4ba64e2 
16 cpp_call  uno2cpp.cxx  233  0x7fffe4ba504d 
17 bridges::cpp_uno::shared::unoInterfaceProxyDispatch  uno2cpp.cxx  413  0x7fffe4ba5b38 
18 stoc_corefl::(anonymous namespace)::IdlInterfaceMethodImpl::invoke  criface.cxx  672  0x7fff9cae4aa6 
19 SbUnoObject::Notify  sbunoobj.cxx  2246 0x7ffff55f46f8 
20 SfxBroadcaster::Broadcast  SfxBroadcaster.cxx  40  0x7ffff42b2c30 
21 SbxVariable::Broadcast  sbxvar.cxx  154  0x7ffff576ee85 
22 SbxValue::SbxValue  sbxvalue.cxx  66  0x7ffff5767f3f 
23 SbxVariable::SbxVariable  sbxvar.cxx  52  0x7ffff576dfe8 
24 SbxMethod::SbxMethod  sbxobj.cxx  844  0x7ffff5760716 
25 SbiRuntime::FindElement  runtime.cxx  3708 0x7ffff56f6b63 
26 SbiRuntime::StepELEM  runtime.cxx  4193 0x7ffff56f8ecc 
27 SbiRuntime::Step  runtime.cxx  831  0x7ffff56eb7b8 
28 (anonymous namespace)::RunInitGuard::run  sbxmod.cxx  1015 0x7ffff5634fa1 
29 SbModule::Run  sbxmod.cxx  1176 0x7ffff5635a60 
30 SbModule::Notify  sbxmod.cxx  775  0x7ffff563411b 
31 SfxBroadcaster::Broadcast  SfxBroadcaster.cxx  40  0x7ffff42b2c30 
32 SbMethod::Broadcast  sbxmod.cxx  2113 0x7ffff563a592 
33 SbxValue::Get  sbxvalue.cxx  288  0x7ffff5768eac 
34 basctl::RunMethod  basobj3.cxx  280  0x7fff539ca0c9 
35 basctl::ModulWindow::BasicExecute  baside2.cxx  366  0x7fff5397e826 
36 basctl::ModulWindow::BasicRun  baside2.cxx  386  0x7fff5397e963 
37 basctl::ModulWindow::ExecuteCommand  baside2.cxx  906  0x7fff53981597 
38 basctl::Shell::ExecuteBasic  basides2.cxx  234  0x7fff539af436 
39 SfxStubbasctl_ShellExecuteBasic  basslots.hxx  153  0x7fff539b1277 
40 SfxDispatcher::Call_Impl  dispatch.cxx  254  0x7ffff482cdda 
41 SfxDispatcher::PostMsgHandler  dispatch.cxx  990  0x7ffff48311f6 
42 std::__invoke_impl<void, void (SfxDispatcher:: *&)(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>), SfxDispatcher *&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>>  invoke.h  74  0x7ffff485f633 
43 std::__invoke<void (SfxDispatcher:: *&)(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>), SfxDispatcher *&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>>  invoke.h  96  0x7ffff485dee1 
44 std::_Bind<void (SfxDispatcher:: *(SfxDispatcher *, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>::__call<void, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>&&, 0ul, 1ul>(std::tuple<std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>&&>&&, std::_Index_tuple<0ul, 1ul>)  functional  420  0x7ffff485b87c 
45 std::_Bind<void (SfxDispatcher:: *(SfxDispatcher *, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>::operator()<std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>, void>(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>&&)  functional  503  0x7ffff48588ee 
46 std::__invoke_impl<void, std::_Bind<void (SfxDispatcher:: *(SfxDispatcher *, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>>(std::__invoke_other, std::_Bind<void (SfxDispatcher:: *(SfxDispatcher *, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>&&) invoke.h  61  0x7ffff4853b67 
47 std::__invoke_r<void, std::_Bind<void (SfxDispatcher:: *(SfxDispatcher *, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>>(std::_Bind<void (SfxDispatcher:: *(SfxDispatcher *, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>&&)  invoke.h  111  0x7ffff484d907 
48 std::_Function_handler<void (std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>), std::_Bind<void (SfxDispatcher:: *(SfxDispatcher *, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>>::_M_invoke(std::_Any_data const&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>&&)  std_function.h  290  0x7ffff484947f 
49 std::function<void (std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>)>::operator()(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest>>) const  std_function.h  590  0x7ffff4c6cefb 
50 SfxHintPoster::DoEvent_Impl  hintpost.cxx  43  0x7ffff4c6cd1a 
51 SfxHintPoster::LinkStubDoEvent_Impl  hintpost.cxx  39  0x7ffff4c6ccad 
52 Link<void *, void>::Call  link.hxx  111  0x7fffeecc88c7 
53 ImplHandleUserEvent  winproc.cxx  2287 0x7fffeecc56a8 
54 ImplWindowFrameProc  winproc.cxx  2857 0x7fffeecc7556 
55 SalFrame::CallCallback  salframe.hxx  306  0x7fffef775866 
56 SalGenericDisplay::ProcessEvent  gendisp.cxx  66  0x7fffef79d6f5 
57 operator()  salusereventlist.cxx  119  0x7fffef3483e2 
58 SalUserEventList::DispatchUserEvents  salusereventlist.cxx  120  0x7fffef3486bb 
59 SalGenericDisplay::DispatchInternalEvent  gendisp.cxx  51  0x7fffef79d661 
60 SalX11Display::Yield  saldisp.cxx  1896 0x7fffe4eebb09 
61 DisplayYield  saldisp.cxx  381  0x7fffe4ee34f3 
62 (anonymous namespace)::YieldEntry::HandleNextEvent  saldata.cxx  562  0x7fffe4ede0ef 
63 SalXLib::Yield  saldata.cxx  658  0x7fffe4ede983 
64 X11SalInstance::DoYield  salinst.cxx  192  0x7fffe4f01ec5 
65 ImplYield  svapp.cxx  475  0x7fffef409924 
66 Application::Yield  svapp.cxx  559  0x7fffef40a606 
67 Application::Execute  svapp.cxx  453  0x7fffef4095c4 
68 desktop::Desktop::Main  app.cxx  1604 0x7ffff7bf7e44 
69 ImplSVMain  svmain.cxx  203  0x7fffef429307 
70 SVMain  svmain.cxx  235  0x7fffef429430 
71 soffice_main  sofficemain.cxx  94  0x7ffff7c62323 
72 sal_main  main.c  51  0x555555554a60 
73 main  main.c  49  0x555555554a42
Comment 6 Stéphane Guillou (stragu) 2024-04-30 14:25:07 UTC
Reproduced only when running the macro from the editor. Not reproduced if running it from Tools > Macros > Run macro.

Repro in OOo 3.3 and LO 5.0.0.5.
Repro in 7.4.0.3 with signature "SwTextShell::ExecInsert(SfxRequest&)": https://crashreport.libreoffice.org/stats/crash_details/e390e738-f83a-41ea-870b-f91deea33c23

No repro on recent daily build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2f5ab5b8e7bd7dd06e00153abb77a69e5d192dd2
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3

Bibisecting with linux-64-7.5, it stopped crashing at [5e131f5c2fbf659d2613da56a5f1157e22fd4d9f] which is:

commit 1590db1d5388210444bbb26fe779652f7cb24f3f
author	Xisco Fauli 	Tue Mar 21 16:55:59 2023 +0100
committer	Caolán McNamara 	Thu Mar 23 09:22:10 2023 +0000
sw: check GetActiveView()
See https://crashreport.libreoffice.org/stats/signature/SwView::GetDocShell()
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149223

Xisco, can you please check?
(And shouldn't the chart be inserted in the document just like when running the macro from Tools > Macros > Run macro?)