Bug 109856 - Crash in: SdrObjList::GetObjCount() ( steps in comment 12 )
Summary: Crash in: SdrObjList::GetObjCount() ( steps in comment 12 )
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: highest critical
Assignee: Caolán McNamara
QA Contact:
URL:
Whiteboard: target:6.0.0 target:5.4.1 target:5.3.6
Keywords: haveBacktrace, regression
Depends on:
Blocks:
 
Reported: 2017-07-28 18:07 UTC by Telesto
Modified: 2017-08-02 01:50 UTC (History)
4 users (show)

See Also:
Crash report or crash signature: ["SdrObjList::GetObjCount()"]


Attachments
gdb backtrace (20.40 KB, text/x-log)
2017-07-31 21:16 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2017-07-28 18:07:27 UTC
This bug was filed from the crash reporting server and is br-7472338b-37da-437c-96f1-62ecf4094857.
=========================================

1. Open Calc
2. Sheet -> Insert Sheets
3. Insert 3 sheets AFTER the current sheet
4. Press CTRL+Z twice (first undo doesn't work)
Comment 1 Julien Nabet 2017-07-28 18:16:09 UTC
On pc Debian x86-64 with LO Debian package 5.3.5 rc1, I don't reproduce this.

Just to be sure it's not a bug already fixed on 5.3.4, could you upgrade to 5.3.4 and give it a new try?
Comment 2 Julien Nabet 2017-07-28 18:17:06 UTC
Also, which value do you have for undo? 0 like in some other bugs you filled or other value?
Comment 3 Telesto 2017-07-28 18:43:31 UTC
Repro with (without a change to the Undo steps)
Version: 6.0.0.0.alpha0+
Build ID: 781a30e938c58c4d91d08f8c6f9e3f8745682d72
CPU threads: 4; OS: Windows 6.19; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-07-27_04:41:54
Locale: nl-NL (nl_NL); Calc: CL

Probably Windows Only
Comment 4 raal 2017-07-28 19:19:04 UTC
I can confirm with Version: 6.0.0.0.alpha0+
Build ID: c7fe625c8d41f648f89765abc40bb7b8fd4ed12a
CPU threads: 1; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-07-16_02:04:02
Comment 5 raal 2017-07-28 19:21:02 UTC
repro  4.2.8.2
Comment 6 Julien Nabet 2017-07-28 19:42:19 UTC
I tried again with export SAL_USE_VCLPLUGIN=gen, without success.
I used Insert sheet 3 times (first time, current sheet is sheet 1, second 
time current sheet is sheet 2...). Then I did Ctrl-Z 3 times, all the 3 worked.

Perhaps Windows only bug?
Comment 7 Telesto 2017-07-28 20:00:30 UTC
(In reply to Julien Nabet from comment #6)
Only checking: You did insert the new sheets **AFTER** the current sheet (and not before)?
Comment 8 Julien Nabet 2017-07-28 20:01:46 UTC
(In reply to Telesto from comment #7)
> (In reply to Julien Nabet from comment #6)
> Only checking: You did insert the new sheets **AFTER** the current sheet
> (and not before)?

Yes, I selected "AFTER" each time (so before undoing, I got sheet1, sheet2, sheet3 and sheet4).
Comment 9 raal 2017-07-29 05:59:01 UTC
I can reproduce the crash with Version: 6.0.0.0.alpha0+
Build ID: e0bafa78e3ad0df397d78cd65ad19bd5b07dc5f2
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-07-20_22:42:49
Comment 10 Xisco Faulí 2017-07-31 20:53:20 UTC
I can reproduce it in

Version: 6.0.0.0.alpha0+
Build ID: e0b6a4a2d2dec4e9614f27fc03f84b1c578028ec
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

Steps:
1. Open Calc
2. Insert 3 sheets after the current one
3. Undo several times
4. Redo several times

In the end, LibreOffice crashes
Comment 11 Xisco Faulí 2017-07-31 21:16:48 UTC
Created attachment 135031 [details]
gdb backtrace
Comment 12 Xisco Faulí 2017-07-31 21:35:20 UTC
I found systematic way to make it to crash:

1. Open Calc.
2. Insert 3 sheets AFTER the current one
3. Undo
4. Click on another sheet
5. Undo
CRASH!
Comment 13 Xisco Faulí 2017-07-31 22:03:42 UTC
it seems LibreOffice doesn't crash using the steps from comment 12 if 63de2b8f1493f24669c78df3bc2d48d13528bd9f is reverted, however, it crashes if I do a 'redo' after those steps.
Caolán, would you mind taking a look at it?

LibreOffice doesn't crash at all in

Version 4.1.0.0.alpha0+ (Build ID: 2003d4ffbf9865bc87cbe081f48f98b28722382)

(the commit before 63de2b8f1493f24669c78df3bc2d48d13528bd9f)
Comment 14 Caolán McNamara 2017-08-01 08:15:06 UTC
I think the crucial bit is that the initial undo doesn't work
Comment 15 Commit Notification 2017-08-01 09:09:53 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#109856 undo 'insert multiple tabs after' doesn't work

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 16 Caolán McNamara 2017-08-01 09:28:28 UTC
I can't quite reproduce the crash of the last set of comments, but its clear that the undo doesn't work and I had other related crashes. I think this works now. Backports in gerrit
Comment 17 Xisco Faulí 2017-08-01 09:54:15 UTC
Hi Caolán,
I've just tested your commit and the undo action works now. However, LibreOffice still crashes after doing a Redo

Steps:
1. Open Calc
2. Insert 3 sheets after the current one
3. Undo -> new sheets are deleted now
4. Redo -> Crash
Comment 18 Caolán McNamara 2017-08-01 10:35:25 UTC
I see one too many tabs inserted on undo
Comment 19 Commit Notification 2017-08-01 11:21:46 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#109856 redo 'insert multiple tabs after' inserts too many tabs

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 20 Caolán McNamara 2017-08-01 12:43:16 UTC
how about with both changes in place ?
Comment 21 Xisco Faulí 2017-08-01 13:38:09 UTC
it works like a charm now. Thanks for the quick fix
Comment 22 Commit Notification 2017-08-02 01:47:29 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

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

Resolves: tdf#109856 undo 'insert multiple tabs after' doesn't work

It will be available in 5.4.1.

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 23 Commit Notification 2017-08-02 01:49:13 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

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

Related: tdf#109856 redo 'insert multiple tabs after' inserts too many tabs

It will be available in 5.4.1.

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 24 Commit Notification 2017-08-02 01:49:23 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

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

Resolves: tdf#109856 undo 'insert multiple tabs after' doesn't work

It will be available in 5.3.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.
Comment 25 Commit Notification 2017-08-02 01:50:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

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

Related: tdf#109856 redo 'insert multiple tabs after' inserts too many tabs

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