Bug 102846 - CSV import: very long loop in preview's field detection
Summary: CSV import: very long loop in preview's field detection
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.1.2 release
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.3.0 target:7.2.1
Keywords:
: 93334 141505 (view as bug list)
Depends on:
Blocks: CSV-Import
  Show dependency treegraph
 
Reported: 2016-09-30 06:36 UTC by psockeel
Modified: 2021-08-29 21:12 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
KB3194496 description file (3.44 MB, text/plain)
2016-09-30 06:36 UTC, psockeel
Details
Settings used for Import (48.70 KB, image/png)
2017-04-06 08:17 UTC, thomas.beck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description psockeel 2016-09-30 06:36:14 UTC
Created attachment 127732 [details]
KB3194496 description file

In Calc v5.2.1.2 (x64), there is an infinite loop while opening a CSV file coming from Microsoft: http://download.microsoft.com/download/C/F/D/CFD1B7FD-C077-4BF8-AEA6-C048E7928870/3194496.csv.
Comment 1 Xisco Faulí 2016-10-01 00:49:14 UTC
I can't reproduce it in

Version: 5.3.0.0.alpha0+
Build ID: 33a2e47c907f7e2c1995b4a1e910dec94c3cedb4
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 2 Urmas 2016-10-01 12:33:09 UTC
Confirmed in 5.3 in Windows.

The file is not a proper CSV as it has several parts and plain text.
Comment 3 thomas.beck 2017-04-06 08:17:26 UTC
Created attachment 132364 [details]
Settings used for Import

Can't reproduce in

Version: 5.4.0.0.alpha0+
Build ID: 60a65d25695ee2e8ea9f2b1fb3e91a8257cd016e
CPU threads: 8; OS: Windows 6.1; UI render: default; 
Locale: de-DE (de_DE); Calc: CL

I used the settings shown in the attached screenshot and the file opened successfully.
Comment 4 QA Administrators 2018-07-21 02:40:51 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2020-07-21 03:47:16 UTC Comment hidden (obsolete)
Comment 6 Timur 2021-08-03 10:10:13 UTC
Repro 7.3+ in Windows, no import dialog. 
I change the title per Comment 2 and Comment 3.
Comment 7 Eike Rathke 2021-08-16 21:30:17 UTC
It is not an infinite loop but a very long loop.. This can happen if a line starts with a quote character and none of the remembered last field separators used occur in data in conjunction with a closing quote and reading data tries to concatenate line by line to form a data field to be presented in the preview. Hence sometimes it's reproducible (for example if the last used separator was only ';' semicolon) and sometimes not (if the last used separators included a ',' comma), independent of platform.
Comment 8 Commit Notification 2021-08-19 15:28:48 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ff62e0165a0add7c7e3cb606df5b24b20c822d8a

Resolves: tdf#102846 CSV: Detect separator, limit preview line concatenations

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Eike Rathke 2021-08-19 15:31:36 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/120717 for 7-2
Comment 10 Commit Notification 2021-08-19 17:51:48 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c374d8ed86262c8b09c158d22ec7e4b9dee115dd

Make the logic more logical.., tdf#102846 follow-up

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2021-08-20 07:50:21 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/8bcfa0829bc5741141d1c491a527bc53b51b4f33

Resolves: tdf#102846 CSV: Detect separator, limit preview line concatenations

It will be available in 7.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Eike Rathke 2021-08-28 19:08:28 UTC
*** Bug 93334 has been marked as a duplicate of this bug. ***
Comment 13 Eike Rathke 2021-08-29 21:12:41 UTC
*** Bug 141505 has been marked as a duplicate of this bug. ***