Bug 118073 - LibreOffice Basic freezes when line ends with "0."
Summary: LibreOffice Basic freezes when line ends with "0."
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.3 all versions
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:6.2.0 target:6.1.0.1 target:6.0.5
Keywords: bibisected, bisected, perf, regression
Depends on:
Blocks:
 
Reported: 2018-06-08 17:53 UTC by JB
Modified: 2018-08-24 23:46 UTC (History)
6 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 JB 2018-06-08 17:53:34 UTC
Description:
LibreOffice Basic cannot handle a line ending with "0.".

If you enter this text in the editor, it will freeze as soon as it has to parse the text you have entered (e.g. if you try to run the macro, or save the file).

Pre-existing documents that have macros like this will free LibreOffice when you attempt to "Organize Macros", when it parses the text to extract runable Sub names, or when you try to save the file. This means it isn't the editor, specifically, that has the problem, but the parsing of the code.

Note that "1." is fine, "0" is fine, "0.1" is fine. It is specifically "0." that causes the problem. Appending a comment, like "0.'comment" does cause the freeze.

Steps to Reproduce:
1. Start new LibreOffice Calc document
2. Create a new LibreOffice Basic macro (Tools/Macros/Organize Macros/LibreOffice Basic, select the document (eg "Untitled1") in the tree, click New to create a module, accept the default "Module1" name. Editor opens.
3. Under "Sub Main", type "a = 0."
4. Click the "run" button (or, I think, any other way to attempt to run the macro).

Actual Results:  
LibreOffice freezes, using a full cpu core. Never recovers and must be killed.

Expected Results:
Macro runs and LibreOffice continues to exist.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Comment 1 MM 2018-06-08 19:19:18 UTC
Confirmed on windows 7 x64 with Version: 6.0.5.1 (x64)
Build ID: 0588a1cb9a40c4a6a029e1d442a2b9767d612751
CPU threads: 3; OS: Windows 6.1; UI render: default

With both 'compile' and 'run', LO will hang.
Comment 2 Xisco Faulí 2018-06-11 10:18:51 UTC
Regression introduced by:

author	Eike Rathke <erack@redhat.com>	2016-06-27 21:54:59 +0200
committer	Eike Rathke <erack@redhat.com>	2016-06-27 21:57:52 +0200
commit 9a6527a98fb968b3fe6bc293ff7520a9480d43d0 (patch)
tree 69e8bc1768eca1dcd4fcf783f799e122a2e47a54
parent 1511f5c399182c003c19cc18b316f2fdaac0501d (diff)
stringToDouble() do not parse separator without digit as 0.0
Occurred in CSV import without "detect special numbers" activated for data like
,.,
where the . dot resulted in a numeric cell value 0

Bisected with: bibisect-linux-64-5.3

Adding Cc: to Eike Rathke
Comment 3 Commit Notification 2018-06-18 14:53:27 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5c0783cecb0b141885a25ca26220614ad3125f8e

Resolves: tdf#118073 one leading 0 is significant for 0.

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Eike Rathke 2018-06-18 15:10:55 UTC
Pending review
https://gerrit.libreoffice.org/56043 for 6-1
https://gerrit.libreoffice.org/56044 for 6-0
https://gerrit.libreoffice.org/56047 for 6-0-5 (if it isn't too late)
Comment 5 Commit Notification 2018-06-18 15:13:00 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c8835f2f037c056d735d33e67a4025a02afa4d3d

Related: tdf#118073 SbiScanner::NextSym: no symbol is no symbol

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2018-06-18 16:57:59 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=98bcbd756bb7222578f1e5f12bb3759337a15c0b&h=libreoffice-6-0

Resolves: tdf#118073 one leading 0 is significant for 0.

It will be available in 6.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2018-06-18 21:17:44 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d0d0beb5f515ca6f6b777e0e64575e4e7f4626dc&h=libreoffice-6-1

Resolves: tdf#118073 one leading 0 is significant for 0.

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Xisco Faulí 2018-06-19 18:19:25 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: b11c914741dcbf11ad1df72f861c030a584978bc
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

@Eike, Thanks for fixing this!!
Comment 9 Commit Notification 2018-06-19 20:40:53 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-0-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d239717f91dd99c73e71f4e312092ecb4bc9d82c&h=libreoffice-6-0-5

Resolves: tdf#118073 one leading 0 is significant for 0.

It will be available in 6.0.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Alex 2018-08-24 23:46:37 UTC
The bug still exist in version 6.0.32, build 1:6.0.3-0ubuntu1. Any script on Basic which contains "0." will hang the LibreOffice on copilation.