Bug 159172 - LO crashes on Run macro, if extension installed for user
Summary: LO crashes on Run macro, if extension installed for user
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+ Master
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://github.com/antoniofaccioli/Po...
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2024-01-14 01:07 UTC by Timur
Modified: 2024-01-15 20:29 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (14.92 KB, text/plain)
2024-01-15 19:44 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2024-01-14 01:07:57 UTC
LO crashes on "Run macro", if extension PortraitOrLandscape installed for user "Only for me". Not "For all users".
Comment 1 Julien Nabet 2024-01-15 19:44:22 UTC
Created attachment 191964 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I got an assertion.
Comment 2 Julien Nabet 2024-01-15 20:29:13 UTC
I also got a crash with all users but not right away after having select "Run macro", I tried to expand "Application Macros".

I noticed this on gdb:
#7  0x00007f73fa637693 in CuiConfigGroupListBox::FillScriptList (this=0x556a0da106a0, xRootNode=uno::Reference to (browsenodefactory::(anonymous namespace)::LocationBrowseNode *) 0x556a0ddf5ee8, 
    pParentEntry=0x7ffd53181780) at /home/julien/lo/libreoffice/cui/source/customize/cfgutil.cxx:582
582	                            if ( rxNode->getType() == browse::BrowseNodeTypes::CONTAINER )
(gdb) p grandchildren
$1 = uno::Sequence of length 1 = {empty uno::Reference}

Now I don't know if an empty uno::Ref may be expected in grandchildren (which comes from theChild->getChildNodes()).
If it's expected, this patch prevents from the crash:
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 3a2cdbc1b05e..e22e6d5ef81e 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -579,7 +579,7 @@ void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::scrip
 
                         for ( const auto& rxNode : grandchildren )
                         {
-                            if ( rxNode->getType() == browse::BrowseNodeTypes::CONTAINER )
+                            if ( rxNode.is() && rxNode->getType() == browse::BrowseNodeTypes::CONTAINER )
                             {
                                 bChildOnDemand = true;
                                 break;
@@ -893,7 +893,7 @@ void CuiConfigGroupListBox::GroupSelected()
 
                         for ( const Reference< browse::XBrowseNode >& childNode : children )
                         {
-                            if (childNode->getType() == browse::BrowseNodeTypes::SCRIPT)
+                            if (childNode.is() && childNode->getType() == browse::BrowseNodeTypes::SCRIPT)
                             {
                                 OUString uri, description;