Bug 73936 - FILEOPEN: Can't open .doc file: Writer freezes
Summary: FILEOPEN: Can't open .doc file: Writer freezes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: Other All
: highest normal
Assignee: Caolán McNamara
URL:
Whiteboard: BSA Confirmed:4.2.0.3:OSX target:4.3.0
Keywords:
: 73616 73937 (view as bug list)
Depends on:
Blocks: mab4.1
  Show dependency treegraph
 
Reported: 2014-01-22 17:06 UTC by Mohamed-Ali BEN MANSOUR
Modified: 2015-01-27 21:49 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Doc file causing Writer freeze (364.00 KB, application/msword)
2014-01-22 17:06 UTC, Mohamed-Ali BEN MANSOUR
Details
Simplified version of the test document (25.50 KB, application/msword)
2014-01-22 21:07 UTC, Laurent Balland
Details
List field causing the freeze (26.00 KB, application/msword)
2014-01-23 15:44 UTC, Mohamed-Ali BEN MANSOUR
Details
Text field for a successful opening (26.00 KB, application/msword)
2014-01-23 15:46 UTC, Mohamed-Ali BEN MANSOUR
Details
Freeze backtrace (7.15 KB, text/plain)
2014-02-17 21:57 UTC, Arnaud Versini
Details
rework the dropdown portion to be a fldportion (11.79 KB, patch)
2014-03-26 17:10 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mohamed-Ali BEN MANSOUR 2014-01-22 17:06:36 UTC
Created attachment 92595 [details]
Doc file causing Writer freeze

Problem description: 
Writer freezes or loop in .doc file trying unsucsessfully to import it.

Steps to reproduce:
1. ....
2. ....
3. ....

Current behavior:

Expected behavior:

              
Operating System: All
Version: 4.1.4.2 release
Comment 1 Mohamed-Ali BEN MANSOUR 2014-01-22 17:11:11 UTC
The same file can be opened with Apache OpenOffice 4.0.1
Comment 2 Laurent Balland 2014-01-22 20:16:15 UTC
Hi,

Reproduced with:
- LibO 3.3.0.4 : les 2 fichiers gèlent
- LibO 3.5.7.2 : les 2 fichiers gèlent
- LibO 4.1.4.2 : les 2 fichiers gèlent
- LibO 4.2.0.2
- LibO Version: 4.3.0.0.alpha0+ Build ID: 99159a618fd1ea90a2bc8a72621c88a4cf26e6f5 TinderBox: Win-x86@47-TDF, Branch:MASTER, Time: 2014-01-17_06:46:31

NOT reproduced with:
- OOo 3.3.0m20
- AOO 3.4.0
- AOO 4.0.1

The bug was introduced at the beginning of LibO
Comment 3 Laurent Balland 2014-01-22 21:01:39 UTC
*** Bug 73937 has been marked as a duplicate of this bug. ***
Comment 4 Laurent Balland 2014-01-22 21:07:31 UTC
Created attachment 92621 [details]
Simplified version of the test document

The non-breaking space just after a long field seems to be responsible of the freeze. Just remove it and LibO could open the document.
Comment 5 Laurent Balland 2014-01-22 21:28:39 UTC
Sorry, I made a mistake with attachment 92621 [details]. There is no freeze with it. Note that the field appears in the margin and is ending outside the page.

BUT, if you insert a non-breaking space just BEFORE the last point (so just after the field), then LibO freezes.
Comment 6 vulcain 2014-01-22 22:48:00 UTC
I confirm freeze with the first attachement on Ubuntu 12.04.4 x86_64 with LibreOffice  4.2.0.2 Build ID: 601a398b803303d1a40a3299729531824fe0db56
Comment 7 Mohamed-Ali BEN MANSOUR 2014-01-23 15:39:35 UTC
Thanks you Laurent !It's really a matter of non breaking space after a field.

Allow me to add some details:
- The issue appears when we have a list field. (it works fine with a text field).
- The freeze occurs when the list field comes after a line break and followed by a non breaking space.
- Even if the we have a short list field, the bug is there with the above conditions.
Comment 8 Mohamed-Ali BEN MANSOUR 2014-01-23 15:40:29 UTC
Thanks you Laurent !It's really a matter of non breaking space after a field.

Allow me to add some details:
- The issue appears when we have a list field. (it works fine with a text field).
- The freeze occurs when the list field comes after a line break and followed by a non breaking space.
- Even if the we have a short list field, the bug is there with the above conditions.
Comment 9 Mohamed-Ali BEN MANSOUR 2014-01-23 15:44:07 UTC
Created attachment 92676 [details]
List field causing the freeze

List field followed by a non breaking space causing the freeze.
Comment 10 Mohamed-Ali BEN MANSOUR 2014-01-23 15:46:57 UTC
Created attachment 92677 [details]
Text field for a successful opening

Text field followed by a non breaking space works fine
Comment 11 retired 2014-01-27 10:40:20 UTC
Confirmed:4.2.0.3:OSX

Open test file > crash
Comment 12 Mohamed-Ali BEN MANSOUR 2014-02-11 16:43:32 UTC
I've debugged the freeze behaviour. Here is what i found:

 Actually, when trying to import "List field causing the freeze" document (and all similar documents), we have a loop when calling:
Window::Show( bool bVisible, sal_uInt16 nFlags ) implemented in vcl/source/window/window.cxx.

Anyone has any idea to fix this bug that appears in all LibreOffice versions ?
Comment 13 Mohamed-Ali BEN MANSOUR 2014-02-12 16:06:41 UTC
*** Bug 73616 has been marked as a duplicate of this bug. ***
Comment 14 Stéphane Guillou (stragu) 2014-02-12 23:17:19 UTC
Adding to 4.1 MAB as duplicate Bug 73616 was in 4.1 MAB before being declared a duplicate.
Comment 15 Arnaud Versini 2014-02-17 21:24:04 UTC
@Mohamed, @Laurent do you have a backtrace of the freeze ?
Comment 16 Arnaud Versini 2014-02-17 21:57:07 UTC
Created attachment 94243 [details]
Freeze backtrace
Comment 17 Arnaud Versini 2014-02-17 22:01:38 UTC
Seems for me that it is a layout freeze.
Comment 18 Norbert Thiebaud 2014-02-19 12:10:44 UTC
it loops in SwTxtFormatter::FormatLine

could it be that a nb-space space is taken into account _before_ realizing that the previous character is a new-line hence the non-breaking space should not tie it to the previous thing ?

iow something like: \n so that is the end of the line.. but nb-space so we want to keep it and the field after it.. but that is too long so let's try to break it again... oh there is a \n let's break, but there is a nb-space... etc... (just a guess)
Comment 19 Arnaud Versini 2014-02-23 19:02:57 UTC
I tested with a one week master and it seems to not freeze, but need to be checked, not sure why, (perhaps --enable-debug or something like that)
Comment 20 Jorendc 2014-02-23 19:10:48 UTC
(In reply to comment #19)
> I tested with a one week master and it seems to not freeze, but need to be
> checked, not sure why, (perhaps --enable-debug or something like that)

Still reproducible with a non-debug build (675ff51f2e0e1bf0d9f689382162a3e62e0f0f48) on Mac OSX 10.9

Kind regards,
Joren
Comment 21 Joel Madero 2014-02-27 03:05:54 UTC
*** Bug 75548 has been marked as a duplicate of this bug. ***
Comment 22 Björn Michaelsen 2014-03-16 01:12:33 UTC
Fix priority for MABs.
Comment 23 Caolán McNamara 2014-03-26 11:45:59 UTC
If enhanced fields is disabled in ww8par5.cxx in Read_F_FormListBox then it layouts out ok
Comment 24 Mohamed-Ali BEN MANSOUR 2014-03-26 15:45:19 UTC
Caolán is right. That works fine for me with this patch (as a draft):
https://gerrit.libreoffice.org/#/c/8761/

=> Fixed
Comment 25 Mohamed-Ali BEN MANSOUR 2014-03-26 16:38:02 UTC
Tested correctly in LO 4.1.4.2 (Actually Read_F_FormListBox is in ww8par3.cxx)
Comment 26 Caolán McNamara 2014-03-26 17:09:45 UTC
hang on a sec, lets try something else
Comment 27 Caolán McNamara 2014-03-26 17:10:53 UTC
Created attachment 96422 [details]
rework the dropdown portion to be a fldportion

my first cut at this also works and keeps the dropdown list thingy the same as the old one did
Comment 28 Caolán McNamara 2014-03-27 20:56:43 UTC
With these enhanced fields dropdowns examining how they appear in the spellchecking dialog shows up a whole extra can of worms.
Comment 29 Commit Notification 2014-03-28 08:59:49 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: fdo#73936 make FormFieldDropDowns a real fieldportion



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 30 Commit Notification 2014-03-28 09:00:02 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: fdo#73936 detect dropdown form fields as fields for spellchecking



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 31 Commit Notification 2014-03-28 09:00:16 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: fdo#73936 expand FormFieldDropDowns in ModelToViewHelper



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 32 Commit Notification 2014-03-28 09:00:31 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: fdo#73936 allow ModelToViewHelper to not expand footnotes..



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 33 Commit Notification 2014-03-28 09:00:45 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: fdo#73936 use ModelToViewHelper to expand SwTxtNodes



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 34 Commit Notification 2014-03-28 09:01:05 UTC
Caolan McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: fdo#73936 for spelling restrict formelements-as-fields..



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 35 Mohamed-Ali BEN MANSOUR 2014-03-28 09:07:23 UTC
Thank you Caolán for the patch. That solves a lot of problems !
Comment 36 Caolán McNamara 2014-03-28 09:20:14 UTC
I'm not particularly happy about these enhanced fields which seem a little unfinished, but the major issue of hanging is resolved by the first commit so I'll call this tentatively fixed.
Comment 37 Jean-Baptiste Faure 2014-05-06 19:17:35 UTC
I do not reproduce the freeze with LO 4.2.5.0.0+ under Ubuntu 14.04 x86-64 but the commits fixing the problem are for the master. Did these commits have been backported to 4.2 branch ?

Best regards. JBF