Bug 154710 - Calc freezes when saving file after running macros: Assertion `nIndex >= 0 && "coverity#1438402"' failed
Summary: Calc freezes when saving file after running macros: Assertion `nIndex >= 0 &&...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha1+
Hardware: x86-64 (AMD64) All
: medium major
Assignee: Not Assigned
URL: http://kombinatorika.esagil.cz/partit...
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Crash-Assert Macro-VBA
  Show dependency treegraph
 
Reported: 2023-04-08 06:14 UTC by Petr Neudek
Modified: 2024-03-25 11:59 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Modul Basic (10.12 KB, application/octet-stream)
2023-04-08 06:17 UTC, Petr Neudek
Details
error message image (18.08 KB, image/jpeg)
2023-04-12 04:13 UTC, Petr Neudek
Details
test ODS (24.72 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-04-12 09:49 UTC, Stéphane Guillou (stragu)
Details
test ODS (10.58 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-04-12 09:51 UTC, Stéphane Guillou (stragu)
Details
Test My folder (23.51 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-04-30 08:16 UTC, Petr Neudek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Neudek 2023-04-08 06:14:14 UTC
Description:
Description :
While programming, I found that I could not save Calc. I failed to test the error and without saving the code worked normally. It is that the LO does not report the problem in any way. Only work cannot be saved. I ended up having to drop the LO manually. I especially suspected Windows OS. I found a way to partially bypass the problem. I saved the modified macro as an export of the Basic module and after closing Calc I immediately loaded it and continued.

Solution:
In desperation, I installed the latest version of Apache OpenOffice 4.1.14 and the error appeared after running. An error message popped up in the code for the button inserted into the cell
Dim oObjAnchor as object
oShape.Size = oSize
oDrawPage.add(oShape)
oObjAnchor = oShape.Anchor
        with oShape
                .Anchor = oObjAnchor.getCellByPosition(17,5)
        end with
The error was on the line with .Anchor = oObjAnchor.getCellByPosition(17,5). Instead of a button, I used a hyperlink to run the macro - and the problem ended in LO. But it is not the solution to the essence. I reported the problem on the forum under the name "paratrooper macro" because the program does not end by itself - I have to jump out of it myself.

Steps to Reproduce:
1. Download the basic module called Error saving Calc
2. Paste in a new workbook
3. Run the Main macro
4. Try to save the workbook with the generated Bubble Sort sheet

Actual Results:
After generating the sheet with the main macro, the content of the bubble sort demonstration will appear with comments and the option to repeat the demonstration with the button. This works fine, but the workbook cannot be saved.

Expected Results:
Calc freezes when saving and LO must be restarted.


Reproducible: Always


User Profile Reset: No

Additional Info:
Calc should have saved normally.
Comment 1 Petr Neudek 2023-04-08 06:17:59 UTC
Created attachment 186540 [details]
Modul Basic

No warning anywhere - a very insidious bug.
Comment 2 Roman Kuznetsov 2023-04-10 19:14:07 UTC
no problem in

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 185cf4496d8750c9e4905c4e384252b01b85d130
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL threaded
Comment 3 Stéphane Guillou (stragu) 2023-04-11 08:47:15 UTC
Could you please paste here the information copied from Help > About LibreOffice?
And the link to your forum question?

Thank you.
Comment 4 Petr Neudek 2023-04-12 03:33:15 UTC
For Stéphane Guillou (stragu) here is my forum post translated into English. Original https://forum.openoffice.cz/viewtopic.php?pid=25750#p25750

I have been experiencing a strange phenomenon for the past 4 days. I programmed a template for educational purposes on the topic of sorting algorithms. Everything was good in the beginning, but after a certain point I couldn't save the work. No error was visible in IDE Basic and I could test repeatedly. I just couldn't save the work. At that moment, LO stopped communicating. So I waited and when there was no change even after an hour, I had to turn off the LO.

I tested everything possible. I reinstalled the installed version of LO 7.4.6 to 7.5.2 on two of my computers with W10. No luck - it behaved the same on both machines.

I got around the problem by exporting Basic, which I immediately imported back after the crash. I was irritated by the information about the crash from the LO system: - "The Libre Office program is not responding. Please wait until the Windows system reports the problem to Microsoft". Also unusual behavior of LO after a crash, for example "lu5620ciyh3.tmp", which remain in the folder even after recovery.

Now that I've come to terms with the fact that I'll be storing Basic externally. There was a message from Petr Valach that a new version of Apache OpenOffice 4.1.14 was released. I installed it and lo and behold. The macro immediately reported an error in the code. It was a code for a button in a cell where I would certainly not expect it:

Dim oObjAnchor as object
oShape.Size = oSize
oDrawPage.add(oShape)
oObjAnchor = oShape.Anchor
with oShape
.Anchor = oObjAnchor.getCellByPosition(17,5)
end with

LO didn't report any error and the button worked fine - just couldn't save it.

I solved the problem easily. I used a hyperlink instead of the button that started the replay of the demonstration and the problem was solved. But such a tricky mistake must be solved. The error is that LO does not detect its own error and sleeps after the save command. I've experienced something similar before. Specifically, an error in "generalFunction.COUNT". I rewrote various macros for half a year and when I was done with the corrections, the LO correction came - nothing but a big waste of time and nerves.
Comment 5 Petr Neudek 2023-04-12 04:13:43 UTC
Created attachment 186594 [details]
error message image

Message translation : LibreOffice is not responding. Please wait while Windows reports the problem to Microsoft...
Comment 6 Stéphane Guillou (stragu) 2023-04-12 09:45:22 UTC
When running the main macro, the new sheet populates as expected, no error reported.
However, it doesn't create the button. That's because "ButtonInToCellBubble" is commented out in the Preparation sub.
Once it is uncommented, running the main macro does create the button.

I could save the file, with or without button.

Then, to test the button, I had to rename the module to "BubbleSort_Clasic" otherwise it wouldn't find the macro.

Once I pressed the button and the bubble sort was run again, then I could not save. Saving the file hangs LibreOffice at 100% of one core. A .tmp file remains in the file's directory after attempting a save.

Tested with:

Version: 7.5.2.2 (X86_64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Petr, in the future, it would make it easier if you shared an ODS file that contains everything, the macros ready to use, for us to test and avoid the guesswork.
Comment 7 Stéphane Guillou (stragu) 2023-04-12 09:49:29 UTC Comment hidden (obsolete)
Comment 8 Stéphane Guillou (stragu) 2023-04-12 09:51:30 UTC
Created attachment 186605 [details]
test ODS

Steps:
1. Open attachment
2. Tools > Macros > Run macros > bubble.ods > Standard > BubbleSort_Clasic > Main. Click Run.
3. It is possible to save the ODS at this stage.
4. Press the "Repeat the BubbleSort demo" button
5. Once completed, try to save again

Result: freeze at 100% of one core. Temp file in directory.
Comment 9 Stéphane Guillou (stragu) 2023-04-12 10:00:42 UTC
With a debug build, I get a failed assertion:

warn:xmloff:40095:40095:xmloff/source/text/XMLTextListAutoStylePool.cxx:163: getStyleFamilies() from XModel failed for export!
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-column with mismatching mapper ! P25SvXMLExportPropertyMapper 25SvXMLExportPropertyMapper
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-row with mismatching mapper ! P25SvXMLExportPropertyMapper 25SvXMLExportPropertyMapper
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-cell with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:sc:40095:40095:sc/source/filter/xml/xmlexprt.cxx:549: not anchored to current sheet!
warn:xmloff:40095:40095:xmloff/source/text/XMLTextListAutoStylePool.cxx:163: getStyleFamilies() from XModel failed for export!
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-column with mismatching mapper ! P25SvXMLExportPropertyMapper 25SvXMLExportPropertyMapper
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-row with mismatching mapper ! P25SvXMLExportPropertyMapper 25SvXMLExportPropertyMapper
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-cell with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 5
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 5
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 10
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 3
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 5
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 5
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 10
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:40095:40095:editeng/source/uno/unofield.cxx:375: Id service unknown: 3
warn:xmloff:40095:40095:xmloff/source/text/XMLTextListAutoStylePool.cxx:163: getStyleFamilies() from XModel failed for export!
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-column with mismatching mapper ! P25SvXMLExportPropertyMapper 25SvXMLExportPropertyMapper
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-row with mismatching mapper ! P25SvXMLExportPropertyMapper 25SvXMLExportPropertyMapper
warn:xmloff:40095:40095:xmloff/source/style/impastpl.cxx:369: Adding duplicate family table-cell with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
soffice.bin: /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sc/source/filter/xml/xmlexprt.cxx:1513: void ScXMLExport::OpenRow(sal_Int32, sal_Int32, sal_Int32, ScXMLCachedRowAttrAccess&): Assertion `nIndex >= 0 && "coverity#1438402"' failed.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1b463f697405e64a03378fb38a32172c4d3c25e6
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Freeze also in 7.4:

Version: 7.4.6.2 / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 10 Stéphane Guillou (stragu) 2023-04-12 17:39:28 UTC
Started crashing / freezing in 7.1.

Bibisected with linux-64-7.1 repo to first bad commit 25b3c957bfcb95a1da27a6021d1514495fd7df51 which points to core commit:

commit 1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca
author	Regina Henschel <rb.henschel@t-online.de>	Sat Oct 10 17:55:31 2020 +0200
committer	Regina Henschel <rb.henschel@t-online.de>	Sat Oct 31 15:36:00 2020 +0100
Improve 'resize with cell' handling
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104643
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>

Regina, can you please have a look?
Comment 11 Petr Neudek 2023-04-30 03:35:11 UTC
I now believe this error may be related to my attachment today.

It is the Work folder in the Test folder. I will not comment here, only that this is not a LO error, but an attack on my computer from the outside. Therefore, I strongly warn - The attachment may contain a virus.

The folder itself contains a new bug, but now I believe it may have already appeared in this bug. The attachment contains a file on which you can demonstrate what is happening to me, as well as screenshots. From these it should be possible to understand what the subject of the problem is just by the fact that the screens are numbered. Sorry about that. I already suspected this when reporting this bug and that's why I didn't show the source file.

If it's an outside attack, the attacker can program at a developer level, he's checking my OS, and now I'm documenting the attack on my phone. Now I'm afraid it could be anyone, even from this site. Now I'm working on a second computer completely off the network, wifi and all dangerous settings are turned off.

Also, it is probably more about my website where I list various things that may be of interest to scumbags. For example Temlate in Libre Office "paragraph cipher PNBT 8bit simple" which I put in this post as a default link, but I deal with many other things. So I have no idea who it could be, although I can guess.
sorry
Comment 12 Petr Neudek 2023-04-30 08:16:43 UTC
Created attachment 187011 [details]
Test My folder

I'm not sure so here's a link to an external repository https://uloz.to/tamhle/SMTG3hGxxOjj#!ZGZ0AwR2ZwIwBQMwMGEyZwqxBGp4ZJcdG3unERIzBJcQAmEzAD==

PLEASE NOTE - THE FILES MAY BE VIRUS INFECTED
Comment 13 Petr Neudek 2023-04-30 08:21:40 UTC
Comment on attachment 186594 [details]
error message image

I'm not sure so here's a link to an external repository https://uloz.to/tamhle/SMTG3hGxxOjj#!ZGZ0AwR2ZwIwBQMwMGEyZwqxBGp4ZJcdG3unERIzBJcQAmEzAD==

PLEASE NOTE - THE FILES MAY BE VIRUS INFECTED
Comment 14 Petr Neudek 2023-04-30 08:35:30 UTC
I'm not sure, but I can't seem to upload the attachment as a folder, nor as a zip archive. There's always something different coming up here. So a link to an external repository:

https://uloz.to/tamhle/SMTG3hGxxOjj#!ZGZ0AwR2ZwIwBQMwMGEyZwqxBGp4ZJcdG3unERIzBJcQAmEzAD==

PLEASE NOTE - FILES MAY CONTAIN VIRUSES.