Issue 119678 - OpenOffice service soffice.bin becomes unresponsive/hung and hijacks CPU and memory
Summary: OpenOffice service soffice.bin becomes unresponsive/hung and hijacks CPU and ...
Status: UNCONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC All
: P3 Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact: Peggy Fobbe
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-01 18:12 UTC by jsdivi
Modified: 2017-05-20 11:55 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
snapshot of memory and CPU trend of soffice.bin (72.99 KB, image/png)
2012-06-01 18:12 UTC, jsdivi
no flags Details
OO template that shows the problem (11.43 KB, application/msword)
2012-10-15 18:16 UTC, adeptive.mike
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description jsdivi 2012-06-01 18:12:00 UTC
Created attachment 77890 [details]
snapshot of memory and CPU trend of soffice.bin

We use OOo to generate word documents, OOo runs as service,our Java application  pulls data from Database which includes plain text, html content with RTF data  and files like jpgs from local filesystem and puts them in placeholders in odt template. RTF content mentioned above comes from TinyMCE - Javascript WYSIWYG Editor of our web application, here RTF content is pasted from MicroSoft WORD documents.

Some of the UNO API used are 

xReplaceDescriptor.setReplaceString(replaceStr) where replaceStr could HTML content

OR

XDocumentInsertable xDocumentInsertable = (XDocumentInsertable) UnoRuntime.queryInterface(XDocumentInsertable.class, xTextCursor);
xDocumentInsertable.insertDocumentFromURL(strFileUrl, insertArgs);// Inserts the document that is specified by the URL, strFileUrl is a HTML file with RTF content.

Most of the time above API work fine but we noted critical failures when there are special HTML attributes in the RTF content or if there is ill formatted HTML like nested SPAN tags without matching close tags.

For example 'class=Note' attribute of <P> tag causing soffice.bin hang and CPU and memory hijack. Below is sample tags causing this problem

<P style="MARGIN: 6pt 3.5in 6pt 0.5in" class=Note _mce_style="margin-bottom: 0pt;margin: 6pt 3.5in 6pt 0.5in;" ><FONT size=2 face=Arial> </FONT></P>
<P style="MARGIN: 6pt 3.5in 6pt 0.5in" class=Note _mce_style="margin-bottom: 0pt;margin: 6pt 3.5in 6pt 0.5in;" ><FONT size=2 face=Arial>To update the table of contents, put the cursor anywhere in the table and press [F9].<SPAN style="mso-spacerun: yes" _mce_style="mso-spacerun: yes;">  </SPAN>To change the number of levels displayed, select the menu option Insert-&gt;Index and Tables, make sure the Table of Contents tab is active, and change the Number of Levels to a new value.</FONT></P></DIV>

See Attached is snapshot of memory and CPU trend of soffice.bin process

Below is sample stacktraces when soffice.bin is hung

WebContainer : 0" Priority=5 Thread Id=101 In State : WAITING
at java.lang.Object.wait(Native Method)
at com.sun.star.lib.uno.environments.remote.JobQueue.removeJob(JobQueue.java:289)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:399)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:372)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:132)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:902)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:851)

AND

 0000000d ThreadMonitor W   WSVR0605W: Thread "WebContainer : 23" (0000009b) has been active for 624507 milliseconds and may be hung.  There is/are 1 thread(s) in total in the server that may be hung.
	at java.lang.Object.wait(Native Method)
	at com.sun.star.lib.uno.environments.remote.JobQueue.removeJob(JobQueue.java:289)
	at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:399)
	at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:372)
	at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:132)
	at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:902)
	at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:851)
	at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:177)
	at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:163)
	at $Proxy30.storeAsURL(Unknown Source)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:177)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:163)
at $Proxy10.getString(Unknown Source)


Are there any fixes or workarounds for these issues?

We have partial success when HTML content is cleaned with utilities like jTidy API before passing to OpenOffice service

Are there any utilities at UNO API level to discard above mentioned HTML attributes or ill formatted HTML

Quick response is appreciated, let us know if you need more details in reproducing the issue
Comment 1 jsdivi 2012-06-01 18:19:30 UTC
Please refer to below stacktrace,other one in bug is mixed up

WebContainer : 0" Priority=5 Thread Id=101 In State : WAITING
at java.lang.Object.wait(Native Method)
at com.sun.star.lib.uno.environments.remote.JobQueue.removeJob(JobQueue.java:289)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:399)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:372)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:132)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:902)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:851)at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:177)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:163)
at $Proxy10.getString(Unknown Source)

AND

 0000000d ThreadMonitor W   WSVR0605W: Thread "WebContainer : 23" (0000009b) has been active for 624507 milliseconds and may be hung.  There is/are 1 thread(s) in total in the server that may be hung.
	at java.lang.Object.wait(Native Method)
	at com.sun.star.lib.uno.environments.remote.JobQueue.removeJob(JobQueue.java:289)
	at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:399)
	at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:372)
	at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:132)
	at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:902)
	at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:851)
	at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:177)
	at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:163)
	at $Proxy30.storeAsURL(Unknown Source)
Comment 2 jvchbabu 2012-06-07 09:25:04 UTC
We are facing the same issue and it is happening consistently.
None of the word documents are generated,please look into this issue and provide approximate time lines for fix or workarounds if any.
Comment 3 adeptive.mike 2012-10-15 18:16:00 UTC
Created attachment 79781 [details]
OO template that shows the problem
Comment 4 adeptive.mike 2012-10-15 18:19:03 UTC
I have attached a template that shows very similar behavior. If I try to save this template in OpenOffice native format, or most other formats, it's fine. If I try to save in with the "Word 95" or "Word 97" filters, it hangs (soffice.bin CPU utilization goes to 100% and it never returns). I am running OpenOffice 3.4.1 on 64-bit Windows 7, but the problem happens on other hardware as well.

This may also be related to bugs 97227 and 82500.