Bug 33947

Summary: Impress: print renderer owns a DrawView that references a destroyed DrawViewShell
Product: LibreOffice Reporter: Yaron Sheffer <yaronf>
Component: PresentationAssignee: Thorsten Behrens <thb>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high CC: caolanm, maand
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: crash stack
one plausible fix
Amended patch

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-3.3.0.4, 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:

http://wiki.documentfoundation.org/BugReport#How_to_get_backtrace_.28on_Linux.29
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:

https://bugs.freedesktop.org/show_bug.cgi?id=35273

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] [review]
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 2011-03-17 12:43:32 UTC
Created attachment 44557 [details] [review]
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 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 2011-03-18 05:23:11 UTC
Fixed then.
Comment 11 Caolán McNamara 2011-04-04 08:37:12 UTC
So...

this isn't in master, and it isn't in 3-4
Comment 12 Thorsten Behrens 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

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.