Bug 124797 - LibreOffice hangs after multiple PDF export calls
Summary: LibreOffice hangs after multiple PDF export calls
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.2.1 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-17 14:14 UTC by essj
Modified: 2020-09-02 00:03 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple test application (3.91 MB, application/x-zip-compressed)
2019-04-17 14:59 UTC, essj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description essj 2019-04-17 14:14:19 UTC
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
Comment 1 essj 2019-04-17 14:59:54 UTC
Created attachment 150828 [details]
Simple test application

Unzip and look at README.txt.  I have also included in this zip file a nohup.out file from my Linux server that records a backtrace for one of these failures.
I looked at the OpenGL setting for both my Windows and Linux instances and both were turned off.  I turned the Windows OpenGL setting on and the conversion failed after 1240 runs.  Interestingly, LibreOffice did not hang.  It crashed and displayed the recovery dialog.
Comment 2 Xisco Faulí 2019-06-10 16:50:00 UTC Comment hidden (obsolete)
Comment 3 essj 2019-06-10 18:57:59 UTC
I tested with the following version on Windows and the issue is still occurring:

Version: 6.1.6.3 (x64)
Build ID: 5896ab1714085361c45cf540f76f60673dd96a72
CPU threads: 8; OS: Windows 6.1; UI render: default; 
Locale: en-US (en_US); Calc: CL

I have a request in to our support organization to update one of our Linux servers to this version.  I will update when that is done.
Comment 4 Xisco Faulí 2019-06-10 19:59:31 UTC
Does it happen with any document or with a specific one ? If so, please attach it here...
Comment 5 essj 2019-06-10 20:09:36 UTC
The files in our production environment are created from a particular template, so they all share similar qualities.  The document used in the test application is located in the "source" directory of the attached zip file "Simple test application"
Comment 6 QA Administrators 2019-06-11 03:02:01 UTC Comment hidden (obsolete)
Comment 7 Dieter 2020-02-03 19:39:21 UTC
A new major release of LibreOffice is available since this bug was reported. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 8 QA Administrators 2020-08-02 03:39:58 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2020-09-02 00:03:04 UTC
Dear essj,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp