Bug 141034 - Crash entire application on syntax error in basic
Summary: Crash entire application on syntax error in basic
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.1.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-14 22:30 UTC by CLA
Modified: 2022-02-04 03:44 UTC (History)
3 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 CLA 2021-03-14 22:30:43 UTC
Description:
LibreOffice crashes entirely when basic macro with syntax error in is run.

I had:
   myResult - true
instead of:
   myResult = true
(the - and = keys are right next to each other on my keyboard)
(myResult in the above is decalred as boolean)
(the macro is within the ods)

Steps to Reproduce:
1.Have macro with syntax error in, eg:

function myResult (toTest as string) as boolean
   if ( toTest = "TEST" ) then
       myResult - true   REM should be =
   else
       myResult = false
   end if
end function

2. Run macro (I run it from sub called by a button in a calc sheet)

3. Watch LibreOffice crash

Actual Results:
Entire application crashes

Expected Results:
No crash, maybe a syntax error warning


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 7.1.1.2 / LibreOffice Community
Build:  dd797d330b34196606d0970aa..
Environment: CPU threads: 4; OS: Linux 5.8
User Interface: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Misc: Calc: threaded

I when I corrected my syntax error (changed the - to =) everything worked well. I tested by changing back to the error (using a - instead of the =) and it crashed.
I further tested by trying the other assignment (myResult - false) and this did _not_ crash, so I think it is something to do with true.
I have not been able to test more so submitting this as a FYI
Comment 1 [REDACTED] 2021-03-15 21:57:16 UTC
No repro

Version: 7.1.1.2 / LibreOffice Community
Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 2 Roman Kuznetsov 2021-03-17 17:56:25 UTC
no repro in

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 8e49505fa7352023c252bf794ae84c9082d7264e
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded

I just got an error message
Comment 3 Xisco Faulí 2021-03-18 17:19:38 UTC
I get the 'not enough stack memory error'

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: d7ed130f537a81b900c55d222004cc9e88c0b355
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

To be certain the reported issue is not related to corruption in the user profile, could you please reset your Libreoffice profile ( https://wiki.documentfoundation.org/UserProfile ) and re-test?

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the issue is still present
Comment 4 CLA 2021-03-19 17:19:06 UTC
I have followed the steps in https://wiki.documentfoundation.org/UserProfile and run libreoffice --safe-mode.
The only thing I then changed was the macro security in order to allow macros to run.
I loaded my application again and changed the macro to have a - true (instead of the = true, saved it and then ran the script.
The entire libreoffice crashed as before. So it is reproducible for me in safe mode.
Comment 5 himajin100000 2021-03-19 17:58:05 UTC
not reproducible on 

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 6e4238018bf0408f2961e5708212e09a8c3597dc
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: CL

When I ran Main() the values displayed were
0
false 

---
Function myResult (toTest as string) as boolean
   if ( toTest = "TEST" ) then
       myResult - true   REM should be =
   else
       myResult = false
   end if
End function

Sub Main()
Msgbox(true + 1)
Msgbox(myResult("TEST"))
End Sub
---

At least in my experiment, function call seemed callable without parentheses,
and the constant true is of value -1

so the code is parsed as 
myResult( - true )

which is equivalent to 

myResult( - (-1) )

so

myResult( 1 )

As the first parameter of myResult is of type String,
"1" was assigned to toTest, executing the following line, which is of course correct.

myResult = false
Comment 6 Xisco Faulí 2021-04-01 09:06:47 UTC
Hello CLA,
could you please try again with LibreOffice 7.1.2.2 due to be released today ?
Comment 7 CLA 2021-04-04 07:04:23 UTC
(In reply to Xisco Faulí from comment #6)
> Hello CLA,
> could you please try again with LibreOffice 7.1.2.2 due to be released today
> ?

Still crash on LibreOffice 7.1.2.2 / LibreOffice Community

[Note the Build: URL takes me to a 404 page - but that is another thing: https://git.libreoffice.org/core/+log/5751006d328844ba3fa6124ed263bbf122f0788a]
Comment 8 Xisco Faulí 2021-07-07 11:14:46 UTC
Hello CLA,
Could you please try to reproduce it with a master build from http://dev-builds.libreoffice.org/daily/master/ ?
You can install it alongside the standard version.
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the master build
Comment 9 QA Administrators 2022-01-04 03:31:46 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2022-02-04 03:44:47 UTC
Dear CLA,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp