Bug 157975 - close XLS spreadsheet and all the data is lost
Summary: close XLS spreadsheet and all the data is lost
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.7.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: dataLoss
Depends on:
Blocks:
 
Reported: 2023-10-29 21:47 UTC by simon.j.hunter
Modified: 2023-11-26 22:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
the trashed xls file (39.50 KB, application/vnd.ms-excel)
2023-10-29 21:47 UTC, simon.j.hunter
Details
this file is ok (30.50 KB, application/vnd.ms-excel)
2023-10-29 22:07 UTC, simon.j.hunter
Details
bad file (35.50 KB, application/vnd.ms-excel)
2023-10-29 22:12 UTC, simon.j.hunter
Details
windows error report (38.81 KB, text/plain)
2023-11-06 00:05 UTC, simon.j.hunter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description simon.j.hunter 2023-10-29 21:47:47 UTC
Created attachment 190500 [details]
the trashed xls file

this is the second time this has happened to me recently.  this time i created this file today and updated/saved it a few times.  then i closed it and when i reopened it, all the data had gone. not real happy!

one common theme is that the spreadsheets had > 1 tab.

this one had 4 tabs. you can see at the bottom it says sheet 1 of 4 but there is only the first tab/sheet displayed.  all cells are empty.  (when i open it in excel, there are 4 tabs but all are empty)

this is x86 version of libre office windows 11.

tks
Comment 1 simon.j.hunter 2023-10-29 22:07:29 UTC
Created attachment 190501 [details]
this file is ok

i started a brand new file and kept copies. this one is ok.
Comment 2 simon.j.hunter 2023-10-29 22:12:28 UTC
Created attachment 190502 [details]
bad file

then i entered the formula =MAX(B367:CD367)  in row 367 and copied it to column a in rows 17 - 366 and saved and closed.  

on reopening, i have this empty spreadsheet (attached).

same if i edit new - Copy (2) and do save as a new file.
Comment 3 simon.j.hunter 2023-10-29 22:20:49 UTC
the point is, while i keep it open and simply save changes, all is ok with the copy in memory.

the problem seems to be with what is saved?
Comment 4 simon.j.hunter 2023-10-29 22:34:14 UTC
now i tried closing libre office and repeating and now it worked.
Comment 5 m_a_riosv 2023-10-31 17:01:03 UTC
Please test in safe mode, Menu/Help/Restart in Safe Mode
Comment 6 simon.j.hunter 2023-10-31 21:21:04 UTC
i restarted in safe mode and the trashed xls file looks exactly the same as in normal mode.

are you suggesting that i should run in safe mode until the problem recurs and then there will be some diagnostic information?

as i see it, something gets corrupted in the runtime program after some time and then it starts saving the spreadsheet improperly and loses the data while the in memory copy carries on ok. the user doesn't know this has happened until they close and reopen the file and then it is too late and the data has gone.

i do not have any extensions other than the bundled ones.

i cannot recreate the problem at will - it needs to await libre office getting "corrupted", which has only happened twice.

can you not look at the internals of the bad file and see why it might have got corrupted?

tks
Comment 7 m_a_riosv 2023-10-31 22:54:12 UTC
(In reply to simon.j.hunter from comment #0)
> Created attachment 190500 [details]
> the trashed xls file
> 
> this is the second time this has happened to me recently.  this time i
> created this file today and updated/saved it a few times.  then i closed it
> and when i reopened it, all the data had gone. not real happy!
> 
> one common theme is that the spreadsheets had > 1 tab.
> 
> this one had 4 tabs. you can see at the bottom it says sheet 1 of 4 but
> there is only the first tab/sheet displayed.  all cells are empty.  (when i
> open it in excel, there are 4 tabs but all are empty)
> 
> this is x86 version of libre office windows 11.
> 
> tks

There are three hiden sheets, Menu/Sheet/Show sheet.
Comment 8 simon.j.hunter 2023-10-31 23:51:57 UTC
ok, i can see the other 3 sheets, but they are all empty, their contents weren't saved.
Comment 9 simon.j.hunter 2023-10-31 23:59:45 UTC
i don't believe it but the first file that had this problem has had it again now that i open it today.

it was last updated on 29/10, the day before i had the problem with the attached file.  most likely, though i am not sure, libre office was open the whole time.

so my hypothesis is that whatever is going wrong started on the 29th or before  and persisted through the 30th causing problems for 2 files when they were saved.
Comment 10 QA Administrators 2023-11-01 03:14:31 UTC Comment hidden (obsolete)
Comment 11 m_a_riosv 2023-11-01 15:47:19 UTC
If you save the file and use Menu/File/Reload, the file is fine or the data it's lost?
Comment 12 simon.j.hunter 2023-11-01 23:26:35 UTC
if i now open the bad file and then reload it, it is empty.  i didn't try this earlier.
Comment 13 simon.j.hunter 2023-11-04 01:29:08 UTC
i thought i would try the 64 bit version (which i think i stopped using ages ago because of a lenovo display driver problem).

anyway the problem is still happening and frequently. eg today libre office has been open since at least yesterday and i opened a file, saved it and it has lost its data (though in memory copy still displays ok).

i can see this if i check - the file size shrinks. is there anything i can do while the file is still open to get some info on what is going on in the in memory copy?
Comment 14 simon.j.hunter 2023-11-06 00:05:44 UTC
Created attachment 190667 [details]
windows error report

i have seen this crash several times and it is related.  i got it yesterday and then today, both times saving a 'bad' file.

today, after office had been left open overnight, i opened the xls file.  when i did save as .ods of the unmodified file, i got 'file cannot be written'.  when i tried save as .xlsx, i got the crash.

close office and retry - all ok.  something in office is going wrong after it has been open for some hours.
Comment 15 Buovjaga 2023-11-07 16:38:47 UTC
(In reply to simon.j.hunter from comment #2)
> Created attachment 190502 [details]
> bad file
> 
> then i entered the formula =MAX(B367:CD367)  in row 367 and copied it to
> column a in rows 17 - 366 and saved and closed.  
> 
> on reopening, i have this empty spreadsheet (attached).
> 
> same if i edit new - Copy (2) and do save as a new file.

I did what you said with the formula and after reopening the formulas remain present.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c0c8cffd3541e3cd616c96791b04e7ebf2b2ed03
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 16 Stéphane Guillou (stragu) 2023-11-21 07:00:39 UTC
My recommendations moving forward:
- Update to LO 7.6 (because 7.5 is unlikely to get further fixes)
- Start with a new user profile (after backing up the old one): https://wiki.documentfoundation.org/UserProfile
- See if the issue persists.
- And as a general recommendation: work on ODS or XLSX files, as the XLS binary format is harder to investigate and obsolete in many ways.

(In reply to simon.j.hunter from comment #14)
> Created attachment 190667 [details]
> windows error report
> i have seen this crash several times and it is related.
I've linked your bug 158095 in "see also".
Comment 17 simon.j.hunter 2023-11-22 06:39:25 UTC
i upgraded to 
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-AU (en_AU); UI: en-GB
Calc: CL threaded

and renamed my user profile folder.
only options i then set were language english GB and default save file types as xlsx, docx, pptx.

opened LO.  6 hours later i got the crash again when closing/saving a file i had left open during this time.
Faulting module name: ucrtbase.dll, version: 10.0.22621.2506, time stamp: 0x097c794c
Exception code: 0xc0000409      Fault offset: 0x000000000007f61e

it was an xlsx file but it wasn't corrupted.
Comment 18 simon.j.hunter 2023-11-23 06:43:10 UTC
i have also had the "close XLS spreadsheet and all the data is lost" problem, same as before (was with a .xls file).
Comment 19 Stéphane Guillou (stragu) 2023-11-23 07:18:39 UTC
I see from bug 158095  that you use Skia/Vulkan. Might be worth it to:
1. Share with us the Skia log copied from: Tools ▸ Options... ▸ LibreOffice ▸ View
2. In the same menu, use "Force Skia software rendering" and see if you still have issues
Comment 20 simon.j.hunter 2023-11-24 06:03:23 UTC
went into safe mode and turned hardware accelerate off.
waited a few hours and opened a xlsx. edited it and do file - close.
crash. no data lost from sheet.

went into safe mode and left hardware accelerate alone  (??  use hardware acceleration checkbox is checked and disabled).
checked use skia for rendering.  restart.
waited a few hours and opened a xlsx. edited it and do  file - close.
crash. no data lost from sheet.

this is all there is in the skia log:

RenderMethod: vulkan
Vendor: 0x8086
Device: 0x3e92
API: 1.3.211
Driver: 0.404.1960
DeviceType: integrated
DeviceName: Intel(R) UHD Graphics 630
Denylisted: no
Comment 21 QA Administrators 2023-11-25 03:15:40 UTC Comment hidden (obsolete)
Comment 22 simon.j.hunter 2023-11-26 12:05:38 UTC
this may well be related to the Skia rendering.

i turned it off and restarted and left LO open for a few hours.  got the contents deleted from an xls file and the 'can't write file' error for an ods file and also a crash (xlsx file i think).

i will turn rendering back on and see how i go.
Comment 23 Buovjaga 2023-11-26 13:53:37 UTC
It never offers to send a crash report?

A more convoluted way to get a backtrace of the crash would be https://wiki.documentfoundation.org/How_to_get_a_backtrace_with_WinDbg
while using Win-x86@39 from https://dev-builds.libreoffice.org/daily/master/current.html

Then the symbol path has to be this as mentioned in the wiki article

CACHE*C:\symbols;SRV*https://dev-builds.libreoffice.org/daily/master/Win-x86@39/symbols;SRV*https://dev-downloads.libreoffice.org/symstore/symbols;SRV*https://msdl.microsoft.com/download/symbols
Comment 24 simon.j.hunter 2023-11-26 22:19:58 UTC
see  bug 158095  i did sometimes get the dialog to send a crash report but not recently and one is there.  LO just closes.

i have downloaded windbg (win 11) but it doesn't bear much resemblance to the version described in the wiki.  eg one doesn't seem to have to set the symbol path.

it suggests you have to run the debugger on a separate machine, which i can't do.  when i try and debug the LO process i can't do anything in LO, which i assume is because it is on the same PC?  when i close windbg, LO closes too.

but i don't know what i am doing in this area!