Download it now!
Bug 33947 - Impress: print renderer owns a DrawView that references a destroyed DrawViewShell
Summary: Impress: print renderer owns a DrawView that references a destroyed DrawViewS...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected)
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: Thorsten Behrens (CIB)
: 35273 (view as bug list)
Depends on:
Reported: 2011-02-05 13:36 UTC by Yaron Sheffer
Modified: 2011-04-05 00:59 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

crash stack (24.76 KB, text/plain)
2011-03-15 01:33 UTC, Yifan Jiang
one plausible fix (660 bytes, patch)
2011-03-15 05:38 UTC, Caolán McNamara
Amended patch (1.12 KB, patch)
2011-03-17 12:43 UTC, Thorsten Behrens (CIB)

Note You need to log in before you can comment on or make changes to this bug.
Description Yaron Sheffer 2011-02-05 13:36:00 UTC
Impress crashes frequently on many different files, either during editing or just randomly.

I have re-initialized my user profile, it might have helped for a few hours but then the problem started again.

Please advise how I can provide more useful info, such as a crash dump.

Platform: Ubuntu 10.10.

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-, Ubuntu package 1:3.3.0-1maverick1
Comment 1 Yifan Jiang 2011-03-15 01:26:08 UTC
Hi Yaron, 

It would be helpful to attach your backtrace log when meeting a crash, please refer to:
Comment 2 Yifan Jiang 2011-03-15 01:32:57 UTC
Hi Thorsten,

I raised up the importance of this bug because I can nearly ALWAYS reproduce it in 10 minutes' using of Impress. But I could not get a exact steps of reproducing. What all I did to make the issue appearing are mostly switching my behavior in these three areas in an newly created empty presentation:

a. Switch to Normal tab, Add title in a slide, Add body text in a slide

b. Switch to Notes tab, Add some Notes

c. C-p to call out the printing dialog then cancel it

The crash will happen unpredictably(so far..) in any of the area.

I am attaching a backtrace when reproducing this.
Comment 3 Yifan Jiang 2011-03-15 01:33:43 UTC
Created attachment 44467 [details]
crash stack
Comment 4 Yifan Jiang 2011-03-15 02:23:02 UTC
Well, referring to the bug:

Find the always reproducible steps by chance:

    1. Launch Impress and create an empty presentation

    2. C-p to open the print dialog

    3. Close the dialog by clicking 'Cancel'

    4. Switch to Outline tab

    5. entering a character, "1" for example

=> Libreoffice Crash
Comment 5 Caolán McNamara 2011-03-15 05:38:53 UTC
Created attachment 44475 [details]
one plausible fix

So, when you activate the print dialog we get a print renderer which wants a DrawView. The print renderer stays around for the life of the ViewShellBase. The DrawView takes the current DrawViewShell, but that's destroyed when flipping when flipping views.

So, we either use a DrawView with a NULL DrawViewShell, or we take another reference to the current DrawViewShell and ensure it exists for the lifecycle of the DrawView. 

It doesn't *seem* to be the case that we actually need a DrawView with an attached DrawViewShell.
Comment 6 Thorsten Behrens (CIB) 2011-03-17 12:43:32 UTC
Created attachment 44557 [details]
Amended patch

Yeah, patch looks right for -3-3 surely, slightly amended to have the last unchecked use of that ptr covered.
Comment 7 Thorsten Behrens (CIB) 2011-03-17 12:44:54 UTC
@caolan, if you could ack that, I'll shove it into -3-3
Comment 8 Caolán McNamara 2011-03-17 13:01:59 UTC
looks good +1

as an aside I can see from our own auto-crash reports that we (and OOo) appear to have a similar problem in writer somewhere
Comment 9 Caolán McNamara 2011-03-18 01:51:01 UTC
*** Bug 35273 has been marked as a duplicate of this bug. ***
Comment 10 Thorsten Behrens (CIB) 2011-03-18 05:23:11 UTC
Fixed then.
Comment 11 Caolán McNamara 2011-04-04 08:37:12 UTC

this isn't in master, and it isn't in 3-4
Comment 12 Thorsten Behrens (CIB) 2011-04-04 15:12:41 UTC
Meh. Thought there was a ~regular merging going on ...
Comment 13 Caolán McNamara 2011-04-05 00:59:37 UTC
yeah, pmladek said he'd sync up unmerged 3-3 changes to master and 3-4 today which should recover this