[Libreoffice] Unexpected failures (eg. segfaults) using PyUNO and LibreOffice/OpenOffice

Dag Wieers dag at wieers.com
Wed Oct 19 01:17:41 PDT 2011


Hi,

During the course of the LibreOffice conference in Paris, we (the unoconv and 
cloudooo projects) found that some of the issues our users were having while 
doing document conversions using PyUNO and OpenOffice and LibreOffice were not 
related to our own project, but have a root-cause in either PyUNO or 
LibreOffice/OpenOffice.

The result of these issues are various and individual:

   - segfaults
   - various error codes
   - PyUNO crashes
   - memory leaks
   - xslt problems

And while some of them are reproducable (and consistent), others are not, which 
makes me believe they are related to internal state or timing issues of 
LibreOffice/OpenOffice or related to import/export filters.

Since these issues are very common and can be triggered very quickly, we would 
like to have developers look at them to see what is the cause and how we can 
fix them.

The cloudooo project has tested about 100.000 conversions and implemented some 
techniques to overcome the issues by monitoring the libreoffice process for 
memory leaks and 'endless loops', and retrying on failure. In the end this 
brought the failure rate down from about 10% tot 1.1%.
(http://git.erp5.org/gitweb/cloudooo.git)

Both the cloudooo and unoconv presentations will become available and 
contain some information on both projects and the PyUNO/LO unreliabilities.

It is fairly easy to reproduce these problems on your own system by using the 
latest unoconv code from: http://github.com/dagwieers/unoconv

You do not have to install anything, you can run it from the directory it was 
cloned in. The tests/ directory has a Makefile that does some batch conversions 
to different formats and exposes the problems quickly.

On my system with RHEL6's OpenOffice v3.2.1 and LibreOffice v3.3.4 and 3.4.3 
RPMs installed, I can run resp.

      make -C tests
      UNO_PATH=/opt/libreoffice make -C tests
      UNO_PATH=/opt/libreoffice3.4 make -C tests

to test each of the versions. Of course if you have a large collection of 
documents you can have unoconv convert those in batch. Below is some example 
failure output from a single run, LibreOffice does seem a bit more stable 
than OpenOffice though.

OpenOffice v3.2.1 from ODT to BibTeX:
----
unoconv: UnoException during conversion in <class '__main__.com.sun.star.task.ErrorCodeIOException'> (Error 2074)
----

OpenOffice v3.2.1 from ODT to OOXML:
----
Warning: at xsl:stylesheet on line 28 of 
file:///usr/lib64/openoffice.org/basis3.2/share/xslt/export/wordml/ooo2wordml.xsl:
   Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
Warning: at xsl:variable on line 1869 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/wordml/ooo2wordml_draw.xsl:
   SXWN9001: A variable with no following sibling instructions has no effectmeasure_conversion.xsl: Find no conversion for  to 'twip'!
Error on line 1038 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/wordml/ooo2wordml_draw.xsl:
    XPTY0004: A sequence of more than one item is not allowed as the first
    argument of
    string-length() ("Availability and work interest...", "My technical
    experience and in...", ...)
unoconv: UnoException during conversion in <class '__main__.com.sun.star.task.ErrorCodeIOException'> (Error 3088)
----

OpenOffice v3.2.1 from ODT to LaTeX:
----
unoconv: UnoException during conversion in <class '__main__.com.sun.star.task.ErrorCodeIOException'> (Error 2074)
----

OpenOffice v3.2.1 from ODT to UOT:
----
# 
#  A fatal error has been detected by the Java Runtime Environment:
# 
#   SIGSEGV (0xb) at pc=0x00000037a0243981, pid=24672, tid=140204794906400
# 
#  JRE version: 6.0_22-b22
#  Java VM: OpenJDK 64-Bit Server VM (20.0-b11 mixed mode linux-amd64 compressed oops)
#  Derivative: IcedTea6 1.10.3
#  Distribution: Red Hat Enterprise Linux Server release 6.1 (Santiago), package rhel-1.40.1.10.3.el6-x86_64
#  Problematic frame:
#  C  [libuno_sal.so.3+0x43981]  rtl_uString_release+0x1
# 
#  An error report file with more information is saved as:
#  /home/dag/home-made/unoconv/tests/hs_err_pid24672.log
pure virtual method called
terminate called without an active exception
----

OpenOffice v3.2.1 from ODT to XHTML:
----
Warning: at xsl:stylesheet on line 58 of file:///usr/lib64/openoffice.org/basis3.2/share/xslt/export/xhtml/opendoc2xhtml.xsl:
   Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
Error on line 1862 column 8 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/xhtml/body.xsl:
    SXXP0003: Error reported by XML parser: The element type "xsl:choose" must
    be terminated
    by the matching end-tag "</xsl:choose>".
Error at xsl:copy-of on line 166 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
    XPST0008: XPath syntax error at char 30 on line 166 in {...t($sourceBaseURL,
    'styles.x...}:
     Variable $sourceBaseURL has not been declared
Error at xsl:copy-of on line 169 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
    XPST0008: XPath syntax error at char 30 on line 169 in
    {...cat($sourceBaseURL, 'meta.x...}:
     Variable $sourceBaseURL has not been declared
Error at xsl:if on line 376 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
    XPST0008: XPath syntax error at char 23 on line 376 in
    {$onlyStyleOutputEnabled}:
     Variable $onlyStyleOutputEnabled has not been declared
Error at xsl:when on line 595 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
    XPST0008: XPath syntax error at char 23 on line 595 in
    {$onlyStyleOutputEnabled}:
     Variable $onlyStyleOutputEnabled has not been declared
Error at xsl:for-each on line 694 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
    XPST0008: XPath syntax error at char 23 on line 694 in
    {document($stylesFileURL)}:
     Variable $stylesFileURL has not been declared
Error at xsl:if on line 70 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/xhtml/header.xsl:
    XPST0008: XPath syntax error at char 13 on line 70 in {$debugEnabled}:
     Variable $debugEnabled has not been declared
Error at xsl:if on line 75 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/xhtml/header.xsl:
    XPST0008: XPath syntax error at char 13 on line 75 in {$debugEnabled}:
     Variable $debugEnabled has not been declared
Error at xsl:if on line 80 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/xhtml/header.xsl:
    XPST0008: XPath syntax error at char 13 on line 80 in {$debugEnabled}:
     Variable $debugEnabled has not been declared
Error at xsl:call-template on line 545 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
   XTSE0650: No template exists named convert2pt
Error at xsl:call-template on line 551 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
   XTSE0650: No template exists named convert2pt
Error at xsl:call-template on line 619 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
   XTSE0650: No template exists named start-main
Error at xsl:call-template on line 624 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
   XTSE0650: No template exists named start-main
Error at xsl:call-template on line 629 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_collector.xsl:
   XTSE0650: No template exists named start-main
Error at xsl:call-template on line 338 of file:/usr/lib64/openoffice.org/basis3.2/share/xslt/export/common/styles/style_mapping_css.xsl:
   XTSE0650: No template exists named convert2cm
unoconv: UnoException during conversion in <class '__main__.com.sun.star.task.ErrorCodeIOException'> (Error 3088)
----

Kind regards,
-- 
-- dag wieers, dag at wieers.com, http://dag.wieers.com/
-- dagit linux solutions, info at dagit.net, http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]


More information about the LibreOffice mailing list