Bug 93358 - Copy/paste of a range of cells with IF formula and format set to General causes crash
Summary: Copy/paste of a range of cells with IF formula and format set to General caus...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: high critical
Assignee: Eike Rathke
URL:
Whiteboard: target:5.1.0 target:5.0.2 target:4.4.6
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-11 14:08 UTC by bureautiquelibre
Modified: 2016-10-25 19:23 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file (9.22 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-08-11 14:08 UTC, bureautiquelibre
Details
GDB trace (27.12 KB, text/x-log)
2015-08-11 14:35 UTC, Mathieu Parent
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bureautiquelibre 2015-08-11 14:08:11 UTC
Created attachment 117828 [details]
Sample file

Open the example document in calc.

Select highlighted cells in orange and copy.

Create new empty document, select a cell and type Ctrl-v or paste.

LibreOffice crashes.

Took me a while to find the root cause.
The bug seemed random at first.

Crash occurs only if the cell with formula IF has format set to "number" AND you have to copy a range of cells along with it.

Copy/pasting only the cell with formula doesn't cause a crash and copying cell with formula but format set to text for example doesn't cause a crash either.


Bug is also present in version 4.4.2.2 and 5.0.0
Comment 1 Mathieu Parent 2015-08-11 14:19:12 UTC
I can reproduce it on Debian too with 4.4.5.2 (Debian testing).
Comment 2 Mathieu Parent 2015-08-11 14:35:18 UTC
Created attachment 117831 [details]
GDB trace

Backtrace attached. Summary:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffc323c816 in GetItem (nWhichP=nWhichP@entry=101, this=0x2763e70) at /home/rene/Debian/Pakete/LibreOffice/libreoffice-4.4.5.2/sc/inc/patattr.hxx:68
68      /home/rene/Debian/Pakete/LibreOffice/libreoffice-4.4.5.2/sc/inc/patattr.hxx: Aucun fichier ou dossier de ce type.
#0  0x00007fffc323c816 in lcl_GetAttribHeight(ScPatternAttr const&, sal_uInt16) (nWhichP=nWhichP@entry=101, this=0x2763e70) at /home/rene/Debian/Pakete/LibreOffice/libreoffice-4.4.5.2/sc/inc/patattr.hxx:68
#1  0x00007fffc323c816 in lcl_GetAttribHeight(ScPatternAttr const&, sal_uInt16) (rPattern=..., nFontHeightId=nFontHeightId@entry=101) at /home/rene/Debian/Pakete/LibreOffice/libreoffice-4.4.5.2/sc/source/core/data/column2.cxx:744
#2  0x00007fffc32445a1 in ScColumn::GetOptimalHeight(sc::RowHeightContext&, int, int, unsigned short, int) (this=this@entry=0x2195d60, rCxt=..., nStartRow=nStartRow@entry=9, nEndRow=nEndRow@entry=10, nMinHeight=nMinHeight@entry=256, nMinStart=nMinStart@entry=9) at /home/rene/Debian/Pakete/LibreOffice/libreoffice-4.4.5.2/sc/source/core/data/column2.cxx:860
#3  0x00007fffc338794a in (anonymous namespace)::GetOptimalHeightsInColumn(sc::RowHeightContext&, ScColumn*, SCROW, SCROW, ScProgress*, sal_uInt32) (rCxt=..., pCol=pCol@entry=0x2195c20, nStartRow=nStartRow@entry=9, nEndRow=nEndRow@entry=10, pProgress=pProgress@entry=0x0, nProgressStart=<optimized out>) at /home/rene/Debian/Pakete/LibreOffice/libreoffice-4.4.5.2/sc/source/core/data/table1.cxx:108
#4  0x00007fffc338d118 in ScTable::SetOptimalHeight(sc::RowHeightContext&, int, int, ScProgress*, unsigned long) (this=0x2195c20, rCxt=..., nStartRow=nStartRow@entry=9, nEndRow=nEndRow@entry=10, pOuterProgress=pOuterProgress@entry=0x0, nProgressStart=nProgressStart@entry=0) at /home/rene/Debian/Pakete/LibreOffice/libreoffice-4.4.5.2/sc/source/core/data/table1.cxx:477
Comment 3 Eike Rathke 2015-08-14 17:11:56 UTC
Taking.
Comment 4 Commit Notification 2015-08-14 23:36:24 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#93358 resync attribute pattern that may have changed

It will be available in 5.1.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 5 Eike Rathke 2015-08-15 00:04:21 UTC
Pending review
https://gerrit.libreoffice.org/17765 for 5-0
https://gerrit.libreoffice.org/17766 for 4-4
Comment 6 Commit Notification 2015-08-17 10:51:02 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=31050925ad6788c627af23f751bdbf5768cc7afa&h=libreoffice-5-0

Resolves: tdf#93358 resync attribute pattern that may have changed

It will be available in 5.0.2.

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 7 Commit Notification 2015-08-17 12:35:03 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fe1792bd24b45f6b2e5dc21cbf2a8744f8c42f17&h=libreoffice-4-4

Resolves: tdf#93358 resync attribute pattern that may have changed

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