Apache OpenOffice (AOO) Bugzilla – Issue 120389
OO crashes when I Print
Last modified: 2016-11-03 07:42:09 UTC
Created attachment 78749 [details] see title OO 3.4 repeatedly and reproducably crashes when I've a couple of writer docs open and I print. Unfortunately, I cannot send you the files that cause reliable crashes, as they contain private info. so I modified them by replacing and inserting some chars; printing "crash test 2" appears to reliably crash OO. I include a couple of crash dumps from these, as well as some other dumps when editing different files. Arthur
Created attachment 78750 [details] crash dump
Created attachment 78751 [details] input file 1
Created attachment 78752 [details] input file 2 second input file
Wow! Absolutely no response in 10 days. I see this as strong evidence that OpenOffice is, sadly, dying. Can anyone persuade me otherwise? If not, I'll plan accordingly. Thanks for the fun ride Arthur
I can only reproduce the crash on Fedora Linux x86-64 with attachment 78752 [details] Reproduced on AOO341 m1 9593 revision 1369843 It crashes even if you don't print: - open document in attachment 78752 [details] - open the dialog from "File" - "Print..." - Press the "Cancel" button - AOO crashes. Confirming Requesting release blocker status.
(In reply to comment #4) > Wow! Absolutely no response in 10 days. > I see this as strong evidence that OpenOffice is, sadly, dying. Can anyone > persuade me otherwise? Many of us are volunteers, working on our spare time; so sometimes you have to make a little noise, to get attention on your bug. ;)
>- open document in attachment 78752 [details] >- open the dialog from "File" - "Print..." >- Press the "Cancel" button >- AOO crashes. i can reproduce crash on win 7 64bit with aoo3.4.1 rev 1369843
taking for further investigation to find root cause and a possible solution. I could reproduce a crash on Windows 7 using the description in comment https://issues.apache.org/ooo/show_bug.cgi?id=120389#c5 with - released AOO 3.4 - AOO 3.4.1 developer snapshot, rev. 1354891 - AOO 3.4.1 developer snapshot, rev. 1369110 - my local trunk build, rev. 1367858
OOo 3.4 Beta also crashes when reproducing the steps from comment #5
adjusting platform accordingly.
der release blocker flag
crash is triggered by print options for comments. As long as option "None" is chosen no crash occurs. simplified steps to reproduce the crash: - new text document - Menu Tools - Option - Writer - Print - options for comments -- choose "only Comments" or "end of document" or "end of page" - confirm option dialog - Menu File - Print - Print or Cancel print --> crash
Thanks everyone. I've converted Importance to Major.
root cause: For the print of the comments an own document (<SwDoc> instance) and an own view shell (<ViewShell> instance) are created. The later deletion of this view shell also deletes the created document. The deletion of the document triggers certain notifications to the still existing layout. This triggers updates on the view shell which is already "half" deleted. --> accessing "dead" memory --> crash. So far I did not find the change made to OOo 3.4 Beta which triggers this defect. solution: The render data (<SwRenderData> instance) which creates the document and the view shell takes now explicit ownership of the document by corresponding <acquire()> call. Thus, the deletion of the view shell does not trigger the deletion of the document anymore. But, the render data itself has to release the document and (if needed) has to delete the document. Patch will be attached soon. note: During debugging I recognized a memory leak. The document and the view shell for printing comments are created more than once by the print dialog without triggering a deletion of former created once. The patch will also solves this.
Created attachment 78898 [details] patch to solve this defect
After some further local test I will commit the patch.
Comment on attachment 78898 [details] patch to solve this defect requesting review of patch
The patch on attachment 78898 [details] works fine. @ arthurgoldberg: note that selecting in the Options dialog to print no comments at all won't solve the issue with your document that crashes (not until this fix is applied and released), because that print option is stored inside the document. I couldn't find a way to modify this document print setting in the user interface, but if you want to print that document anyway, you can use a macro to change the option: Sub SetPrintAnnotationMode Dim oDoc as Object oDoc = ThisComponent If HasUnoInterfaces( oDoc, "com.sun.star.lang.XServiceInfo") and _ oDoc.supportsService("com.sun.star.text.TextDocument") Then Dim oDocSettings as Object oDocSettings = oDoc.createInstance("com.sun.star.text.DocumentSettings") oDocSettings.setPropertyValue("PrintAnnotationMode",_ com.sun.star.text.NotePrintMode.NOT) End If End Sub Run this macro on every document that crashes when trying to print it. It has the drawback that comments won't be printed, but at least lets you print the document.
@Ariel: Thanks for reviewing the patch. @arthurgoldberg: The print option for comments can be changed in the UI via Menu - Tools - Writer - Print. But afterwards you have to save the document, close it and reopen it before you try to print it.
Comment on attachment 78898 [details] patch to solve this defect another try to request the patch review ;-)
ALG: Updated my AOO34 trunk, built, installed, used comment12 -> crash. Applied patch/attachment 78898 [details], built, updated sw libs, used comment12 -> works. Tried on win7. Patch looks good, source changes make sense.
"orw" committed SVN revision 1371648 into trunk: #120389# - Printing in Writer
"orw" committed SVN revision 1371655 into branches/AOO34: #120389# - Printing in Writer
According comments, I change status to Resolved.
(In reply to comment #19) > @Ariel: > Thanks for reviewing the patch. > > @arthurgoldberg: > The print option for comments can be changed in the UI via Menu - Tools - > Writer - Print. But afterwards you have to save the document, close it and > reopen it before you try to print it. @Oliver-Rainer Thanks for your great work investigating and patching this bug. @Ariel and @Oliver-Rainer Thanks much for your printing work-arounds: I find that preferences - writer - print - comments <- "none" immediately before printing avoids a crash. However, closing and reopening the file restores comments to "end of page". but that's fine, I can print reliably, and will install the upgrade when it's released. Thanks again everyone else who helped too. Arthur
Verify pass according Comment12, with AOO341 r1372282 on Window XP, Redhat and Mac
Comment on attachment 78898 [details] patch to solve this defect defect fixed