Bug 84834 - .log files with certain size are causing writer to stop responding (std::bad_alloc)
Summary: .log files with certain size are causing writer to stop responding (std::bad_...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium normal
Assignee: Michael Stahl
URL:
Whiteboard: target:5.3.0 target:5.2.0.2
Keywords: bibisected, regression
Depends on:
Blocks:
 
Reported: 2014-10-09 09:45 UTC by Joren Verheyen
Modified: 2016-10-25 18:54 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
An example .log file that causes my writes to become unresponsive (20.41 KB, text/plain)
2014-10-09 09:45 UTC, Joren Verheyen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joren Verheyen 2014-10-09 09:45:32 UTC
Created attachment 107605 [details]
An example .log file that causes my writes to become unresponsive

Problem description: 

I have an application which creates .log files. These files only contain some text so nothing special. Opening them with textedit, notepad or Word is not an issue. It works fine.

When I try to open them with libreoffice writer (V4.3.2.2) and they seems to have a certain size, it first ask in a window "import Dbase files" and which character set to use. After choosing the character set my libreoffice becomes not responding anymore and I need to force quit it.

In libreoffice version 4.2.0.4 the same thing happens only I get an error message:
Libreoffice 4.2 -Fatal error
std::bad_alloc

With smaller .log files which contain only few lines of text it works fine in writer.

I have added an example .log file which causes a crash on my system: it contains 319 lines and has a size of  21kb
Comment 1 Jacques Guilleron 2014-10-09 14:04:32 UTC
Hi Joren,

Thanks to report this.
I see the same behaviour (Fatal error, Bad allocation) with LO 4.3.2.2 and Windows 7 Home Prmeium. If I change file extension to .txt, there's no issue to open it.
So I set Status to NEW and Hardware to All.

Regards,

Jacques
Comment 2 QA Administrators 2015-10-14 19:57:25 UTC Comment hidden (obsolete)
Comment 3 MM 2015-11-22 19:23:30 UTC
Unconfirmed with v3.3.4 under windows 7 x64.
Confirmed with v5.0.3.2 under mint 17.2 x64.
Comment 4 Michael Stahl 2016-06-24 16:55:37 UTC
there's a single memory allocation of > 3gb in FResultSet.cxx:1289, that will never succeed on 32-bit.

but the real problem is that the type detection thinks that this is a DBase file, when it's clearly not.

can repro that in 4.1.0.4 already

bibisect range:
ee53857e984fea54b7dc08b99079b38766f0b796 153621f98ee98e4eacaebcf7d62f74d54755cab6

well that contains a lot of typedetection refactoring...

fixed on master
Comment 5 Commit Notification 2016-06-24 16:56:56 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#84834 sc: stricter type detection for dBASE files

It will be available in 5.3.0.

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 6 Commit Notification 2016-06-26 20:12:25 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eb7364fffe39c1aecddcab6b9cf238475fa2013c&h=libreoffice-5-2

tdf#84834 sc: stricter type detection for dBASE files

It will be available in 5.2.0.2.

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.