Bug 42371 - FILEOPEN: Cannot open, crash with attached file
Summary: FILEOPEN: Cannot open, crash with attached file
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.4.3 release
Hardware: All All
: medium major
Assignee: Not Assigned
Depends on:
Reported: 2011-10-29 07:30 UTC by Alessandro Ceschini
Modified: 2014-10-01 17:39 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

With this my Writer freezes (1.57 MB, application/msword)
2011-10-29 12:10 UTC, Alessandro Ceschini
bt on master (11.72 KB, text/plain)
2012-10-16 20:14 UTC, Julien Nabet
valgrind part (2.86 KB, text/plain)
2012-10-16 21:40 UTC, Julien Nabet
2 naive alternatives patches to avoid crash (1.26 KB, application/x-zip-compressed)
2012-10-16 21:53 UTC, Julien Nabet
Some bts at random (11.36 KB, application/zip)
2012-10-16 22:07 UTC, Julien Nabet
bt + console logs on master (17.85 KB, text/plain)
2013-01-12 07:35 UTC, Julien Nabet

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Ceschini 2011-10-29 07:30:00 UTC
Writer freezes when trying to open big doc files, bigger than 1 Mb.
Comment 1 Alessandro Ceschini 2011-10-29 07:56:41 UTC
Operative system: Ubuntu 11.10
Comment 2 Alessandro Ceschini 2011-10-29 07:58:23 UTC
When I was still using Ubuntu 11.04, the version of Libre Office bundled with it (I don't know the number), DID open such files.
Comment 3 Korrawit Pruegsanusak 2011-10-29 08:50:31 UTC
Could you please attach the file you encountered the problem? Also remove private information before posting here. Thanks.
Comment 4 Alessandro Ceschini 2011-10-29 09:05:13 UTC
That would be a problem. I've got plenty of "files I encountered the problem". Problem is, everyone of them is actually a piece of "private information", typeset books. How can I do to help you?
Comment 5 Korrawit Pruegsanusak 2011-10-29 10:16:46 UTC
[NOT REPRODUCIBLE] I've tested with Ubuntu 11.10 LibreOffice 3.4.3 and my own .doc file 1.28 MB and it works fine, no freeze.

Maybe could you test by filling with some random content, for example from http://www.lipsum.com/ please?
Comment 6 Alessandro Ceschini 2011-10-29 12:10:21 UTC
Created attachment 52901 [details]
With this my Writer freezes

No way to reproduce the bug with Lorem Ipsum. This is one of the original files.
Comment 7 Korrawit Pruegsanusak 2011-10-30 11:31:05 UTC
[REPRODUCIBLE] LibreOffice 3.4.3 on Windows 7.

What I observed:
1. Opening the file from the start center causes the status bar loading with "importing document" (expected)
2. Step 1 takes about 1 minute
3. After status bar was fully-loaded, LibreOffice freezed for a few seconds, and the document didn't appear. Start center was appearing again like nothing happened, and can be clicked, not freeze. (not expected)
4. Try to create new document from start center, it worked fine, like steps 1-3 was not happened before.
5. But the problematic document was locked with the .~lock.2.doc# hidden file.

Alessandro, how this file was created? Is it created by LibreOffice or Word or ...? and which version? on which OS?

I'll test again on Ubuntu, if no one beats me :)
Thanks very much.

P.S. I forgot to give credits to cheche on #libreoffice irc for following suggestion. Thanks cheche again :D
(In reply to comment #5)
> Maybe could you test by filling with some random content, for example from
> http://www.lipsum.com/ please?
Comment 8 Korrawit Pruegsanusak 2011-10-30 11:38:17 UTC
Oh, I forgot again to say that:

In step 1, I dragged the file into LibreOffice

6. Closing LibreOffice (File > Exit) didn't delete the locking hidden file in 
step 5.
7. Open the file again with "Open" button on start center => crash! but opening by dragging => didn't crash
8. I've tested with Word 2007 on Windows 7 and the attached file opened well.
Comment 9 Alessandro Ceschini 2011-10-30 11:43:00 UTC
It was created in Windows XP with Word 2003.
Comment 10 Alessandro Ceschini 2011-11-02 12:27:44 UTC
On my system, it crashes both ways, direct opening and drag-and-drop.
Comment 11 Korrawit Pruegsanusak 2011-11-05 08:20:39 UTC
[REPRODUCIBLE] LibreOffice 3.4.3 Ubuntu 11.10
File > Open the attached document in comment 6 and see LibreOffice crash. Also crash when drag-and-drop, both after it's fully loaded (seeing from status bar).

Since it's a crash -> set severity to major
Cedric, feel free to reassign to the list if you want more information, or if it isn't your area. Please set status to ASSIGNED when you accept this bug. Thanks.
Comment 12 August Sodora 2011-11-23 18:19:28 UTC
NOT reproduced on master with
Comment 13 Björn Michaelsen 2011-12-23 13:25:35 UTC
Since all new unconfirmed bugs start in state UNCONFIRMED now and old unconfirmed bugs were moved to NEEDINFO with a explanatory comment, all bugs promoted above those bug states to NEW and later are automatically confirmed making the CONFIRMED whiteboard status redundant. Thus it will be removed.
Comment 14 bfoman (inactive) 2012-06-05 06:07:03 UTC
Checked with:
Build ID: own W7 debug build
Windows 7 Professional SP1 64 bit

Could not reproduce.
There is a few secs freeze only before displaying the file. No crash.
Comment 15 Julien Nabet 2012-10-16 20:14:56 UTC
Created attachment 68646 [details]
bt on master

On pc Debian x86-64 with master sources updated today (and a brand new LO profile), I had a crash.

I attached bt.

I also noticed this specific log:
warn:legacy.osl:21382:1:/home/julien/compile-libreoffice/libo/sot/source/sdstor/stgdir.cxx:419: Trying to resize readonly stream by seeking, could be a wrong offset!
Comment 16 Julien Nabet 2012-10-16 21:40:25 UTC
Created attachment 68648 [details]
valgrind part

I didn't succeed to have the whole trace of Valgrind (although I waited for at least 15 minutes)
I retrieved an interesting part of Valgrind anyway.
Comment 17 Julien Nabet 2012-10-16 21:53:56 UTC
Created attachment 68650 [details]
2 naive alternatives patches to avoid crash

Following the part of Valgrind trace, I attached 2 naive alternatives patches.

1) I push_back the value in the vector, then sort it
2) I took example of sc/source/ui/dbgui/csvsplits.cxx, bool ScCsvSplits::Insert( sal_Int32 nPos ) function. Searching lower bound, test the value found, etc...

I prefer 1) but it would be nice to do the sort once.
Comment 18 Julien Nabet 2012-10-16 22:07:57 UTC
Created attachment 68651 [details]
Some bts at random

I retrieved some bt at random (after having applied patch1 from my previous comment). Just some seconds after the last bt, the doc was fully opened.

Hope it helps.
Comment 19 Julien Nabet 2012-10-30 21:07:52 UTC
Cedric: one for you? (sorry I had forgotten to put a core dev on cc)
Comment 20 Alessandro Ceschini 2012-12-11 17:37:24 UTC
(In reply to comment #18)
> Created attachment 68651 [details]
> Some bts at random
> I retrieved some bt at random (after having applied patch1 from my previous
> comment). Just some seconds after the last bt, the doc was fully opened.
> Hope it helps.

I confirm. On Ubuntu 12.10 with LibreOffice, everything works fine. The administrators can consider the matter as settled. Thanks everybody.
Comment 21 Julien Nabet 2013-01-12 07:35:48 UTC
Created attachment 72890 [details]
bt + console logs on master

On pc Debian x86-64 with master sources updated yesterday (commit ac56d9373a66378a04048993ed5aec65cf39f149), I had a crash.
I attached bt + console logs.

Thinking there could be a link with the freezes, I preferred attaching it on this bug tracker. Now, I could create a new tracker if necessary.
Comment 22 Julien Nabet 2013-01-12 07:46:45 UTC
Comment on attachment 68651 [details]
Some bts at random

Fix mimetype
Comment 23 Julien Nabet 2013-01-12 07:49:22 UTC
I reproduced the same with 4.0 sources updated yesterday.

Quite weirdly, I reproduced the same with 3.6 sources but had the crash only on gdb!

On 3.6, I've got this specific log repeated a lot:
warn:legacy.osl:8597:1:/home/julien/compile-libreoffice/libo_3_6/sw/source/core/txtnode/ndhints.cxx:339: HintsCheck: Portion inconsistency. This can be temporarily ok during undo operations

Michael/Cedric: would one of you have some time to take a look?
Comment 24 Cédric Bosdonnat 2014-01-20 08:57:13 UTC
Restricted my LibreOffice hacking area
Comment 25 Julien Nabet 2014-03-22 00:19:05 UTC
To give an update, I can reproduce this with master sources updated today.

Just wonder if we could replace the std::vector by std::set since it seems there can be lots of insert or remove and we have to keep the container sorted.
Comment 26 Caolán McNamara 2014-09-30 19:56:31 UTC
caolanm->julien: Could you give this another test with master. I loaded it, and it was pretty slow to load on a full dbgutil debugging writer, but it did load for me without a crash.
Comment 27 Jean-Baptiste Faure 2014-10-01 07:35:41 UTC
No problem for me to load this file with master updated yesterday evening
(Version: Build ID: 9bb04da4bb18342a107bb843d8054e178d97ae28) built at home under Ubuntu 14.04 x86-64

Same test without problem with 
Version: Build ID: a7f7b93299a9a7af8b243099f78f236172c4cb51
Version: Build ID: 50eac342603ca08d808f53dc9a32bb9d1dfba372

Best regards. JBF
Comment 28 Julien Nabet 2014-10-01 17:39:05 UTC
julien->caolanm: thank you for pinging, indeed with LO Debian package and with master sources updated today, I don't reproduce this.
With the Jean-Baptiste's confirmation too, let's put this one to RESOLVED/WFM.