Bug 108796 - CRASH: Invalid vector <T> subscript
Summary: CRASH: Invalid vector <T> subscript
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.0.0.beta2
Hardware: All All
: highest critical
Assignee: Eike Rathke
URL:
Whiteboard: target:6.0.0 target:5.4.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2017-06-26 19:19 UTC by Telesto
Modified: 2017-07-02 03:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (2.09 MB, application/x-compressed)
2017-06-26 20:07 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2017-06-26 19:19:51 UTC
Description:
CRASH: Invalid vector <T> subscript

Steps to Reproduce:
1. Download and extract attachment
2. Open Calc
3. Create a new sheet containing the csv file. Menu -> Sheet -> Insert Sheet -> Select from file -> Browse and import the extract file (default settings) 
5. Now Insert 250 new sheets (Menu -> Sheet -> Insert Sheet)
6. Select all sheets except the first
7. Delete the selected sheets -> Crash

Actual Results:  
CRASH: Invalid vector <T> subscript

Expected Results:
No crash


Reproducible: Always

User Profile Reset: No

Additional Info:
Found in
Version: 6.0.0.0.alpha0+
Build ID: cb37c5f0f3de7b545231a53d46a5271058af76ad
CPU threads: 4; OS: Windows 6.19; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-06-23_06:55:41
Locale: nl-NL (nl_NL); Calc: CL

and in
Version: 5.4.0.0.beta2
Build ID: 3cc1cdd8ee50f144e5514da51800a08119754d8f
CPU threads: 4; OS: Windows 6.2; UI render: default; 
Locale: en-US (nl_NL); Calc: CL


User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Xisco Faulí 2017-06-26 19:51:04 UTC
no attachment attached
Comment 2 Telesto 2017-06-26 20:07:58 UTC
Created attachment 134300 [details]
Example file
Comment 3 Xisco Faulí 2017-06-26 22:28:22 UTC
How do you delete all the sheets but the first one? One after the other ?
Comment 4 Telesto 2017-06-27 06:37:27 UTC
(In reply to Xisco Faulí from comment #3)
> How do you delete all the sheets but the first one? One after the other ?

1. Select the second sheet
2. Select all sheets in Menu -> Sheets
2. Deselect the first sheet(most left) with CTRL+LEFT CLICK
Comment 5 Xisco Faulí 2017-06-27 08:58:20 UTC
I guess you meant Sheet - Select Sheets.

I get this error after deleting all the sheets but the first one:

vector::_M_range_check:__n (which is 251) >= this->size() (which is 251)

in

Version: 6.0.0.0.alpha0+
Build ID: 08f6f9dded1b142b858c455da03319abac691655
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 6 Xisco Faulí 2017-06-27 13:49:10 UTC
Regression introduced by:

author	Eike Rathke <erack@redhat.com>	2017-03-07 09:46:12 (GMT)
committer	Eike Rathke <erack@redhat.com>	2017-03-07 09:51:50 (GMT)
commit 73dec49802ef8fc42c5719efaa42a33cde68e569 (patch)
tree 183c172cab6fc8bda2f7b7e1bee0b85e93d8241b
parent 4c8059a3e140171399ac85ceb882d23bb458599d (diff)
a size is a size

Bisected with bibisect-linux-64-5.4

Adding Cc: to Eike Rathke
Comment 7 Eike Rathke 2017-06-28 11:18:15 UTC
Most likely a duplicate, please verify the fix, if not then reopen.

*** This bug has been marked as a duplicate of bug 108654 ***
Comment 8 Xisco Faulí 2017-06-28 11:29:48 UTC
Still reproducible in

Version: 6.0.0.0.alpha0+
Build ID: 7931ef2abbcef22de5cdddd26738e4dd8d1d8ca5
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 9 Eike Rathke 2017-06-28 12:22:58 UTC
Investigating.
Comment 10 Eike Rathke 2017-06-28 15:21:56 UTC
To reproduce it's unnecessary to load the .csv or use 250 sheets ...

0) new Calc doc with one sheet
1) insert sheet before first sheet
2) insert 3 sheets after then second sheet
3) select all sheets under Sheet -> Slect Sheets...
4) deselect first sheet with Ctrl+Click on sheet tab
5) delete sheets
Comment 11 Eike Rathke 2017-06-28 16:31:13 UTC
(In reply to Eike Rathke from comment #10)
> 2) insert 3 sheets after then second sheet
Should be instead:
2) insert 3 sheets after the first sheet
Comment 12 Commit Notification 2017-06-28 16:56:03 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#108796 let ScViewData::InsertTabs() insert the correct amount

It will be available in 6.0.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 13 Commit Notification 2017-06-28 16:56:10 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

assert(nTab < static_cast<SCTAB>(maTabData.size())); cause of tdf#108796

It will be available in 6.0.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 14 Eike Rathke 2017-06-28 16:59:32 UTC
Pending review https://gerrit.libreoffice.org/39373 for 5-4
Comment 15 Commit Notification 2017-07-02 03:09:17 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

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

Resolves: tdf#108796 let ScViewData::InsertTabs() insert the correct amount

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