Bug 124525 - FILEOPEN Calc doesn't open XLSX archive - opens if extracted and rezipped
Summary: FILEOPEN Calc doesn't open XLSX archive - opens if extracted and rezipped
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords: filter:xlsx
Depends on:
Blocks: XLSX File-Opening
  Show dependency treegraph
 
Reported: 2019-04-03 12:21 UTC by Roman Kuznetsov
Modified: 2023-04-14 13:57 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
XLSX file (7.81 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-04-03 12:22 UTC, Roman Kuznetsov
Details
XLSX file after resaving with MS Excel 2016 (10.18 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-04-03 19:47 UTC, Bartosz
Details
XLSX file after manual resave (8.31 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-04-03 20:32 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2019-04-03 12:21:56 UTC
Description:
Calc doesn't open XLSX file

Steps to Reproduce:
1. Try open attached XLSX file


Actual Results:
Calc doesn't open the file

Expected Results:
Calc opens file fine


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.3.0.0.alpha0+
Build ID: d31d77b7199ecc9a7edc899d9703e9da52d5cbd1
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-04-01_00:04:09
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 1 Roman Kuznetsov 2019-04-03 12:22:33 UTC
Created attachment 150508 [details]
XLSX file
Comment 2 Xisco Faulí 2019-04-03 13:58:11 UTC
Reproduced in

Version: 6.3.0.0.alpha0+
Build ID: 93f1c3665fcdc31c36078f179ac37fd69d3ebb00
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

and

Versió: 6.1.4.2
ID de la construcció: 1:6.1.4-0ubuntu0.16.04.1~lo2
Fils de CPU: 4; SO: Linux 4.15; Renderitzador de la IU: per defecte; VCL: gtk3; 
Configuració local: ca-ES (ca_ES.UTF-8); Calc: group threaded

in previous versions of LibreOffice it crashes at import time...
Comment 3 Xisco Faulí 2019-04-03 13:59:01 UTC
@Mike, I thought you might be interested in this issue...
Comment 4 Bartosz 2019-04-03 19:47:46 UTC
Created attachment 150517 [details]
XLSX file after resaving with MS Excel 2016

After resaving with MS Excel 2016, LibreOffice is opening document successully
Comment 5 Eike Rathke 2019-04-03 19:59:48 UTC
Fwiw, it happens in package/source/zippackage/ZipPackage.cxx look out for three places with

 throw css::packages::zip::ZipIOException("Bad Zip File, stream as folder");

It might be the zip is erroneous, but it might also be the code is confused at some point when looking for a _rels name and there are directories _rels and xl/_rels (though both should have the folder flag it seems at least one doesn't), didn't dig deeper.
Comment 6 Bartosz 2019-04-03 20:32:23 UTC
Created attachment 150518 [details]
XLSX file after manual resave

After recreating archive with the same files, the .xlsx could be opened via LibraOffice Calc.

I suspect that the problem is with the archive which couldn't be read propelry via LibreOffice
Comment 7 Xisco Faulí 2019-07-18 11:45:15 UTC Comment hidden (obsolete)
Comment 8 Roman Kuznetsov 2020-01-10 14:05:06 UTC
still repro in

Version: 6.5.0.0.alpha0+ (x64)
Build ID: b6295e4a1b7735c148174f44f6d28221f4f52302
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 9 Timur 2020-03-28 07:28:31 UTC
Similar to bug 76115  opens if extracted and rezipped.
But there #The problem is that the zip has "\" instead of "/" as the separators.# which may not be here.
Comment 10 Gabor Kelemen (allotropia) 2023-03-31 11:22:43 UTC
I can open the file in 7.4 since:

https://git.libreoffice.org/core/+/8eabb8839dd81a1055aa0416ab5f3f67c7d3bb29

author	Noel Grandin <noel.grandin@collabora.co.uk>	Fri May 13 11:08:47 2022 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	Sat May 14 14:44:02 2022 +0200

reserve space in map in ZipFile::readCEN

Interestingly the example files from the See Also bugs can still not be opened in recent master.
Comment 11 Xisco Faulí 2023-04-03 14:37:37 UTC
oh, this is interesting.
I created a unittest for this <https://gerrit.libreoffice.org/c/core/+/149956> and the file loads correctly on Linux and Mac but not on Windows.
In fact, I've just tried on

Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 1; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

and it fails to load. I'll create a follow-up ticket for this
Comment 12 Commit Notification 2023-04-03 16:05:25 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/994ecdc459ff99b5944ae289a51328d8093c422f

tdf#124525: sc_subsequent_filters_test4: Add unittest

It will be available in 7.6.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 13 Noel Grandin 2023-04-14 13:57:44 UTC
This archive file only works by accident on Linux, where did you get it from?

'unzip -t' says that it has dodgy entries for the folders.

I am inclined to add some extra checks to that code so that we reliably fail this file on all platforms.