Bug 127960 - BASIC - variables of calling procedure zeroed after class method call
Summary: BASIC - variables of calling procedure zeroed after class method call
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-04 09:29 UTC by Paolo
Modified: 2020-04-25 18:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
ZIP containing files to reproduce the problem and screeshots (1.16 MB, application/zip)
2019-10-04 09:31 UTC, Paolo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo 2019-10-04 09:29:36 UTC
Description:
I've written some basic code to read, modify and write some binary data from my Garmin Forerunner 10.
I didn't use this macro since a long time. Now I needed to made some change on a file and the macro stopped working on LibreOffice 6 (I got errors using LO 6.1.0.3, 6.2.5.2, 6.2.7.1, 6.3.1.2).
It continues working perfectly on LibreOffice 5.3.4.2.

The problem comes when the macro calls some Class method: before the call some internal variables has the expected value (current byte id and current sheet row). After the call variables are zeroed and so BASIC goes in error state.
This happens with both reading and wrinting file (on different classes)

In the zip attached there are, the ods file with the macros, a txt whit a short description of the macro usage, some screenshots of the problem as well as the correct end reading message box, the input and output .FIT files.

Note that with LO 6 is not possible (with this macro) to use F8 to do the proper debugging, because when the cursor enter the class method, it is impossible to do anything else. The only way to show you the screeshots with the modified variable values has been that of using SHIFT+F8

Steps to Reproduce:
Read the file ShortMacroDescription.txt, inside attached zip file


Actual Results:
BASIC error

Expected Results:
Calc sheet compiled with the whole read bynary data converted in human readable information and modified information written into binary data file


Reproducible: Always


User Profile Reset: No



Additional Info:
I've made test on 5 different computers:
- Ubuntu Linux real PC with LO 6.3.1.2 (ko)
- Suse Linux on VirtualBox with LO 6.2.5.2 (ko)
- Windows 10 real PC with LO 6.1.0.3 (ko)
- Windows 10 on VirtualBox with LO 6.2.7.1 (ko)
- Windows XP on VirtuaBox with LO 5.3.4.2 (the only one working)
Comment 1 Paolo 2019-10-04 09:31:04 UTC
Created attachment 154755 [details]
ZIP containing files to reproduce the problem and screeshots
Comment 2 Buovjaga 2020-04-23 16:37:07 UTC
(In reply to Paolo from comment #0)
> It continues working perfectly on LibreOffice 5.3.4.2.

I don't understand this: it does not work with 5.3.0.0 alpha.

I get:
Inadmissible value or data type.
Data type mismatch.

after the step "A dialogue asks you to select the .FIT file"

The same error is present in the current version.

Please explain.
Comment 3 Paolo 2020-04-23 18:05:19 UTC
The .ods file I have provided in the .zip file has been generated (or, better, the sheets to show you the correct behavior of the code have been generated) using LibreOffice 5.3.4.2 on a Windows XP PC.
So, if I run again that BASIC macro now on that PC, using that version of LibreOffice, it does correctly read the .FIT file and, after having modified the data, to write the modified .FIT file.
Note that version of LO was working fine even on my primary Ubuntu Linux PC, because I've used this macro a lot of time in the past, to correct the .FIT data.

So this is all I can say.
Comment 4 QA Administrators 2020-04-24 03:38:18 UTC Comment hidden (obsolete)
Comment 5 Buovjaga 2020-04-24 16:28:05 UTC
I discussed this topic with a member of the macro team and he suggested you write a minimal macro example of the root problem, with English language comments & everything.
Comment 6 Paolo 2020-04-25 13:54:23 UTC
I have just updated LibreOffice to 6.4.3.2, tried to run the macros affected by the bug, and the problem has gone.
My classes now works fine and my macros as well.

So I think you can close the bug.

Thank you for your kind support.
Comment 7 Buovjaga 2020-04-25 18:12:36 UTC
Excellent news. Closing.