<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - LibreOffice hangs after multiple PDF export calls"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=124797">124797</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LibreOffice hangs after multiple PDF export calls
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.1.2.1 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86 (IA32)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Writer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>essj@ccf.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
We have a web application which uses LibreOffice in headless mode to convert
HTML documents to PDF documents to be emailed to users.  After some time,
LibreOffice stops responding to connection requests. Our conversion code
reports the following exception:

00:52:24,196 [               ] ERROR xxx.xxx.ConvertHtmlToPDF       - Exception
converting document: null
com.sun.star.lang.DisposedException
        at
com.sun.star.lib.uno.environments.remote.JobQueue.removeJob(JobQueue.java:201)
        at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:308)
        at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:281)
        at
com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:81)
        at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:618)
        at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:145)
        at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:129)
        at com.sun.proxy.$Proxy372.storeToURL(Unknown Source)
        at xxx.xxx.ConvertHtmlToPDF.convert(Unknown Source)
        at xxx.xxx.DocumentConverter.convertHtmlToPdf(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor1169.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at
weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:117)
        at
weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:83)
        at
weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:142)
        at
weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:115)
        at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
        at
weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
        at
weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
        at
weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:301)
        at
weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:177)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3697)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
        at
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
        at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
        at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
        at
weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705)
        at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665)
        at
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
        at
weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at
weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at
weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at
weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at
weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)
Caused by: java.io.IOException: EOF reached -
socket,host=localhost,port=8100,localHost=localhost,localPort=47443,peerHost=localhost,peerPort=8100
        at
com.sun.star.lib.uno.bridges.java_remote.XConnectionInputStream_Adapter.read(XConnectionInputStream_Adapter.java:50)
        at java.io.DataInputStream.readInt(DataInputStream.java:387)
        at com.sun.star.lib.uno.protocols.urp.urp.readBlock(urp.java:364)
        at com.sun.star.lib.uno.protocols.urp.urp.readMessage(urp.java:96)
        at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.run(java_remote_bridge.java:92)
Caused by: com.sun.star.io.IOException: EOF reached -
socket,host=localhost,port=8100,localHost=localhost,localPort=47443,peerHost=localhost,peerPort=8100
        at
com.sun.star.lib.connections.socket.SocketConnection.read(SocketConnection.java:155)
        at
com.sun.star.lib.uno.bridges.java_remote.XConnectionInputStream_Adapter.read(XConnectionInputStream_Adapter.java:48)


Steps to Reproduce:
I will attach a sample application which can reproduce this issue. 

1. Unzip the file and cd into the StressDocumentConversionTest directory. 

2. start LibreOffice in headless mode:
soffice  --nofirststartwizard --headless --nologo
--accept="socket,host=localhost,port=8199,tcpNoDelay=1;urp;"

3. execute the "runTest.sh" script. The Java application will print out a
single '.' for each conversion.  It will report an exception when the issue
above is encountered. 

4. After execution, clean up the results of the many conversions executed by
executing "rm -r results"  

Actual Results:
The DocumentConversionTest application will terminate with an exception after
many executions. In my case, it takes around 1700.

com.sun.star.lang.DisposedException
        at
com.sun.star.lib.uno.environments.remote.JobQueue.removeJob(JobQueue.java:201)
        at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:308)
        at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:281)
        at
com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:81)
        at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:618)
        at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:145)
        at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:129)
        at com.sun.proxy.$Proxy5.storeToURL(Unknown Source)
        at
DocumentConversionTest.performConversion(DocumentConversionTest.java:123)
        at DocumentConversionTest.main(DocumentConversionTest.java:71)
Caused by: java.io.IOException: EOF reached -
socket,host=localhost,port=8199,localHost=localhost,localPort=54295,peerHost=localhost,peerPort=8199
        at
com.sun.star.lib.uno.bridges.java_remote.XConnectionInputStream_Adapter.read(XConnectionInputStream_Adapter.java:50)
        at java.io.DataInputStream.readInt(DataInputStream.java:387)
        at com.sun.star.lib.uno.protocols.urp.urp.readBlock(urp.java:364)
        at com.sun.star.lib.uno.protocols.urp.urp.readMessage(urp.java:96)
        at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.run(java_remote_bridge.java:92)
Caused by: com.sun.star.io.IOException: EOF reached -
socket,host=localhost,port=8199,localHost=localhost,localPort=54295,peerHost=localhost,peerPort=8199
        at
com.sun.star.lib.connections.socket.SocketConnection.read(SocketConnection.java:155)
        at
com.sun.star.lib.uno.bridges.java_remote.XConnectionInputStream_Adapter.read(XConnectionInputStream_Adapter.java:48)
        ... 4 more
.DocumentConversionTest terminated with 1740 documents converted

Expected Results:
LibreOffice should continue accepting connections and converting documents. 


Reproducible: Sometimes


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
The Linux LibreOffice version is as follows:
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 24; OS: Linux 3.10; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group threaded

The OpenGL information is as follows:

glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 6.0, 128 bits)
OpenGL version string: 2.1 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:


It is also possible to run this test on Windows, though it will fail with a
different exception.  Using the same version of LibreOffice on Windows 7, I
receive the following exception after around 1300 conversions:

com.sun.star.io.IOException: SfxBaseModel::impl_store
<file:/C:/projects/StressDocumentConversionTest/results/01236/resu
ltDocument.pdf> failed: 0xc10(Error Area:Io Class:Write Code:16)
        at
com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:158)
        at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:122)
        at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:312)
        at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:281)
        at
com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:81)
        at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:618)
        at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:145)
        at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:129)
        at com.sun.proxy.$Proxy5.storeToURL(Unknown Source)
        at
DocumentConversionTest.performConversion(DocumentConversionTest.java:122)
        at DocumentConversionTest.main(DocumentConversionTest.java:71)

The Windows version information is as follows:
Version: 6.1.2.1 (x64)
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 8; OS: Windows 6.1; UI render: default; 
Locale: en-US (en_US); Calc: CL</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>