Bug 147744 - Calc crashes when pasting simple formula in a filtered column
Summary: Calc crashes when pasting simple formula in a filtered column
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.1.3 release
Hardware: All Linux (All)
: high major
Assignee: Kohei Yoshida
URL:
Whiteboard: target:7.4.0 target:7.3.2
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: AutoFilter Clipboard
  Show dependency treegraph
 
Reported: 2022-03-03 13:45 UTC by Kevin Suo
Modified: 2022-03-13 04:37 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
crash.ods (17.49 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-03-03 13:45 UTC, Kevin Suo
Details
gdb bt (11.89 KB, text/plain)
2022-03-03 14:49 UTC, Julien Nabet
Details
much simpler test case (8.92 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-03-11 03:41 UTC, Kohei Yoshida
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2022-03-03 13:45:24 UTC
Created attachment 178640 [details]
crash.ods

Steps to Reproduce:
1. Open the attached ods file.
2. Click the autofilter dropdown in column "Select", choose "Y", click OK.
3. Type in the formula in cell C5:
=B5-A5
4. Click in cell C5, ctrl+C to copy.
5. Select cell range C9:C20,ctrl+V to paste.

--> Crash.

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 6961f6732954742415413fa53bdeebd1b03d9ec5
CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Build Platform: Fedora34@X64, Branch:master, bibisect-linux-64-7.4-CN
Calc: threaded

Also in

Version: 7.3.2.0.0+ / LibreOffice Community
Build ID: 789fbf732ad6db002fd83b307385940c392cc457
CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Calc: threaded
Comment 1 Kevin Suo 2022-03-03 13:57:38 UTC
Regression caused by:

commit 703fb7739a5e604d90e147db6f67917b8d141150
Author: Kohei Yoshida <kohei@libreoffice.org>
Date:   Mon Jan 31 22:45:21 2022 -0500

    tdf#146795: Make sure to use valid position hints to avoid crash.

(this commit was also backported to 7.3 branch)

Adding Kohei Yoshida to cc: could you please take a look?
Comment 2 Kevin Suo 2022-03-03 14:03:55 UTC
I set importance to HIGH as for our 7.3 release this bug is a regression between 7.3.0 and the 7.3.1.

7.3.1 is in its (unscheduled) RC3 stage is to be released soon.
Comment 3 Xisco Faulí 2022-03-03 14:45:37 UTC
Nice catch!!

Reproducible in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: c97a3592c78ce276a353f95ce68c70a8a39174a0
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 4 Julien Nabet 2022-03-03 14:49:06 UTC
Created attachment 178643 [details]
gdb bt

On pc Debian x86-64 with master sources updated today, I could reproduce this.
I attached bt with console logs at the end.
Comment 5 Kohei Yoshida 2022-03-11 03:26:35 UTC
Yet another one...
Comment 6 Kohei Yoshida 2022-03-11 03:41:14 UTC
Created attachment 178796 [details]
much simpler test case

This is a much simpler test case.

1. Open the file. The cursor should already be at A2.
2. Ctrl-C to copy A2 to clipboard.
3. Move cursor down and select A4:A6 (over 2 visible cells).
4. Ctrl-V to paste.
5. Crash.
Comment 7 Commit Notification 2022-03-11 14:02:35 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

tdf#147744: Make sure to pass valid position hints.

It will be available in 7.4.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.
Comment 8 Commit Notification 2022-03-11 21:41:49 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/7049b1da30f715c502f38ed982eec037e096be08

tdf#147744: Make sure to pass valid position hints.

It will be available in 7.3.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.
Comment 9 Kohei Yoshida 2022-03-11 21:47:17 UTC
Cherry-pick for 7.3.2 is here: https://gerrit.libreoffice.org/c/core/+/131406
Comment 10 Kevin Suo 2022-03-12 07:24:41 UTC
Verified fixed on 7.3 branch. Thank you!
Comment 11 Julien Nabet 2022-03-12 08:58:51 UTC
On pc Debian x86-64 with master sources updated today, I confirm I don't reproduce the crash with the initial file.
Comment 12 Commit Notification 2022-03-12 11:44:22 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9c5a32c6cf072473ea28e2e9eca76ffd10c2aefa

tdf#147744: sc_uicalc: Add unittest

It will be available in 7.4.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.
Comment 13 Commit Notification 2022-03-13 04:37:38 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-7-3-2":

https://git.libreoffice.org/core/commit/98e39c87a123e2d1b5c2738c26625fd2b7849ea3

tdf#147744: Make sure to pass valid position hints.

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