Bug 150170 - Crash in: mdds::flat_segment_tree<long,bool>::insert_to_pos(boost::intrusive_ptr<mdds::__st::node<mdds::flat_segment_tree<long,bool> > > &,long,long,bool) ( only LibreOffice 7.3 )
Summary: Crash in: mdds::flat_segment_tree<long,bool>::insert_to_pos(boost::intrusive_...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.6
Keywords: bibisected, bisected, regression
: 150449 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-07-27 16:32 UTC by Stan Carman
Modified: 2022-08-18 08:46 UTC (History)
7 users (show)

See Also:
Crash report or crash signature: ["mdds::flat_segment_tree<long,bool>::insert_to_pos(boost::intrusive_ptr<mdds::__st::node<mdds::flat_segment_tree<long,bool> > > &,long,long,bool)"]


Attachments
Simple spreadsheet with no formulas. Just a grid of numbers. (18.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-07-27 16:32 UTC, Stan Carman
Details
Simpler spreadsheet with just colored rows (8.73 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-08-02 03:08 UTC, Jared Froehlich
Details
Short video showing the crash with a new document (1.41 MB, video/mp4)
2022-08-02 03:57 UTC, Jared Froehlich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stan Carman 2022-07-27 16:32:30 UTC
Created attachment 181447 [details]
Simple spreadsheet with no formulas. Just a grid of numbers.

This bug was filed from the crash reporting server and is br-baa060df-e58e-43b8-8018-8c0007b7e576.
=========================================
Crash when selecting non-contiguous rows. I wanted to select alternate rows to highlight with yellow fill. I selected row 3 and did yellow fill. Then I wanted to select rows 5, 7, 9, 11 (ctrl-click) to highlight at once, but when I did, CALC crashed. I tried it 2 - 3 times with identical results. Then I selected one row at a time and it worked. Now that I try to recreate the problem, it does not crash.
Comment 1 Roman Kuznetsov 2022-07-28 11:40:28 UTC
No crash in

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 21a31eefab1401d288dbb8220f3df3365be9efaf
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded

If you will can repro it again, please write here the new steps for repro
Comment 2 Jared Froehlich 2022-08-02 03:08:09 UTC
Created attachment 181543 [details]
Simpler spreadsheet with just colored rows

Calc randomly crashes when Ctrl+Left-Clicking alternating row numbers (i.e., 2, 4, 6, ...) or applying a color to the alternating selection using the background color dropdown box.

Related crash report:
https://crashreport.libreoffice.org/stats/crash_details/123599a7-0fe4-41c7-8491-9b6e5a6e273d
Comment 3 Jared Froehlich 2022-08-02 03:15:50 UTC
With the spreadsheet that I attached, I can replicate the crash by:
1) Ctrl + Left-Clicking every even (or odd) row number
2) Select a color from the background color dropdown box
3) Repeat from step 1 if a crash did not occur
Comment 4 Jared Froehlich 2022-08-02 03:25:53 UTC
After further testing, I have found that I can replicate the crash with just selecting rows 2, 4, and 6 (or 1, 3, 5). If a crash does not occur immediately, then I open the background color dropdown box and select a color. If a crash still refuses to occur (which for me is rare), then I do the process again.
Comment 5 Jared Froehlich 2022-08-02 03:57:29 UTC
Created attachment 181544 [details]
Short video showing the crash with a new document

Replication is sometimes easy as in this video but I can get 'runs' where the crash takes eight or more selections and/or coloring before manifesting.
Comment 6 raal 2022-08-03 15:12:12 UTC
No crash with Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 3ccbfaaf95005a34ca64ad250463ef5ce8842f43
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

Stan, Jared, please could you test it with dev version?  You can download it here:
http://dev-builds.libreoffice.org/daily/master/
Thank you
Comment 7 Jared Froehlich 2022-08-03 17:24:54 UTC
(In reply to raal from comment #6)
> Stan, Jared, please could you test it with dev version?  You can download it
> here:
> http://dev-builds.libreoffice.org/daily/master/
> Thank you

raal,

With the dev version, I cannot get it to crash by creating non-contiguous selections. I went back to make sure my 7.3.5.2 installation still crashes with the same actions and it does. So, either something in the newer code base fixes it for me or something in my old installation caused it. 
Thanks!
Comment 8 raal 2022-08-03 20:52:58 UTC
Thanks for testing, closing.
Comment 9 Xisco Faulí 2022-08-16 18:09:08 UTC
*** Bug 150449 has been marked as a duplicate of this bug. ***
Comment 10 Xisco Faulí 2022-08-16 18:09:47 UTC
this crash is still reproducible in 7.3 series, putting it to NEW
Comment 11 Xisco Faulí 2022-08-16 18:14:44 UTC
I can't reproduce it in

Version: 7.3.5.0.0+ / LibreOffice Community
Build ID: ff6e536111a966f465c4756cbfa74935752df612
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

@Stan, @Jared,
could you please share the information from Help - About LibreOffice ?
Comment 12 Xisco Faulí 2022-08-16 18:18:05 UTC
no crash in

Version: 7.4.0.3 (x64) / LibreOffice Community
Build ID: f85e47c08ddd19c015c0114a68350214f7066f5a
CPU threads: 1; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 13 Xisco Faulí 2022-08-16 18:28:00 UTC
@Roman, @Raal,
Could you please try with the 7.3 branch ?
Comment 14 Xisco Faulí 2022-08-17 11:26:35 UTC
oh, I can reproduce it with the bisect repository. Indeed, it seems to be fixed in LibreOffice 7.4 branch and master. bisecting it to see when it got fixed
Comment 15 Xisco Faulí 2022-08-17 12:03:47 UTC
At least in libreoffice-7-4 and master, the issue is no longer reproducible after 

https://cgit.freedesktop.org/libreoffice/core/commit/?id=4c5f8ccf0a2320432b8fe91add1dcadf54d9fd58

author	Luboš Luňák <l.lunak@collabora.com>	2022-03-08 12:44:49 +0100
committer	Luboš Luňák <l.lunak@collabora.com>	2022-03-09 08:25:44 +0100
commit 4c5f8ccf0a2320432b8fe91add1dcadf54d9fd58 (patch)
tree 7c10d811866ef28d0d6199782100c2eea23e7723
parent d6cd44b74cf0b6b0eaeea6f986f749da42d171ac (diff)
change default Calc number of columns to 16384 (tdf#50916)
Comment 16 Xisco Faulí 2022-08-17 14:28:35 UTC
Regression introduced by:

author	Noel Grandin <noel.grandin@collabora.co.uk>	2021-07-21 10:29:24 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2021-07-21 14:02:03 +0200
commit 99cd1d8834bb708afc81c825ff2b7992b7acb37d (patch)
tree d2c5579e5967bc4c90d1ff95bd50d588faf2cf21
parent 159b8fb14f3577812819508f4160c37414cce6da (diff)
flatten TableType in ColumnSpanSet

Bisected with: win64-7.3

Adding Cc: to Noel Grandin

Just to make sure, I built libreoffice-7-3 branch and retested this issue. If I revert the mentioned commit I can't reproduce it. Tried ~20 times to make sure
Comment 17 Xisco Faulí 2022-08-17 14:40:50 UTC
my take would be to revert the problematic commit in libreoffice-7-3 only since there is only one minor release left: https://gerrit.libreoffice.org/c/core/+/138445
Comment 18 Xisco Faulí 2022-08-17 14:47:12 UTC
this is one of the most reported crashes in 7.3. Increasing importance
Comment 19 Noel Grandin 2022-08-17 14:56:11 UTC
(In reply to Xisco Faulí from comment #17)
> my take would be to revert the problematic commit in libreoffice-7-3 only

Agreed
Comment 20 Commit Notification 2022-08-17 16:10:17 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/633a175914f0ab960965aae7de04dc8d99edb33c

tdf#150170: Revert "flatten TableType in ColumnSpanSet"

It will be available in 7.3.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.
Comment 21 Xisco Faulí 2022-08-17 16:11:29 UTC
This should be fixed in LibreOffice 7.3.6.1. which will be tagged this week. Closing
Comment 22 Xisco Faulí 2022-08-18 08:46:08 UTC
Hello Stan, Jared,
The fix should be already available in the daily build -> https://dev-builds.libreoffice.org/daily/libreoffice-7-3/current.html
Could you please try it again and confirm the crash is gone with that version ?