Bug 154322 - XML Form Document: Choosing Instance after first clicking on Bindings leads to Crash of LO
Summary: XML Form Document: Choosing Instance after first clicking on Bindings leads t...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha1+
Hardware: x86-64 (AMD64) All
: medium critical
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.6.0 target:7.5.3
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: Form-Controls
  Show dependency treegraph
 
Reported: 2023-03-22 10:02 UTC by Robert Großkopf
Modified: 2023-04-24 08:51 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["SalInstanceTreeView::get_id(weld::TreeIter const&) const [clone .constprop.6917]","libgtk-3.so.0","SalInstanceTreeView::get_id(weld::TreeIter const &)"]


Attachments
gdb backtrace with LO 7.6 (12.36 KB, text/x-log)
2023-03-22 21:51 UTC, Stéphane Guillou (stragu)
Details
bt with debug symbols + console logs (5.32 KB, text/plain)
2023-03-23 08:54 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2023-03-22 10:02:46 UTC
Open LO.
File → New → XML Form Document.
On the right you see sidebar for XML Form Document.
Now click on "Bindings" - should be empty if you hadn't click else where …
Click on "Instance 1" and right mouse click on "instanceData".
Don't do anything and have a look at the symbols in "Instance 1". Will be greyed out.
No click on "Add Element" in the context menu while the symbols are greyed out.
LO will crash immediately.

Note: First click on "instanceData" creates a useless "Binding 1:" in "Bindings". Seems this click detroys all other possibilities like "Add Element", "Add Attribute" … for "Instance 2".

Big appears on
Version: 7.4.6.2 / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 6; OS: Linux 5.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded

Will also appear with LO 7.1.0.3 here and won't appear with LO 7.0.5.2

With LO 7.0.5.2 the binding won't be created automatically with click on the instance.
Comment 1 Stéphane Guillou (stragu) 2023-03-22 11:09:12 UTC
Reproduced with both gtk3 and kf5 VCLs:

Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Crash report kf5: https://crashreport.libreoffice.org/stats/crash_details/bf0741bc-0c64-4cd6-b5a2-a0462dd902de
Crash report gtk: https://crashreport.libreoffice.org/stats/crash_details/38fb9bf5-810e-4cfb-9755-5ac54f8cd98a

Also on Windows 10 with a recent master build:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-IN (en_GB); UI: en-GB
Calc: threaded
Comment 2 Stéphane Guillou (stragu) 2023-03-22 11:54:55 UTC
Crash report on Windows 10 with LO 7.5.1.2: https://crashreport.libreoffice.org/stats/crash_details/6e02ad19-1717-4993-8fa9-2f2ffdaceb99

Same signature as unconfirmed bug 147983.
Comment 3 Stéphane Guillou (stragu) 2023-03-22 21:50:45 UTC
Bibisected with linux-64-7.1 repo to first bad commit 8061e52b512c0e8f6ae6302b0ec39fc3386bd4a2 which points to core commit:

commit 3c5e074a8fe5e0a18d326d37bc54a5ec0f077e4e
author	Caolán McNamara <caolanm@redhat.com>	Fri Jun 19 12:37:05 2020 +0100
committer	Caolán McNamara <caolanm@redhat.com>	Tue Jun 23 10:21:08 2020 +0200
weld DataNavigator
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96750

Caolán, can you please have a look?
Comment 4 Stéphane Guillou (stragu) 2023-03-22 21:51:38 UTC
Created attachment 186145 [details]
gdb backtrace with LO 7.6
Comment 5 Julien Nabet 2023-03-23 08:54:55 UTC
Created attachment 186151 [details]
bt with debug symbols + console logs

On pc Debian x86-64 with master sources updated today, I could reproduce this.

I attached bt + console logs.
Comment 6 Caolán McNamara 2023-03-23 10:33:04 UTC
There seems to be a timer launched which triggers a clear and refill of the treeview which can take place while the right click context menu is running
Comment 7 Commit Notification 2023-03-23 14:11:59 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0cdd0a6603626d7da9c331771c77b8a719f0592a

Resolves: tdf#154322 if entries are disabled while menu is active, update it

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 8 Commit Notification 2023-03-23 14:13:01 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#154322 select the first entry of the current page by default

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 9 Caolán McNamara 2023-03-23 14:14:39 UTC
disable the menu entries if it is open, matching the toolbox entries getting disabled. which solves the crash, and preselect the first entry so the oddity doesn't tend to happen out of the box. Done in trunk, backport to 7.5 in gerrit
Comment 10 Stéphane Guillou (stragu) 2023-03-24 15:18:04 UTC
Thanks Caolán, couldn't crash it in:

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

Robert, would be great if you could also check that it all behaves as expected, as I'm not a seasoned user of the data navigator.
Thank you!
Comment 11 Commit Notification 2023-03-26 01:31:52 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/830c69ac5ed9018d11d25bfb70a534d1a4b55c3d

Resolves: tdf#154322 if entries are disabled while menu is active, update it

It will be available in 7.5.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 12 Robert Großkopf 2023-03-27 14:20:52 UTC
Tested with
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e0daa98a802cc1f84ceb0f306f5d15fecabd62c1
CPU threads: 6; OS: Linux 5.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded

Won't crash any more but:
→ creates the useless binding for instanceDate (Binding 1:) directly, without clicking on instanceData, which leads to the crash.
→ won't create any binding from added elements when clicking on added elements
(This will work with older versions …)
Comment 13 Robert Großkopf 2023-03-27 14:24:55 UTC
(In reply to Robert Großkopf from comment #12)

> → won't create any binding from added elements when clicking on added
> elements
> (This will work with older versions …)

Have to save and reopen the document → new bindings have been created without refreshing the tab "Binding". Seen if I try to add the bindings manually it will won't set the next number but counts all the elements I have created.
Comment 14 Caolán McNamara 2023-03-27 15:17:42 UTC
> Won't crash any more but:
> → creates the useless binding for instanceDate (Binding 1:) directly,
> without clicking on instanceData, which leads to the crash.
> → won't create any binding from added elements when clicking on added
> elements
> (This will work with older versions …)

Might have to file another bug, I'm not sure what you're describing, (might have to simplify it for me, I don't use XML forms), is this a new problem from this attempt at a fix, or not rectified here and that was the hope?
Comment 15 Robert Großkopf 2023-03-27 16:00:34 UTC
(In reply to Caolán McNamara from comment #14)
> > Won't crash any more but:
> > → won't create any binding from added elements when clicking on added
> > elements
> > (This will work with older versions …)
> 
> Might have to file another bug, I'm not sure what you're describing, (might
> have to simplify it for me, I don't use XML forms), is this a new problem
> from this attempt at a fix, or not rectified here and that was the hope?

It is new with this fix.
Open File → New → XML Form Document
Right click on instanceDate → Add Element.
Only press OK.
Element had been added as NewElement.
One mouse click on this NewElement.
Change to "Bindings".
Before this bug has been fixed the new binding for "NewElement" appears. Now you could see no new binding there.
Seems there is a refreshing problem.
If I change back to "Instance 1", close the tree view there and reopen it again, click on the filed and change to "Bindings" the new binding appears.
Comment 16 Commit Notification 2023-04-07 16:43:56 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#154322 select the first entry of the current page by default

It will be available in 7.5.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 17 Caolán McNamara 2023-04-24 08:51:13 UTC
with bug 154535 (hopefully) fixed is the issue of comment #12 satisfactory now?