Bug 117537 - FILEOPEN: Hang opening a excel file (Windows and all backend except GTK3)
Summary: FILEOPEN: Hang opening a excel file (Windows and all backend except GTK3)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2 all versions
Hardware: All All
: high major
Assignee: Caolán McNamara
URL: https://www.bacb.com/experience-track...
Whiteboard: target:6.2.0 target:6.1.0.1 target:6.0.6
Keywords: bibisected, haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2018-05-10 06:29 UTC by glad_heart
Modified: 2018-06-06 13:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature: ["rtl_cache_alloc"]


Attachments
Valgrind trace from master (53.79 KB, text/plain)
2018-05-29 12:50 UTC, Buovjaga
Details
The offending xlsx file (1.21 MB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-06-01 08:05 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description glad_heart 2018-05-10 06:29:26 UTC
Description:
I download an excel document called "experience tracker" from https://www.bacb.com/experience-tracker-information/
it is about halfway down the page.
Whenever it starts to open Libre stops working. I've downloaded other documents from them with no problem.
When it shows it's opening in Libre then Libre says "not responding" in the upper left until either I have to close Libre by going to task manager or Libre closes itself/crashes.
I want to save the file to my computer and open it in Libre.

Below it asks which version, which I don't see. Mine is Libre Office 5.4, but I don't know which version of 5.4 it is.

crashreport.libreoffice.org/stats/crash_details/855a855f-eb17-4d45-b677-7e455b35bef7

Steps to Reproduce:
1.go to https://www.bacb.com/experience-tracker-information/

2. Click on "Experience Tracker" by Step 2 or "Version 1.1" under Version History

3. Open the file

4. It will show it's loading in Libre and then stops responding

Actual Results:  
The green bar showing it's loading at the bottom goes maybe 80% of the way, then in the upper left it shows (Not responding) and eventually a not responding box comes up and it closes or if it freezes and won't close even when I press the x to close libre office then I go to task manager and close libre.

Expected Results:
Libre stops responding and closes


Reproducible: Always


User Profile Reset: No



Additional Info:
The document should have opened.


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299
Comment 1 glad_heart 2018-05-10 06:32:16 UTC
It goes from "not responding" to "Libre office is not working and will close"
Comment 2 raal 2018-05-10 16:24:27 UTC
I can open the file with Version: 6.1.0.0.alpha1+
Build ID: 741b7c35ac9cc118a9d70925c71f27147551d204
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3; 

but it crash on windows  6.0.3.2 and 6.1

crashreport.libreoffice.org/stats/crash_details/8e54bdf1-b447-425e-8314-f0b46355bfc5
Comment 3 glad_heart 2018-05-10 18:41:33 UTC
Thank you for letting me know which version will open it. 
I appreciate your looking into it and taking the time to figure it out.
Comment 4 Xisco Faulí 2018-05-28 18:03:41 UTC
I can reproduce it with gen environment...
Comment 5 Xisco Faulí 2018-05-29 12:03:12 UTC
The first version affected is libreoffice-4.2.0.0.beta1
Comment 6 Xisco Faulí 2018-05-29 12:05:39 UTC
@Buovjaga, Do you think you could valgrind this?
Comment 7 Buovjaga 2018-05-29 12:50:57 UTC
Created attachment 142378 [details]
Valgrind trace from master

Used kde4 backend (it hangs with it for me)

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: fb32f28a2b7f0c33533592b855ead127b858040c
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on May 29th 2018
Comment 8 Xisco Faulí 2018-05-29 17:03:41 UTC
Hi Caolán,
I've bisected this issue 3 times and it always points to this https://cgit.freedesktop.org/libreoffice/core/commit/?id=403a75a275d9be8b3cc192b0653b4af3533f1ecc which look like a straight-forward change.
Could you please check the valgrind trace attached by Buovjaga to see if it has some useful information?
Thank you in advance
Comment 9 Caolán McNamara 2018-05-31 12:14:17 UTC
I think there's embedded nulls in one of the font names. Originally the "GetBuffer" calls would have resulted in OUStrings that stopped at the first null. Now they don't the font combo later ends in an infinite loop updating itself.
Comment 10 Caolán McNamara 2018-05-31 12:41:25 UTC
Yeah, val="Calibri (Body)_x0000_" turns into a trailing embedded null
Comment 11 Commit Notification 2018-05-31 20:04:03 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1b6026f6661674439a638ae6c4d5c3771fafdb22

tdf#117537 block rentry to CheckAndMarkUnknownFont

It will be available in 6.2.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 12 Commit Notification 2018-05-31 20:06:50 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d406785b057811e49e74abd62c45abe8fcaa782d&h=libreoffice-6-1

tdf#117537 block rentry to CheckAndMarkUnknownFont

It will be available in 6.1.0.1.

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 13 Buovjaga 2018-06-01 08:05:01 UTC
Created attachment 142468 [details]
The offending xlsx file

I verify the fix and I thought it would be good to have the file here, so it can be slurped to crash testing corpus. The copyright statement allows us to distribute it (for educational purposes without profit-seeking).

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 8e63d451b2aeb646ece98c4e219f92957f4482bd
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on June 1st 2018
Comment 14 Commit Notification 2018-06-06 13:24:15 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c6c82096301180cfa7942dd9fb9d1cb66c7ecc04&h=libreoffice-6-0

tdf#117537 block rentry to CheckAndMarkUnknownFont

It will be available in 6.0.6.

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.