Bug 46310 - FILEOPEN: Annoying "Should LibO repair file?" - "File could not be repaired" dialog window loop
Summary: FILEOPEN: Annoying "Should LibO repair file?" - "File could not be repaired" ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.5 release
Hardware: All All
: medium normal
Assignee: Maxim Monastirsky
URL:
Whiteboard: BSA target:4.3.0
Keywords:
: 53139 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-19 17:39 UTC by ajaxfiore
Modified: 2014-05-01 18:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the first dialog box. (28.16 KB, image/png)
2012-02-19 17:39 UTC, ajaxfiore
Details
First dialog box (14.80 KB, image/png)
2012-09-21 13:50 UTC, ajaxfiore
Details
Second dialog box (5.38 KB, image/png)
2012-09-21 13:51 UTC, ajaxfiore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ajaxfiore 2012-02-19 17:39:48 UTC
Created attachment 57291 [details]
Screenshot of the first dialog box.

Problem description: 
I tried opening a corrupt .doc file. Libreoffice tells me "The file '***.doc' is corrupt and therefore cannot be opened. Libreoffice can try to repair the file... Should Libreoffice repair the file?" Then I click no, and I get a dialog box saying "The file could not be repaired and therefore cannot be opened." Then I click ok and it sends me back to the first dialog box. Then I click no, and it keeps going over and over again.

Steps to reproduce:
1. ....Try opening corrupt .doc file.
2. ....Click no on the dialog box.
3. ....Click ok on the next dialog box.
4. ....Repeat steps 2-3.

Current behavior: The dialog boxes keep popping up over and over again.

Expected behavior: It should stop displaying dialog boxes, after I click ok on the second one.

Platform (if different from the browser): Ubuntu 11.10 
              
Browser: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11
Comment 1 sasha.libreoffice 2012-05-22 07:31:08 UTC
Thanks for bugreport
Please, verify if in last version of LibreOffice still reproducible
Comment 2 Roman Eisele 2012-05-30 03:13:46 UTC
@ajaxfiore:

-- Could you please try, as Sasha already wrote (comment #1), if this problem is still present in the current version of LibreOffice?

-- If the problem is still present (or if you can't do the test yourself for some reason): Could you please attach the corrupt .doc file to this bug report? Then we could test if the issue is reproducible.

Thank you very much!


(Changed Status to NEEDINFO according to comment #1.
Change Platform according to original description.)
Comment 3 ajaxfiore 2012-09-21 03:52:09 UTC
Unfortunately, I do not have access to the file anymore.
I have spent a good few minutes looking for corrupt .doc files online, but none of the files I downloaded produced the error: "The file '***.doc'
is corrupt and therefore cannot be opened. Libreoffice can try to repair the
file..."
Comment 4 Roman Eisele 2012-09-21 06:05:23 UTC
Thank you very much for trying again and for getting back to us!

Well, if the main point of this report is not the particular corrupted .doc file, but the strange dialog window loop:

> Steps to reproduce:
> 1. ....Try opening corrupt .doc file.
> 2. ....Click no on the dialog box.
> 3. ....Click ok on the next dialog box.
> 4. ....Repeat steps 2-3.
> 
> Current behavior: The dialog boxes keep popping up over and over again.
> Expected behavior: It should stop displaying dialog boxes, after I click ok on
> the second one.

I think we can easily create a test case: just take an arbitrary .docx (!) file, change its suffix to “.doc” (!), and then try to open that file with LibreOffice. At least on Mac OS X LibreOffice will show now exactly the strange behaviour you describe.

Can you reproduce this (just by renaming any .docx file)? Then this would be a sufficient test case, and we just need to adapt the summary of this bug report to make clear the main point (i.e., the dialog loop).

(NB: For the problem that LibreOffice does not recognize .docs files if their suffix is changed to “.doc”, and does not even try to repair them, there is a special bug report: bug 54949. So we should concentrate on the strange dialog loop in the present bug report.)
Comment 5 ajaxfiore 2012-09-21 13:50:50 UTC
Created attachment 67510 [details]
First dialog box
Comment 6 ajaxfiore 2012-09-21 13:51:17 UTC
Created attachment 67511 [details]
Second dialog box
Comment 7 ajaxfiore 2012-09-21 13:53:43 UTC
> Can you reproduce this (just by renaming any .docx file)? Then this would be a
> sufficient test case, and we just need to adapt the summary of this bug report
> to make clear the main point (i.e., the dialog loop).

I was able to reproduce the loop by following your instructions.

I tried it on LibreOffice 3.6.1.2 Writer running on Fedora 17 LXDE x86_64.

I have added the screen shots of both dialog boxes.
Comment 8 Roman Eisele 2012-09-21 14:32:52 UTC
(In reply to comment #7)
> I was able to reproduce the loop by following your instructions.
> I tried it on LibreOffice 3.6.1.2 Writer running on Fedora 17 LXDE x86_64.
Thank you! So this is a real cross-platform bug.

> I have added the screen shots of both dialog boxes.
This is good, too!

I have adapted the summary to emphasize the dialog window loop.
Comment 9 ajaxfiore 2012-09-21 19:41:28 UTC
I also tried opening a corrupt .ppt file and a corrupt .xls file with Impress and Calc respectively.

Impress exhibited the same behaviour, i.e. it entered a loop.

However, Calc behaved as expected. After I clicked "Ok" on the second dialog box ("The file 'testbook.xls' could not be repaired and therefore cannot be opened"), Calc shows me a third dialog box, and upon clicking "Ok" on it, it closes.
Comment 10 Adrian Hesketh 2013-03-04 10:36:41 UTC
I've also found this defect in LibreOffice 4.0.0.3 on Windows 8.

FILEOPEN - Opening a "corrupt" file and then selecting "No" to the repair dialog results in an infinite loop unless you accept that LibreOffice should repair the file.

Reproduction
============

1. Create a Word 2007 file, e.g. MyFile.docx
2. Rename it to MyFile.doc
3. Open it using LibreOffice from Windows Explorer (in my case by double-clicking on the file).
4. A dialog is displayed with text "The file 'MyFile.doc' is corrupt and therefore cannot be opened.  LibreOffice can try to repair the file."
4a. The final sentence states "Should LibreOffice attempt to repair the file?"
4b. Options are "Yes" and "No".
5. Clicking the "No" button displays dialog "The file 'thebigword.doc' could not be repaired and therefore cannot be opened." with an "OK" button.
6. Clicking the OK button results in the dialog at step 4.

This means that the user is presented with the same option until the user terminates LibreOffice using Task Manager or chooses to repair the file.

The desired behaviour should be that selecting "OK" from the dialog at step 5 should exit the program.
Comment 11 Maxim Monastirsky 2013-09-21 20:36:30 UTC
*** Bug 53139 has been marked as a duplicate of this bug. ***
Comment 12 retired 2013-09-22 08:39:58 UTC
This is a super annoying bug and I ran into it several times. But I think this has not yet happened with any 4.1.x release.

Could you please check if 4.1.x solves this problem for you? http://www.libreoffice.org/download/

If not please reset this bug to "NEW". Otherwise please mark as worksforme.
Comment 13 Maxim Monastirsky 2013-11-12 15:58:27 UTC
(In reply to comment #12)
> But I think this has not yet happened with any 4.1.x release.
See Bug 53139 for confirmation with 4.1
Comment 14 ajaxfiore 2013-11-14 01:43:18 UTC
(In reply to comment #12)
> Could you please check if 4.1.x solves this problem for you?

I have confirmed that this bug is present Libreoffice 4.1.2.3 running on Windows 8.1. The loop, however, is no longer an infinite one and exits after the third cycle generating a "General Error".
Comment 15 Maxim Monastirsky 2014-05-01 18:32:51 UTC
This was fixed on master with http://cgit.freedesktop.org/libreoffice/core/commit/?id=f82f7bf3dd5053049259f6933d1335f6c9e314dd.