Bug 83801 - Librelogo consumes all memory and crashes Writer
Summary: Librelogo consumes all memory and crashes Writer
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.0.alpha0+ Master
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2014-09-12 14:15 UTC by Kevin Suo
Modified: 2017-04-26 09:40 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Windbg backtrace on Windows 7 (26.97 KB, text/plain)
2015-01-28 00:40 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2014-09-12 14:15:54 UTC
Steps to reproduce:

1. Open Writer, enable "View -> Toobars -> Logo";

2. Run the following LOGO command one by one (to run a LOGO command, paste the command in the LOGO command line box, then hit ENTER):

a) repeat 400 [ circle 10 + repcount/10 fd 5 + repcount/10 lt 10 ]
b) CLEARSCREEN
c) HOME
d) repeat 400 [ circle 10 + repcount/10 fd 5 + repcount/10 lt 10 ]

--> Writer crashes at step d.

Version: 4.3.2.1
Build ID: f9b3ad49d92181b0a1fe7e76f785a2c2cd0847d3
Windows 7 X86
Comment 1 Jacques Guilleron 2014-09-13 16:05:07 UTC
Hi Kevin,

I reproduce with LO 4.4.0.0.alpha0+
Build ID: 5aeb852efcabdd51545d5d41c92f4bf3cef1d663
TinderBox: Win-x86@39, Branch:master, Time: 2014-09-08_07:01:57
& Windows 7 Home Premium.
I tried with repeat 40 for the repetition; and with the first line as a procedure.
Without success.

Crash at the first line with LO 4.2.7.0.0+
Build ID: 92216be6ce13990b8ea6b6264c656d2bc1746401
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-07-14_16:21:42

Works with LO 4.2.1.1 Build ID: d7dbbd7842e6a58b0f521599204e827654e1fb8b

Regards,

Jacques
Comment 2 Robinson Tryon (qubit) 2014-09-23 05:47:45 UTC
(In reply to comment #1)
> Crash at the first line with LO 4.2.7.0.0+

Updating earliest version -> 4.3.0.0.0+ master (aka 4.2.7 master)
Comment 3 Ari Latvala 2014-10-25 08:37:54 UTC
Tried this on LibreLogo on LibreOffice Writer 4.3.2.2 for Windows 7 and after drawing quite a lot of stuff to the screen Writer crashed:

PENUP
REPEAT 100 [
    FILLCOLOR [ANY, ANY]
    CIRCLE 20 + RANDOM 130
    POSITION ANY
]
Comment 4 Ari Latvala 2014-10-25 08:59:04 UTC
Did some more testing. If I drop REPEAT to 45, it will work for a ca 2,5 times, before Writer crash. REPEAT 50 crashes Writer in the first try. REPEAT 40 lets me use this code several times, before crash.
Comment 5 Björn Michaelsen 2015-01-27 21:18:37 UTC
A backtrace for this issue would help esp. since its Windows only:
https://wiki.documentfoundation.org/Backtrace#Windows
Comment 6 László Németh 2015-01-28 00:39:08 UTC
After several program start, I have got the following crash0

STACK_TEXT:  
00f0e7cc 74009ef4 08b0c7c8 00000000 00007fff sal3!GetCaseCorrectPathName+0x93
00f0e808 73ff1b25 09760f88 00f0e82c 00000200 sal3!osl_getFileStatus+0x214
00f0e8ac 693794b4 03d6c0d0 49647867 00f0fb90 sal3!rtl_bootstrap_args_open+0xa5
00f0e8d8 69379d12 00f0e92c 00f0e900 00f0e8fc utllo!utl::Bootstrap::Impl::getBootstrapValue+0x44
00f0e910 73eace6f 00f0e92c 49649aaa 49649aae utllo!utl::Bootstrap::getProductKey+0x82
00f0e93c 73eb03d0 00f0fb64 740d9e0a 00f0fb90 sofficeapp!desktop::`anonymous namespace'::FatalError+0x2f
00f0fb9c 65f63c04 00000000 0000000a 65f63fb9 sofficeapp!desktop::Desktop::Main+0x10a0
00f0fba8 65f63fb9 00376148 00f0fc0c 73edfbaa vcllo!ImplSVMain+0x24
00f0fbb4 73edfbaa 49648f9a 012349db 73f17b68 vcllo!SVMain+0x29
00f0fc0c 003e101e 012349db 003e12af 003e0000 sofficeapp!soffice_main+0x9a
00f0fc14 003e12af 003e0000 00000000 012349db soffice!WinMain+0x1e
00f0fc60 7523338a 7efde000 00f0fcac 774a9f72 soffice!__tmainCRTStartup+0x122
00f0fc6c 774a9f72 7efde000 b81945e6 00000000 KERNEL32!BaseThreadInitThunk+0xe
00f0fcac 774a9f45 003e1183 7efde000 00000000 ntdll_77470000!__RtlUserThreadStart+0x70
00f0fcc4 00000000 003e1183 7efde000 00000000 ntdll_77470000!_RtlUserThreadStart+0x1b

The full backtrack is an attachment (Google has found a similar attached backtrace in this bug tracker, but without the bug number: https://vm150.documentfoundation.org/attachment.cgi?id=9106)
Comment 7 László Németh 2015-01-28 00:40:07 UTC
Created attachment 112845 [details]
Windbg backtrace on Windows 7
Comment 8 Michael Meeks 2015-07-03 15:53:23 UTC
Debugger trace is pretty useless =) I guess some exception is thrown and (during the catching of that and (hopefully) some helpful error output) - we manage to hork ourselves in the rtl_bootstrap_code.

As a paragon of efficiency - the code here is quite amazingly poor - each incremental circle appears to take ~300Kb of memory - which is ... frankly amazing. No idea what python and librelogo and (of course) the drawing-layer are managing to do between themselves to leak quite that much.

So - this is some OOM corner-case IMHO. I see no evidence that this is a regression - so dropping the keyword.
Comment 9 Kevin Suo 2016-01-24 05:37:12 UTC
With the most recent LibreOffice version 5.1.0.2, I no longer reproduce the crash, but only reproduce the memory leak.

Step to Reproduce:
1. Wrong the following LOGO command:
repeat 400 [ circle 10 + repcount/10 fd 5 + repcount/10 lt 10 ]

--> The LOGO drawing becomes slower and slower as time passes, and the memory usage is going up and up. This simple LOGO drawing does not crash but takes 5+ minutes to finish in my 10GB memory and 2.3GHz PC.

In windbg window I get many many "C++ EH exception - code e06d7363 (first chance)" (which is the same as the upper part of the backtrace as showing in comment 7.
Comment 10 QA Administrators 2017-03-06 14:07:35 UTC Comment hidden (obsolete)
Comment 11 Ari Latvala 2017-04-26 08:06:29 UTC
Tested on Windows 10 Creators update with LO 5.3.2. Does not crash any more but takes quite a lot of time and more than double if LO window is open. By dropping LO down to the taskbar cuts time to run script through roughly to half. Also noticed that speed differs during the execution. In the beginning fast but slows down, then may burst again just to slow down again.
Comment 12 Ari Latvala 2017-04-26 09:40:44 UTC
At some level there seems to be still problem. LO crashed while closing after I had been running different LibreLogo tests for quite some time. Did not save any of those created results but closed open doc for several times and also used CLEARSCREEN.