Issue 127561 - [MacOS] Application becomes unresponsive when long text (over 65535 chars) is entered in any text field
Summary: [MacOS] Application becomes unresponsive when long text (over 65535 chars) is...
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: 4.1.4
Hardware: Mac macOS 10.13
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2017-10-21 07:25 UTC by Ru Cindrea
Modified: 2017-10-21 08:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

MacOS problem report (978.97 KB, text/plain)
2017-10-21 07:25 UTC, Ru Cindrea
no flags Details
dialog box (35.25 KB, image/png)
2017-10-21 07:25 UTC, Ru Cindrea
no flags Details
document with 65536 characters (62.62 KB, application/vnd.oasis.opendocument.text)
2017-10-21 07:26 UTC, Ru Cindrea
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Ru Cindrea 2017-10-21 07:25:27 UTC
Created attachment 86223 [details]
MacOS problem report

Environment: MacOS only (this works fine on Win10 Pro) 
Mac OS X 10.13 (Build 17A405) - High Sierra, x86_64
OO Version: 4.1.4

Steps to reproduce:
1. Copy a large amount of text. Make sure the text has over 64435 characters. This should amount to a document with about 20 pages. (check attached Document65536Charachters.odt)

2. In any of the Open Office apps, find a text field that allows free text entry. For example, in Office Writer, go to View->Zoom and select the “Variable” text field under “Zoom factor”. 

3. Paste the text you copied at step 1. You will get a warning saying “The inserted text exceed the maximum length of this text field. The text was truncated”. (attached "DialogboxMaximumLimit.png").

4. Click OK.

Expected result: 

The pasted text is truncated to a much smaller length and can then be edited and corrected. This is the behavior for example on Windows 10, with the same version of OpenOffice.  

Actual result: 

On a Mac, the application becomes unresponsive. I have waited for a over 5 minutes for it to become responsive again, but without success. 

After I force quit the application, I get an Apple Problem report next time I open OpenOffice (attached). This might also potentially mean that some of the information and possible formatting I had on the document that I hadn’t saved might be lost. 

NOTE: Though this might seem like a corner case, it would be quite common to have this kind of large content in the clipboard after creating a new document from another one, by copying the first few chapters and pasting them into the new document. Pasting this kind of content in one of the text fields, like the Variable zoom, could potentially happen by mistake. I have a lot of content in my clipboard because I have just created the document by pasting data into it, and I want to zoom it to a level where I can see the entire document. I type “Cmd + V” thinking that I am pasting a previously used zoom value, but in reality I am pasting the content of the document.

Note also that 65535 is the value for max short int, and based on a few other bugs it seems to be the upper limit in OpenOffice in a few other cases:

#124205 - Help - About - License is cut at 65535 chars (even though the LICENSE file is complete) 

#87672 - autocorrect limit. acor.dat with entry 65535: Loop and/or loss of acor data  

#113658 - CSV Imports limits row to 65535 characters 

#17171 - Paragraph cannot be longer than 66534 characters 

For convenience, I’ve also attached an ODT document containing 65536 characters that can be used to copy and paste the right amount of characters to reproduce the problem.
Comment 1 Ru Cindrea 2017-10-21 07:25:57 UTC
Created attachment 86224 [details]
dialog box
Comment 2 Ru Cindrea 2017-10-21 07:26:28 UTC
Created attachment 86225 [details]
document with 65536 characters
Comment 3 Ru Cindrea 2017-10-21 07:28:25 UTC
NOTE also that 4.1.4 is now officially released, so it's not longer just in dev, but since there was no other option for version that reflects the 4.1.4, I chose 4.1.4_dev. 

This also reproduces with 4.1.3.