Can't insert a row into a OpenOffice calc file

Bug #1938735 reported by sheepscrossing
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LibreOffice
Fix Released
Critical
libreoffice (Ubuntu)
Fix Released
High
Unassigned
Focal
Won't Fix
Undecided
Unassigned

Bug Description

Mexican coin inventory is a large Calc file - 57.3 KB. I cannot insert a row into this file without a crash, however I can add a line to the bottom of the file. Ubuntu Error Tracker contains multiple crash reports similar to this one:
2021-08-02 17:08 2021-08-02 22:08 UTC Crash libreoffice-core

at this URL.
https://errors.ubuntu.com/user/6b8e33fe437c1034a81072912cfe9c22792a3f69c4d33e45a69c800783a88079fb6601dc059840bc806cd850c6efecc383497b22497a8c8536c063887939dd99

I will attach the file to this report.

Thank You,
Duane Palmer

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: libreoffice-core 1:6.4.7-0ubuntu0.20.04.1
ProcVersionSignature: Ubuntu 5.8.0-63.71~20.04.1-generic 5.8.18
Uname: Linux 5.8.0-63-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.18
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Mon Aug 2 17:32:40 2021
InstallationDate: Installed on 2021-06-30 (33 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: libreoffice
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
sheepscrossing (sheepscrossing) wrote :
Revision history for this message
sheepscrossing (sheepscrossing) wrote :

I forgot to mention that this is a new HP Laptop with a new Ubuntu 20.04.2 installation. I have attached the out from the Hardware Info App.

Revision history for this message
Heather Ellsworth (hellsworth) wrote :

Thank you for reporting your issue and helping make Ubuntu better!

I know you said the size of the spreadsheet is 57 KB, but can you tell me roughly how many rows and columns? When you're inserting a row, is it just an empty row? Does it happen when you insert an empty row above or below or doesn't matter? When the crash occurs, what are the corresponding journalctl logs?

Revision history for this message
sheepscrossing (sheepscrossing) wrote : Re: [Bug 1938735] Re: Can't insert a row into a OpenOffice calc file

I sent the file with the initial bug report, but it's 842 rows and 9 columns.  I can add a row to the bottom but when I insert a row either before or after in the body of it it crashes when I save it. Actually I can only cut and paste the total at the bottom to make more space for rows, I can't use the insert feature at all. You'll notice in the file that I sent that there is a row at the bottom that's out of order. That was the only way I could add it; cutting and pasting the total several rows down to make more room. Usually it's an empty row.
If I run the journalctl  command  there is a ton of data there I guess because I've been having a freeze problem after I suspend the laptop by shutting the lid (I have reported that bug also bug: #19373210). Do you want me to attach the output to the bug report?
I have added it here.
Duane

    On Wednesday, August 4, 2021, 9:28:25 PM CDT, Heather Ellsworth <email address hidden> wrote:

 Thank you for reporting your issue and helping make Ubuntu better!

I know you said the size of the spreadsheet is 57 KB, but can you tell
me roughly how many rows and columns? When you're inserting a row, is it
just an empty row? Does it happen when you insert an empty row above or
below or doesn't matter? When the crash occurs, what are the
corresponding journalctl logs?

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1938735

Title:
  Can't insert a row into a OpenOffice calc file

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1938735/+subscriptions

Revision history for this message
sheepscrossing (sheepscrossing) wrote :

Are you making any progress Heather? Are you waiting for me to send something?

Revision history for this message
Heather Ellsworth (hellsworth) wrote :

Yep this crash is easily reproducible on Focal, Hirsute and Impish.
I created a spreadsheet of equal rows and columns and tried various things but could not reproduce the crash on my spreadsheet - only the one provided by the reporter. So I have no idea what it is about that spreadsheet causing the problem. I'll report it upstream and see what they have to say :)

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174389
faulty-spreadsheet

Here is a spreadsheet that is 897 rows and 9 columns that is really nothing fancy. If you add a line anywhere in the middle of the existing lines (insert above or below) and then try to save the change, the spreadsheet crashes.

There is no crash after adding columns or sheets... just lines. And you can add a line at the end of the text and save just fine. The crash only occurs when you add a line in the middle of the sheet and try to save.

I've tried creating a new spreadsheet of equal size and cannot reproduce the issue so I'm not sure what is special about this spreadsheet that causes the crash.

The issue was reported in launchpad based off of Ubuntu 20.04 and Libreoffice 6.4.7 but it happens easily on 7.1.5 and 7.2.0 rc3.

The corresponding launchpad bug: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1938735

I'll attach the faulty spreadsheet as well as the user's system state information (remember this is relative to 6.4.7, but the same thing happens on 7.2.0)

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174390
stacktrace signature

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174391
top of stacktrace

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174392
segv analysis

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174393
registers

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174394
proc status

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174395
proc maps

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Created attachment 174396
faulty-spreadsheet

Revision history for this message
In , Miguelangelrv (miguelangelrv) wrote :

I cannot repro with
Version: 7.2.0.4 (x64) / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 4; OS: Windows 10.0 Build 21390; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL

Please test with a clean profile, Menu/Help/Restart in Safe Mode

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

I did not test with Windows and unfortunately I don't have a Windows environment for testing, but the issue is present in Ubuntu 20.04 and newer.

Revision history for this message
sheepscrossing (sheepscrossing) wrote :

I finally got my head "out of a place the sun don't shine" and copied and pasted this file to another one and the new one works fine; I should have done that before reporting a bug - sorry. You close this bug report now. Thanks.

Revision history for this message
In , Qa-admin-q (qa-admin-q) wrote :

[Automated Action] NeedInfo-To-Unconfirmed

Revision history for this message
In , timur (ba.timur) wrote :

No repro 6.1, repro LO 6.2, 7.2.0 and 7.3+ master in Win 7 64-bit and Lin GTK3 Mint 19 64-bit. Regression.
I added a row above 828.

Revision history for this message
In , timur (ba.timur) wrote :

I'll try with bibisect.

Revision history for this message
In , julien2412 (serval2412-6) wrote :

Created attachment 174403
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I got an assertion.

Revision history for this message
In , timur (ba.timur) wrote :

6.2 Linux
    commit 5e777f23fd0118f6649f0d9e30eb77a72f1099e4
    Date: Fri Aug 17 09:44:34 2018 +0200
        source sha:1b95eb30f6358a9ebdedee2888be8273120669c8
        pre sha:7125c6798f94a8b7345372ba36dbabd89bab8820

    author Noel Grandin <email address hidden> 2018-08-16
    committer Noel Grandin <email address hidden> 2018-08-17
    commit 1b95eb30f6358a9ebdedee2888be8273120669c8 (patch)
    tree 45ddd96753d0fac4311529da5af61994dfd56181
    parent 7125c6798f94a8b7345372ba36dbabd89bab8820 (diff)
    loplugin:useuniqueptr in ScColumnRowStylesBase

Hi Noel, please see this Calc crash.

Revision history for this message
In , julien2412 (serval2412-6) wrote :

I reverted the patch manually + removed an assert instruction, I don't reproduce the crash indeed.
However, I noticed this log:
warn:legacy.osl:92035:92035:sc/source/filter/xml/XMLStylesExportHelper.cxx:976: GetStyleNameByIndex: invalid index

OUString* ScColumnRowStylesBase::GetStyleNameByIndex(const sal_Int32 nIndex)
{
    if ( nIndex < 0 || nIndex >= sal::static_int_cast<sal_Int32>( aStyleNames.size() ) )
    {
        // should no longer happen, use first style then
        OSL_FAIL("GetStyleNameByIndex: invalid index");
        return aStyleNames[0];
    }
    return aStyleNames[nIndex];
}

I may be wrong but IMHO the Noel's patch uncovered an already existing bug here.

Revision history for this message
In , julien2412 (serval2412-6) wrote :

If you remove 1 line and save, then you add a line and save it works.

Eike: I added some traces in ScXMLExport::ExportFormatRanges (see https://opengrok.libreoffice.org/xref/core/sc/source/filter/xml/xmlexprt.cxx?r=581b2cf7&mo=59108&fi=1525#1525)

OK case when adding a new row after I delete one or more rows first:
...
TODO ExportFormatRanges nStartCol=9 nEndCol=-1 nStartRow=837 nEndRow=838
TODO ExportFormatRanges nStartCol=9 nEndCol=5 nStartRow=838 nEndRow=841
TODO ExportFormatRanges nStartCol=7 nEndCol=1023 nStartRow=841 nEndRow=1048575
TODO ExportFormatRanges nStartCol=0 nEndCol=0 nStartRow=0 nEndRow=0
TODO ExportFormatRanges nStartCol=0 nEndCol=0 nStartRow=0 nEndRow=0

KO case when adding a new row without deleting any rows before:
...
TODO ExportFormatRanges nStartCol=9 nEndCol=-1 nStartRow=836 nEndRow=838
TODO ExportFormatRanges nStartCol=9 nEndCol=-1 nStartRow=838 nEndRow=839
TODO ExportFormatRanges nStartCol=9 nEndCol=5 nStartRow=839 nEndRow=842
TODO ExportFormatRanges nStartCol=7 nEndCol=1023 nStartRow=842 nEndRow=1048576
soffice.bin: /home/julien/lo/libreoffice/sc/source/filter/xml/xmlexprt.cxx:1499: void ScXMLExport::OpenRow(const sal_Int32, const sal_Int32, const sal_Int32, ScXMLCachedRowAttrAccess &): Assertion `nIndex >= 0 && "coverity#1438402"' failed.

It seems the pb appears when nEndRow=1048576

Changed in df-libreoffice:
importance: Unknown → Critical
status: Unknown → Confirmed
Revision history for this message
Heather Ellsworth (hellsworth) wrote (last edit ):

> I should have done that before reporting a bug - sorry. You close this bug report now.

sheepscrossing: no no no... you found a legit bug! So thanks! See all the upstream activity identifying the faulty commit :)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libreoffice (Ubuntu Focal):
status: New → Confirmed
Changed in libreoffice (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7246759822aff30e4e4e1bca7949eae3b0d960ef

tdf#143940: the style index might be -1

It will be available in 7.3.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.

Revision history for this message
In , Heather Ellsworth (hellsworth) wrote :

Thank you so much for fixing this issue :)

Changed in libreoffice (Ubuntu Focal):
status: Confirmed → Won't Fix
Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/476ad4fe6f62e7b5880f70aa67bfba702fbdef4e

tdf#143940: the style index might be -1

It will be available in 7.1.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.

Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/aecdbb01ea6d89d1e3e25707b0dcd2bedaeb64a6

tdf#143940: the style index might be -1

It will be available in 7.2.2.

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.

Changed in libreoffice (Ubuntu Impish):
status: Confirmed → Triaged
importance: Undecided → Critical
Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-1-6":

https://git.libreoffice.org/core/commit/105e241b0173bd4e110a73f1f9306616fb64a69b

tdf#143940: the style index might be -1

It will be available in 7.1.6.

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.

Revision history for this message
In , Libreoffice-commits (libreoffice-commits) wrote :

Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-2-1":

https://git.libreoffice.org/core/commit/25bdfc5404f210ed889e452cb3b7deb016c6c0d3

tdf#143940: the style index might be -1

It will be available in 7.2.1.

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.

Changed in df-libreoffice:
status: Confirmed → Fix Released
Changed in libreoffice (Ubuntu Impish):
status: Triaged → Won't Fix
no longer affects: libreoffice (Ubuntu Impish)
Changed in libreoffice (Ubuntu):
status: Triaged → In Progress
importance: Critical → High
Revision history for this message
In , Xiscofauli (xiscofauli) wrote :

I wrote a unittest for this issue <https://gerrit.libreoffice.org/c/core/+/121151> but it hits an assert.

Changed in libreoffice (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.