[Libreoffice-bugs] [Bug 124798] New: Headless Writer conversion to PDF consumes is stuck at 100% CPU usage

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Apr 17 14:58:06 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=124798

            Bug ID: 124798
           Summary: Headless Writer conversion to PDF consumes is stuck at
                    100% CPU usage
           Product: LibreOffice
           Version: 6.2.2.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: documentfoundation at goeddel.net

Description:
We are developing a software which create ODT files and then uses lowriter to
convert the file to PDF.

For some reason this is not working with every document we are giving to
writer. It seems to work with some documents but not with others. However, it
always works when opening the ODT using the UI and then press the "Export to
PDF" button.

Steps to Reproduce:
There are two versions to reproduce this bug:
A) Using convert-to:
1. Save the ODT file stored as attachment to this bug report on your harddrive,
say to /tmp/failure.odt
2. Start the following command in the terminal:
lowriter --headless --convert-to pdf:writer_pdf_Export --outdir /tmp
/tmp/failure.odt
3. While the process is running look into htop or a similar utility to see that
soffice.bin shows 100% CPU usage and never stops to do that.
4. Wait some minutes or longer if you want to, but even after an hour it will
not stop. You can kill it now.

B) Using a macro:
1. Save the ODT file stored as attachment to this bug report on your harddrive,
say to /tmp/failure.odt
2. Create a new Module in the Standard library, e.g. Module1 and write a simple
script to create a PDF:

REM =========================
Sub Main(Optional filename As String)

        Dim storeChanges as Boolean

        If IsMissing(filename) Then
                document = ThisComponent
                filename = ConvertToURL("/tmp/failure.odt")
                storeChanges = False
        Else
                document =
StarDesktop.loadComponentFromURL(ConvertToURL(filename), "_blank", 0, Array())
                storeChanges = True
        End If

        dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

        'Export to PDF
        dim args1(1) as new com.sun.star.beans.PropertyValue
        args1(0).Name = "URL"
        args1(0).Value = filename + ".pdf"
        args1(1).Name = "FilterName"
        args1(1).Value = "writer_pdf_Export"

        msgbox(args1(0).Value)

        dispatcher.executeDispatch(document.CurrentController.Frame,
".uno:ExportDirectToPDF", "", 0, args1())

        If storeChanges Then
                document.store()
                document.close(True)
        End If

End Sub
REM ==================================
3. Close Writer and every other office process.
4. Call the following command from the terminal:
lowriter --headless "macro:///Standard.Module1.Main(\"/tmp/failure.odt\")"
5. While the process is running look into htop or a similar utility to see that
soffice.bin shows 100% CPU usage and never stops to do that.
6. Wait some minutes or longer if you want to, but even after an hour it will
not stop. You can kill it now.

Actual Results:
Just 100% CPU usage and no result.

Expected Results:
A nice PDF within seconds.


Reproducible: Always


User Profile Reset: No



Additional Info:
It may have to do with embedded graphics. It seems to work when the attribute
svg:height or svg:width of <draw:frame> has a lower value or no value. Maybe
there is something going in an infinite loop while layouting these frames which
does not go in a loop when using the UI.

Version: 6.2.2.2
Build-ID: 1:6.2.2-0ubuntu0.18.04.1~lo1
CPU-Threads: 8; BS: Linux 4.4; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190417/1a94ceb7/attachment.html>


More information about the Libreoffice-bugs mailing list