Bug 129360 - IDE cannot get the content of structs in the watch window
Summary: IDE cannot get the content of structs in the watch window
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.5.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: BASIC-IDE
  Show dependency treegraph
 
Reported: 2019-12-13 00:53 UTC by Regina Henschel
Modified: 2020-01-15 15:04 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Macro to access a shape in Draw (692 bytes, text/plain)
2020-01-11 14:26 UTC, Regina Henschel
Details
Screenshot of Watch window (30.80 KB, image/png)
2020-01-14 15:28 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2019-12-13 00:53:11 UTC
I get no properties, which are structs. Opening the + in the watch window in the IDE should show their components, but is empty now. For example examine a shape and its properties "size" and "position" or from ThisComponent the property "VisibleArea". 

I see the error in Version: 6.5.0.0.alpha0+ (x64)
Build ID: f44140bebb9c493d97ba5aef26c9692c53a6b93f
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL

It was OK in Version: 6.5.0.0.alpha0+ (x64)
Build ID: 790b5de8941d8f8d98c73ed1343289d7220211ad
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded
Comment 1 Xisco Faulí 2020-01-10 11:13:36 UTC
Hi Regina,
I've just tried with the steps from bug 129839 in

Version: 6.5.0.0.alpha0+
Build ID: 838935758a5ec8e0e68f4df0cf5bfcf737e3f6f2
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

and it works fine

Could you please try to reproduce it with a master build from http://dev-builds.libreoffice.org/daily/master/ ?
Otherwise, Could you please specify the steps to reproduce it ?
Comment 2 Regina Henschel 2020-01-11 14:26:17 UTC
Created attachment 157079 [details]
Macro to access a shape in Draw

I have tested current daily Version: 6.5.0.0.alpha0+ (x64)
Build ID: ce685f64f38551e7984155783c9c7660d986abf6
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL

The problem is not solved.

Start Draw and insert a shape. Open Basic IDE (Tools > Macro > Edit Macro). Use a new module. Delete all content of the module. The basic IDE has an icon "Import Basic"; import the attached macros. Set a breakpoint in line "dummy=1" in sub "examineShape_inDraw".
Go back to document, but keep IDE open.
Select the shape, then press Alt+F11. Chose the macro "examineShape_inDraw" and run it.
Go back to IDE. Set cursor in "oShape" and press F7 to add the variable to the watch window.

The watch window shows a tree with several + branches. Try them out. Some work, some not. For example not working are: Style, CustomShapeGeometry->CustomShapeGeometry(0), LineEnd, Size, Position.

Do the same in a version about 6 weeks ago, to see how it should work, e.g. in Version: 6.5.0.0.alpha0+ (x64)
Build ID: 790b5de8941d8f8d98c73ed1343289d7220211ad
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded

This is a severe regression and makes debugging a pain.
Comment 3 QA Administrators 2020-01-12 03:42:51 UTC Comment hidden (obsolete)
Comment 4 Xisco Faulí 2020-01-13 14:40:45 UTC
Reproduced in

Version: 6.5.0.0.alpha0+
Build ID: d5047c4a1cbae1cb2b57ed435ecd63e6817506d3
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Regina, thanks for the detailed explanation. Bisecting...
Comment 5 Xisco Faulí 2020-01-13 14:50:41 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=62f3f3d92aa204eaaa063b30d7ade44df501b997

author	Mike Kaganski <mike.kaganski@collabora.com>	2019-12-09 13:06:03 +0300
committer	Mike Kaganski <mike.kaganski@collabora.com>	2019-12-09 14:18:25 +0100
commit 62f3f3d92aa204eaaa063b30d7ade44df501b997 (patch)
tree b241ad744abad62cf898947757e88617811b309c
parent 6303f8ac291233b1f6888a8d71e769debe0f9fb0 (diff)
SbxArray: drop 16-bit indices

Bisected with: bibisect-linux64-6.5

Adding Cc: to Mike Kaganski
Comment 6 Mike Kaganski 2020-01-13 15:59:34 UTC
https://gerrit.libreoffice.org/c/core/+/86700
Comment 7 Commit Notification 2020-01-13 18:24:53 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/96ab492b74d9e64051d82f220f65cadedf34a878

tdf#129360: fix old unsigned underflow

It will be available in 6.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.
Comment 8 Regina Henschel 2020-01-14 07:30:49 UTC
Most branches open fine now. But it is still broken for property "Transformation".
Comment 9 Regina Henschel 2020-01-14 14:40:13 UTC
CustomShapeGeometry -> Path -> Coordinates -> Value, last step opening "First" or "Second" is still broken.
Comment 10 Mike Kaganski 2020-01-14 15:10:31 UTC
(In reply to Regina Henschel from comment #9)
> CustomShapeGeometry -> Path -> Coordinates -> Value, last step opening
> "First" or "Second" is still broken.

CustomShapeGeometry of which object contains that? Not for diamond at least :-)
Comment 11 Regina Henschel 2020-01-14 15:28:46 UTC
Created attachment 157149 [details]
Screenshot of Watch window

Every custom-shape has the property CustomShapeGeometry and "Diamond" is a custom-shape. So it must be there. If you use Draw and put the shape object itself into the Watch window, it is about the 19nd property. Compare your Watch window with my screen shot.
Comment 12 Mike Kaganski 2020-01-14 16:14:47 UTC
(In reply to Regina Henschel from comment #11)
> Every custom-shape has the property CustomShapeGeometry and "Diamond" is a
> custom-shape. So it must be there.

Of course it's there. But you wrote not about CustomShapeGeometry, but about its child objects, and Diamond has 4 child CustomShapeGeometry, none of which has Path -> Coordinates -> Value.
Comment 13 Regina Henschel 2020-01-14 17:15:50 UTC
OK, then a longer version. CustomShapeGeometry is a sequence of properties. Which properties are contained varies and the order is not fix. So in first step you see CustomShapeGeometry(0), CustomShapeGeometry(1)... You need to open each, until you find that with Name="Path". For the "Diamond"-shape it is index 3.

Then open its "Value". It is a sequence again. Its length depends on the shape. In case of "Diamond" you see Value(0), Value(1), Value(2). Open them, one of them is "Coordinates". That exists always. Open it, you will see "Value".

Open "Value", it is a sequence again. In case of "Diamond" it has items Value(0) to Value(4). They contain the coordinates. Open any of them. You should see "First" and "Second".

Open "First" or "Second". You should now see "Type" and "Value". "Type" contains, whether this is a direct value or the reference to an adjustment or the reference to a formula. "Value" contains the value itself or the index of the adjustment or formula. But it is empty here.
Comment 14 Mike Kaganski 2020-01-14 18:14:59 UTC
https://gerrit.libreoffice.org/c/core/+/86792
Comment 15 Mike Kaganski 2020-01-14 18:19:55 UTC
(In reply to Regina Henschel from comment #13)

Thanks for explanation! I somehow missed that "Path" was a value of a property, not its name.

Anyway, I feel very satisfied by these found regressions. Both of them are previously-masked bugs; when I push this fix, I'll mark it fixed again - please reopen if you find other places needing attention because of that change. Thanks!
Comment 16 Commit Notification 2020-01-14 18:27:56 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9f7ac479ff134d0f9ce65f6f8681e5e7664f357b

tdf#129360: don't try to use uninitialized objects

It will be available in 6.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.
Comment 17 Regina Henschel 2020-01-15 15:04:18 UTC
I have not found any other problems in the Watch-window.