Description: I edited a perfectly fine spreadsheet by removing a lot of stuff. Because of that, some references broke, causing some cells to have values like "#WERT!" or "NAME?" (using German locale). I saved this spreadsheet and closed LibreOffice. Later, I tried to open the spreadsheet again, but LibreOffice crashed. When starting from the terminal, the following error message is printed: /usr/include/c++/12.2.0/optional:484: constexpr const _Tp& std::_Optional_base_impl<_Tp, _Dp>::_M_get() const [with _Tp = rtl::OUString; _Dp = std::_Optional_base<rtl::OUString, false, false>]: Assertion 'this->_M_is_engaged()' failed. I cannot share the original document or the I edited due to sensitive data, but I used a text editor to remove stuff until I had a version of the document I could open again. When I open this skeleton document, save it, close LibreOffice and open the file again, the crash is back. Calc can open the document again after replacing all "#" values with a text editor (removing the #). Starting LibreOffice in safe-mode did not help. Keywords: EDITING FILEOPEN FILESAVE Steps to Reproduce: 1. Open the attached example spreadsheet. It should open fine. 2. Save the spreadsheet without editing anything. 3. Close LibreOffice. 4. Open the file again. LibreOffice crashes. 5. Use a text editor to remove all occurrences of the "#" symbol. 6. Open the file once more. It loads again. 7. When saving the spreadsheet again, LibreOffice is again unable to load it. Actual Results: LibreOffice crashes when loading a version of the spreadsheet that contains "#" cell values. Expected Results: LibreOffice openes the spreadsheet without crashing. Reproducible: Always User Profile Reset: No OpenGL enabled: Yes Additional Info: Version: 7.3.6.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: de-DE (de_DE.UTF-8); UI: de-DE 7.3.6-3 Calc: CL Running Arch Linux, LTS kernel 5.15.71-1
Created attachment 183078 [details] Spreadsheet that causes LibreOffice to crash when trying to open it
There are two problems here: 1. The crash. No matter what, the file should not crash the program; if validation fails, it must be rejected gracefully. You have provided the file to debug this. 2. Saving some invalid data. And that needs the file that opens normally, but generates the problematic file on save. You mentioned you generated such a file when preparing the test case. If possible, please also attach it here. I confirm the crash with attachment 183078 [details] using Version: 7.4.2.3 (x64) / LibreOffice Community Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: CL
Created attachment 183079 [details] This file opens, but saving an opening again will crash LibreOffice This file was derived from the attachment "corrupt.fods" by removing all "#" symbols.
lets at least not crash with this input
Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/3fbb307b970f41605a80c6ea3cbea0c9af9eb638 tdf#151560 don't crash on loading dubious fods It will be available in 7.4.7. 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.
Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/4ad3605166c91193b3dbf41ed33515e267133f90 tdf#151560 don't crash on loading dubious fods It will be available in 7.5.4. 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.
Caolán McNamara committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7773932ba7c4bafeed7fba0a5d87f75eed09f850 tdf#151560 don't crash on loading dubious fods 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.
Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-5-3": https://git.libreoffice.org/core/commit/65572a7ae58b5eafba835b4c0cb16e3cb9188f05 tdf#151560 don't crash on loading dubious fods It will be available in 7.5.3. 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.