Bug 55587 - Libreoffice segfaults when trying to shut it down with .uno:Quit
Summary: Libreoffice segfaults when trying to shut it down with .uno:Quit
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-03 17:27 UTC by sergio.callegari
Modified: 2014-11-06 16:18 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sergio.callegari 2012-10-03 17:27:17 UTC
Hi,

and I have some scripts that rely on .uno:Quit it to shut down libreoffice after some operations have been done.

Most of the time, everything goes nice. However, after having processed some documents libreoffice segfaults when calling .uno:Quit. This is systematic. For instance, I have a bash script to export presentation slides in pdf, that goes like

${SOFFICE} ${SOFFICE_OPTIONS} \
      $CMDPREFIX.SaveSlidesAsPDF\($fullname\) ".uno:Quit"

where SaveSlidesAsPDF is a macro inserted in libreoffice to do the PDF export.
Now, with certain documents everything is fine. With others, after the export rather than quitting libreoffice segfaults. Note that the problem is not in the export: libreoffice produces a valid PDF file.

When crashing libreoffice says:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000000000030, pid=11707, tid=140390183426304
#
# JRE version: 6.0_24-b24
# Java VM: OpenJDK 64-Bit Server VM (20.0-b12 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea6 1.11.4
# Distribution: Ubuntu 12.04 LTS, package 6b24-1.11.4-1ubuntu0.12.04.1
# Problematic frame:
# C  0x0000000000000030
[error occurred during error reporting (printing problematic frame), id 0xb]

# An error report file with more information is saved as:
# /home/callegar/Documents/Didattica/Slides/EEAS_2012-13/hs_err_pid11707.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
#

[error occurred during error reporting , id 0xb]

Maybe mine is a bit of a corner case. However, the application should never segfault in this way.
Comment 1 Julien Nabet 2012-10-06 21:08:53 UTC
Could you attach the batch script?

Could you try to retrieve an useful bt by following this link? http://wiki.documentfoundation.org/BugReport#How_to_get_backtrace_.28on_Linux.29
Comment 2 QA Administrators 2013-09-24 01:48:16 UTC
Dear Bug Submitter,

This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INVALID due to lack of needed information.

For more information about our NEEDINFO policy please read the wiki located here: 
https://wiki.documentfoundation.org/QA/FDO/NEEDINFO

If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed.


Thank you for helping us make LibreOffice even better for everyone!


Warm Regards,
QA Team
Comment 3 sergio.callegari 2013-09-25 08:38:48 UTC
Hi:

The issue is triggered by calling the following macro and then trying to exit.


Sub SaveSlidesAsPDF(srcFile)

srcURL = ConvertToURL( srcFile )

dim oPropDoc(0) as New com.sun.star.beans.PropertyValue
oPropDoc(0).Name="Hidden"
oPropDoc(0).Value=True

'msgbox(srcURL)

oDoc = StarDesktop.loadComponentFromURL( srcURL, "_blank", 0, _
  oPropDoc())
            
pdfFile=Left(srcFile,Len(srcFile)-4)+".pdf"
pdfURL=ConvertToURL( pdfFile )

Dim oPropPDF(1) As New com.sun.star.beans.PropertyValue
oPropPDF(0).Name="ExportNotesPages"
oPropPDF(0).Value=true

Dim oProp(3) As New com.sun.star.beans.PropertyValue
oProp(0).Name="Overwrite"
oProp(0).Value=true
oProp(1).Name="FilterName"
oProp(1).Value="impress_pdf_Export"
oProp(2).Name="FilterData"
oProp(2).Value=oPropPDF()

oDoc.storeToURL(pdfURL,oProp())

oDoc.close( True )

End Sub


The thing is invoked via a bash script that does

${SOFFICE} ${SOFFICE_OPTIONS} \
      $CMDPREFIX.SaveSlidesAsPDF\($fullname\) ".uno:Quit"

Where:
  SOFFICE is /usr/bin/libreoffice4.1
  CMDPREFIX is the place where the macro is stored inside libreoffice, in my case macro:///SC_PDF_Export.lib
  fullname is the name of an odp file that is passed to the script

for instance

libreoffice macro:///SC_PDF_Export.lib.SaveSlidesAsPDF\(file://$PWD/test.odp\) .uno:Quit

The basic script executes just fine. Indeed the pdf document is correctly generated. However when getting to the ".uno.Quit", libreoffice segfaults.

The issue is still present in 4.1.2RC2

SOME NOTES

1) Without the final .uno.Quit libreoffice does not segfault.
2) With --backtrace libreoffice does not segfault, so it is impossible to take a backtrace
3) Apparently there is not anymore the need for the final .uno:Quit, because after the macro libreoffice exits by itself (with previous versions of libreoffice and with openoffice this was not the case and .uno:Quit was indispensable to eventually exit libreoffice)
4) Even if the .uno:Quit is now redundant, it should not make libreoffice segfault.

Please, switch to confirmed if this information is enough.
Comment 4 Julien Nabet 2013-09-25 20:10:42 UTC
Sergio: thank you for your feedback. I'm not familiar with Macro but with information provided, I'll switch to NEW.

Noel: one for you?
Comment 5 sergio.callegari 2014-11-06 16:18:08 UTC
Hi, this is probably fixed in current 4.3.

Marking as resolved. I will reopen if needed.