Issue 123166 - CRASH when Insert>row in particular way in particular document
Summary: CRASH when Insert>row in particular way in particular document
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: 4.0.0
Hardware: PC Windows, all
: P3 Critical with 5 votes (vote)
Target Milestone: 4.1.0
Assignee: Andre
QA Contact: fanyuzhen
URL:
Keywords: crash, regression
: 123458 123493 123506 123752 123885 123899 123939 124133 124187 124399 124515 125716 (view as issue list)
Depends on:
Blocks:
 
Reported: 2013-09-02 17:53 UTC by Leslie
Modified: 2014-10-05 21:06 UTC (History)
27 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.0.1
Developer Difficulty: ---


Attachments
document on which error occurred. (71.86 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-09-05 10:10 UTC, Doyle L. Wesley, Jr.
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Leslie 2013-09-02 17:53:54 UTC
Since upgrading to 4.0 - in Calc - anytime I try to Insert... Row it causes an unexpected crash.  "Due to an unexpected error, Openoffice.org crashed. It restores with no problem (Temporary fix is to drag data down to cause an empty row)
Comment 1 Rainer Bielefeld 2013-09-02 18:08:39 UTC
@Leslie 
Please attach a sample document and contribute a detailed step by step instruction how to reproduce the crash 
What SIN did you test?
Comment 2 Doyle L. Wesley, Jr. 2013-09-05 10:10:05 UTC
Created attachment 81456 [details]
document on which error occurred.

Select 'Insert' from toolbar; select 'Row'. The reported error message is then generated and application closes. Else, right click on row where insert is to occur, select 'Row', get same aforementioned results.
Comment 3 Edwin Sharp 2013-09-08 10:46:58 UTC
No crash when insert row.

Rev. 1520602 Win 7
Comment 4 Doyle L. Wesley, Jr. 2013-09-09 10:35:21 UTC
I'm using Windows 8. Did you try to reproduce it using Windows 8?
Comment 5 Leslie 2013-09-09 11:37:16 UTC
Windows 7 w/SP 1 - 
I reinstalled - (repaired) openoffice and still get the same crash when I try to insert.
Comment 6 Edwin Sharp 2013-09-09 11:54:23 UTC
Sorry, no access to Win 8.
Comment 7 Edwin Sharp 2013-09-09 11:57:52 UTC
Recheck and now crash.
Third check and no crash.
This is hard to reproduce.

Rev. 1520602 Win 7
Comment 8 Rainer Bielefeld 2013-09-09 12:33:39 UTC
Reproducible with reporter's sample document and  "AOO 4.0.0 – German UI / German locale  [AOO400m3(Build:9702)  -  Rev. 1503704 2013-07-16 14:54:56 (Di, 16 Jul 2013)]" on German German WIN7 Home Premium (64bit)", Common 4.0-dev User Profile. With following proceeding I got it 100% reproducible; I proceeded quickly, I do not know whether speed matters:

0. Launch AOO from Desktop Icon
1. Open document from AOO start center 'File -> Open'
2. leave cell cursor where it is (cell E64) and do 2 times menu 'Insert -> Row'
3. Click A26
4. menu 'Insert -> Row'
   CRASH

Other ways to reproduce the bug failed, I had to try a while until I found those steps to make the crash reproducible 

Additional Info:
a) to reproduce the CRASH with other Versions I repeated my test steps maximum 3 times with each version

b) already reproducible with
* "AOO 4.0.0 Final – German UI / German locale -  [AOO400m3(Build:9702)  -  Rev. 1505643  2013-07-23]" on German WIN7 Home Premium (64bit)", own separate user profile

c) still worked fine with:
* server installation of  "AOO 4.0.0-Dev – English UI / German locale [AOO400m1(Build:9700) -  Rev. 1484333 Rev.1483903 (2013-05-20)]" on German WIN7 Home Premium (64bit)", own separate user profile
* server installation of  " AOO 4.0.0-Dev  – English UI / German locale [AOO400m1(Build:9700) - Rev. 1457992 - Rev.1457606]" on German WIN7 Home Premium (64bit)", own separate user profile
* AOO 3.4.0

d) I can try to narrow down version where bug appeared if that seems useful

e) I did not test whether the crash is related to different settings in the different versions

f) although currently only reproducible in 1 document, I think a CRASH should have severity "major" at least
Comment 9 Leonardo 2013-09-19 08:17:55 UTC
Hi
I have the same issue on win7-64 & O.O. 4.0.0.
It seems that if I select an entire row instead of a sinle cell it works.

Anyway the crash makes nearly impossible to work on the affected document...
Comment 10 MikeVaghur 2013-09-26 12:22:17 UTC
The same occurence in Calc AOO 4.0.0 in Windows 8.
The document is not too big, containing few light formulas.
Comment 11 Rainer Bielefeld 2013-10-10 13:02:55 UTC
*** Issue 123458 has been marked as a duplicate of this issue. ***
Comment 12 Oliver Brinzing 2013-10-11 04:55:32 UTC
.
Comment 13 Ariel Constenla-Haile 2013-10-11 05:35:26 UTC
Reproducible in Windows 7 64 bit, AOO 4.0.1, with steps in comment 8:

1. move to cell E64
2. select menu "Insert" - "Row"
3. repeat step 2
4. move to cell A26
5. select menu "Insert" - "Row"
CRASH
Comment 14 Rainer Bielefeld 2013-10-19 05:45:29 UTC
*** Issue 123493 has been marked as a duplicate of this issue. ***
Comment 15 Rainer Bielefeld 2013-10-21 05:26:32 UTC
*** Issue 123506 has been marked as a duplicate of this issue. ***
Comment 16 gmessag 2013-10-21 17:55:59 UTC
I am the writer of bug 143493 and i have the same bug with Windows7 64bit and AOO
AOO401m5(Build:9714)  -  Rev. 1524958
2013-09-20 11:40:29 (Fr, 20 Sep 2013)
My PC : an Alienware M17X R3 / IntelCore I7 2.2GHz; 8Go de Ram; Graphic Card  : AMD Radeon 6890 M.

I have a file started with AOO 4.0.0 and since i installed AOO 4.0.1 the same bug arrived.

I just tried your file and i confirm the crash arrive on my computer.
Comment 17 Prosper Uniger 2013-10-27 17:35:40 UTC
similar stack trace as bug 123493:

 # Args to Child              
00 7799a7d7 00000002 00afe584 ntdll!KiFastSystemCallRet
01 00000002 00afe584 00000001 ntdll!ZwWaitForMultipleObjects+0xc
02 00afe584 00afe620 00000000 kernel32!WaitForMultipleObjectsEx+0x11d
03 00000002 00afe620 00000000 kernel32!WaitForMultipleObjects+0x18
04 00afe758 00000001 00000001 kernel32!WerpReportFaultInternal+0x16d
05 00afe758 00000001 baaa9908 kernel32!WerpReportFault+0x70
06 00000000 00000001 c0000417 kernel32!UnhandledExceptionFilter+0x1b5
07 00000000 00000000 00000000 msvcr90!_invoke_watson+0xf9
08 00000019 066feef0 5314676e msvcr90!_invalid_parameter_noinfo+0xc
09 000fffff 06182968 00000000 sc!ScUsedAreaIterator::GetNext+0x2eb
0a 00000000 000003ff 00000019 sc!ScTable::GetRowHeight+0x3564
0b 00000000 00000000 000003ff sc!ScDocument::DeleteTab+0x67f
0c 00afef40 0654a634 00000002 sc!ScDocFunc::SetWidthOrHeight+0x473a
0d 00000002 00000001 00000000 sc!ScTabView::RefreshZoom+0x451e
0e 00aff554 00aff394 56e99a02 sc!ScValidityRefChildWin::RegisterChildWindow+0x8882
0f 06608fd8 00aff554 baea9b18 sc!ScValidityRefChildWin::RegisterChildWindow+0x31f8
10 06608fd8 06d5ff38 00aff554 sfx!SfxDispatcher::Call_Impl+0x242
11 06608fd8 534fd8a4 00aff554 sfx!SfxDispatcher::_Execute+0x51
12 00aff554 534fd8a4 06608fd8 sfx!SfxBindings::Execute_Impl+0x2a8
13 009dd728 0686c3c0 00aff5f4 sfx!SfxShell::SetVerbs+0x5994

could be related to fix of bug 119707 in revision 1391286
xetable.cxx seems to be the only place where ScUsedAreaIterator is used
Comment 18 Paula 2013-11-05 16:23:09 UTC
Comment on attachment 81456 [details]
document on which error occurred.

My crash occurred when I tried to INSERT ROW from VIEW menu after selecting a row.  Used to work fine.  This is a show stopper !
Comment 19 Renate 2013-12-04 00:06:09 UTC
Windows 8.1, 64-bit, English USA
Calc 4.0.1 Insert row crashes ODS Calc. 

My spreadsheet consist of 17 Sheets and has a mixed Page Format for Orientation of  Portrait and Landscape for each sheet.  Paper format for all sheets is the same: Letter, Width 8.5", Height 11.00".

When inserting a row, crashes occure only on sheets with the Orientation Portrait and if there is a Manual Break.  My manual break is always less than 99 rows. When I Delete All Manual Breaks I am able to insert a row without a crash. 

Sheets with the Orientation Portrait and Automatic Page Break do not crash when inserting a rows.  The page ends at 99 rows.

I was always able to insert rows in sheets with the Orientation Portrait and Manual Breaks in previous versions. For now, I am happy to be able to make it work by deleting all manual breaks, inserting rows and putting the manual break back. This has to be a bug.
Comment 20 Regina Henschel 2013-12-04 08:12:59 UTC
(In reply to Ariel Constenla-Haile from comment #13)
> Reproducible in Windows 7 64 bit, AOO 4.0.1, with steps in comment 8:
> 
> 1. move to cell E64
> 2. select menu "Insert" - "Row"
> 3. repeat step 2
> 4. move to cell A26
> 5. select menu "Insert" - "Row"
> CRASH

I confirm the crash for Windows 7 32 bit, AOO 4.0.1.

I see the crash too with my debug build AOO410m1(Build:9750)- Rev. 1537454

But it does not crash in AOO410m1(Build:9750)- Rev. 1546977 from buildbot.

Please try with a current developer build.
Comment 21 Rainer Bielefeld 2013-12-04 08:38:57 UTC
I did some tests with 4.0.0, 4.0.1, 4.1.0-dev (All WIN7), and currently I can't reproduce the crash reliably. 4.0.0  sometimes crashes, most times does not crash.

No crash in 5 attempts  with server installation of "AOO 4.1.0-Dev – English  UI / English locale - [AOO410m1(Build:9750)  -  Rev. 1546757 - 2013-12-02]" on German WIN7 Home Premium (64bit)", own separate user profile.
Comment 22 Rainer Bielefeld 2013-12-19 18:13:39 UTC
*** Issue 123885 has been marked as a duplicate of this issue. ***
Comment 23 Rainer Bielefeld 2014-01-03 06:12:44 UTC
*** Issue 123939 has been marked as a duplicate of this issue. ***
Comment 24 Rainer Bielefeld 2014-01-03 06:13:57 UTC
Raise importance due to number of DUPs
Comment 25 Rainer Bielefeld 2014-01-03 12:28:54 UTC
Currently  Attachment 82193 [details] for Bug 123939 seems to crash rather reliable (test sheet1 or sheet2)
Comment 26 Andre 2014-01-15 11:00:22 UTC
Taking over.

At first glance it looks like ScTable::InsertRow(...) tries to be too clever with its iterators when it manipulates the list of manual page breaks.

Simpler way to reproduce this bug:
1. Create a new Calc document.
2. Select cell A2
3. Create a manual row break via Insert->Manual Break->Row Break.
4. Insert a new row eg via Insert->Rows
-> Crash
Comment 27 Andre 2014-01-16 09:57:11 UTC
Crash was caused by a std::set::reverse_iterator that become invalid due to erase/insert operations.  Fixed by accessing the set more conservatively.
Comment 28 SVN Robot 2014-01-16 09:57:45 UTC
"af" committed SVN revision 1558727 into trunk:
123166: Made the update of maRowManualBreaks more conservative.
Comment 29 Andre 2014-01-16 09:58:26 UTC
Fixed.
Comment 30 Prosper Uniger 2014-01-16 10:31:56 UTC
(In reply to Andre from comment #27)
> Crash was caused by a std::set::reverse_iterator that become invalid due to
> erase/insert operations.  Fixed by accessing the set more conservatively.

Hi,
thank you for fixing this.

the code in ScTable::InsertCol looks similar, could there be the same problem?
Comment 31 Rainer Bielefeld 2014-01-17 15:45:23 UTC
*** Issue 123752 has been marked as a duplicate of this issue. ***
Comment 32 Rainer Bielefeld 2014-01-17 15:54:25 UTC
*** Issue 123899 has been marked as a duplicate of this issue. ***
Comment 33 Andre 2014-01-20 10:41:29 UTC
(In reply to Prosper Uniger from comment #30)
> (In reply to Andre from comment #27)
> > Crash was caused by a std::set::reverse_iterator that become invalid due to
> > erase/insert operations.  Fixed by accessing the set more conservatively.
> 
> Hi,
> thank you for fixing this.
> 
> the code in ScTable::InsertCol looks similar, could there be the same
> problem?

I think it can.  Thank you for finding this.
Comment 34 Andre 2014-01-20 10:51:34 UTC
And I can even trigger a crash with it:

- Create a new Calc document.
- Select the column B
- Insert a column break (Insert->Manual Break->Column Break)
- Insert a new column (repeat until crash)

I just don't understand why it does not always crash.
Comment 35 Prosper Uniger 2014-01-20 11:13:11 UTC
(In reply to Andre from comment #33)
> I think it can.  Thank you for finding this.

Since this bug is resolved fixed, I cloned report to bug 124033 after I verified a similar crash with colums.
Comment 36 Andre 2014-01-20 14:41:38 UTC
There seems to be another crash lurking in this area.  I have seen it once or twice after fixing this bug.  It seems harder to reproduce.
Comment 37 Rainer Bielefeld 2014-01-28 14:08:06 UTC
*** Issue 124133 has been marked as a duplicate of this issue. ***
Comment 38 Rainer Bielefeld 2014-02-05 17:58:53 UTC
*** Issue 124187 has been marked as a duplicate of this issue. ***
Comment 39 Ray Wales 2014-02-25 02:13:25 UTC
Thanks for making this bug and its fix public.
I had the same problem in AOO 4.0.1 running under Vista Business SP2.
Attempts to insert rows by selecting a row and pressing Ctrl++ always caused Calc to crash.
Removing all the manual row breaks in the spreadsheet allows me to insert rows without any problem.
Comment 40 fanyuzhen 2014-02-27 09:25:06 UTC
It's verified fixed as I cannot reproduce the issue in following build

AOO410m1(Build:9750)  -  Rev. 1566593
2014-02-10 15:58:03 (Mo, 10 Feb 2014)
Comment 41 j.nitschke 2014-03-11 08:55:29 UTC
*** Issue 124399 has been marked as a duplicate of this issue. ***
Comment 42 j.nitschke 2014-03-11 09:56:45 UTC
*** Issue 123493 has been marked as a duplicate of this issue. ***
Comment 43 j.nitschke 2014-03-26 13:18:28 UTC
*** Issue 124515 has been marked as a duplicate of this issue. ***
Comment 44 Steve Yin 2014-04-03 07:45:42 UTC
Verified on branch AOO410. Rev. 1583666
Comment 45 j.nitschke 2014-10-05 21:06:06 UTC
*** Issue 125716 has been marked as a duplicate of this issue. ***