Bug 153154 - changing instance structure in XML Forms document causes crash
Summary: changing instance structure in XML Forms document causes crash
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:7.6.0 target:7.5.1 target:7.5.0
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2023-01-22 21:24 UTC by Pavel Zhdanovich
Modified: 2023-01-25 08:56 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Zhdanovich 2023-01-22 21:24:17 UTC
Description:
The following operations with instances in XML Forms document using data navigator cause crash:
1. Adding an element or an attribute 
2. Changing an element or an attribute.
Deleting an attribute or an element is OK.
Probably this bug is a side effect of patching the bug Bug 153039.

Steps to Reproduce:
1.Create new or open existing XML Form document
2.switch to data Navigator 
3.press any button on the "instance" tab.

Actual Results:
Crash

Expected Results:
Dialog is opened for adding/editing an element or attribute


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.0.alpha0+ (x86) / LibreOffice Community
Build ID: 7c15ffd4e3bf002c3d4edd758bb3af27b1f6a34e
CPU threads: 2; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded
Comment 1 Michael Stahl (allotropia) 2023-01-23 10:01:53 UTC
the problem is that m_xDataTypeLB is null here:

#0  0x00007f1e4c608936 in weld::ComboBox::append_text(rtl::OUString const&) (this=0x0, rStr="Date") at master/include/vcl/weld.hxx:745
#1  0x00007f1e4c69b97c in svxform::AddDataItemDialog::InitDataTypeBox() (this=0x7ffd54d63470) at master/svx/source/form/datanavi.cxx:2463
#2  0x00007f1e4c696db8 in svxform::AddDataItemDialog::AddDataItemDialog(weld::Window*, svxform::ItemNode*, com::sun::star::uno::Reference<com::sun::star::xforms::XFormsUIHelper1> const&) (this=0x7ffd54d63470, pParent=0x7a029b0, _pNode=0x6e33db0, _rUIHelper=uno::Reference to (xforms::Model *) 0x6da9148) at master/svx/source/form/datanavi.cxx:2083
#3  0x00007f1e4c6839f1 in svxform::XFormsPage::DoToolBoxAction(std::basic_string_view<char, std::char_traits<char> >) (this=0x7b2c840, rToolBoxID="addelement") at lo/master/svx/source/form/datanavi.cxx:511

apparently the code that inits the variable was removed with:

commit 2e7f77d3fe01e36222d5ad84c18d7d7537092972
Author:     Noel Grandin <noel.grandin@collabora.co.uk>
AuthorDate: Mon Nov 21 10:53:38 2022 +0200
Commit:     Noel Grandin <noel.grandin@collabora.co.uk>
CommitDate: Tue Nov 22 05:39:04 2022 +0100

    loplugin:unusedfields
Comment 2 Xisco Faulí 2023-01-23 10:07:50 UTC
fix in https://gerrit.libreoffice.org/c/core/+/145999
Comment 3 Commit Notification 2023-01-23 12:04:21 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#153154: m_xDataTypeLB is still in use

It will be available in 7.6.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 4 Commit Notification 2023-01-23 20:04:20 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/98e385cf9712b8288b081e91342d5910448d8f77

tdf#153154: m_xDataTypeLB is still in use

It will be available in 7.5.1.

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 5 Pavel Zhdanovich 2023-01-24 21:03:37 UTC
I confirm that the bug has been fixed in master.
Thanks to those who did it!
Comment 6 Commit Notification 2023-01-25 08:56:20 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-0":

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

tdf#153154: m_xDataTypeLB is still in use

It will be available in 7.5.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.