Apache OpenOffice (AOO) Bugzilla – Issue 82210
bootstrap hangs one second run of program
Last modified: 2013-07-30 02:36:55 UTC
I have a simple c# program that opens a doc hidden and closes it again, This is to just show this issue. When I run the program a second time the call to bootstrap hangs, I have to then kill the program and soffice.bin before I can use any openoffice programs. The document I am opening is the rtf spec saves a a odt file. If I run it without hidden it does not have the issue. also if I run and connect to a socket its works. I think it is to do with the number of tables in the document. The code is in c# and run on windows XP. Open Office is quick start is running. Code... ########################### using System; using System.Collections.Generic; using System.Text; using unoidl.com.sun.star.lang; using unoidl.com.sun.star.uno; using unoidl.com.sun.star.bridge; using unoidl.com.sun.star.frame; using unoidl.com.sun.star.beans; namespace OpenOfficeText { class Program { //Define a file name. Change this to an existing path! // file to open. private static string FileName = @"C:\Word 2002 RTF Specification\Word 2002 RTF Specification Final.odt"; [STAThread] static void Main(string[] args) { TestOpenOffice(); } static void TestOpenOffice() { //Call the bootstrap method to get a new ComponentContext //object. If OpenOffice isn't already started this will //start it and then return the ComponentContext. // this lines hangs on second run of program. unoidl.com.sun.star.uno.XComponentContext localContext = uno.util.Bootstrap.bootstrap(); //Get a new service manager of the MultiServiceFactory type //we need this to get a desktop object and create new CLI //objects. unoidl.com.sun.star.lang.XMultiServiceFactory multiServiceFactory = (unoidl.com.sun.star.lang.XMultiServiceFactory) localContext.getServiceManager(); //Create a new Desktop instance using our service manager //Notice: We cast our desktop object to XComponent loader //so that we could load or create new documents. XComponentLoader componentLoader = (XComponentLoader)multiServiceFactory.createInstance( "com.sun.star.frame.Desktop"); // Create without the GUI //sett the property unoidl.com.sun.star.beans.PropertyValue[] propertyValue = new unoidl.com.sun.star.beans.PropertyValue[1]; unoidl.com.sun.star.beans.PropertyValue aProperty = new unoidl.com.sun.star.beans.PropertyValue(); aProperty.Name = "Hidden"; aProperty.Value = new uno.Any(true); propertyValue[0] = aProperty; //Create a new blank writer document using our component //loader object. XComponent xComponent = componentLoader.loadComponentFromURL( //"private:stream", PathConverter(FileName), "_blank", 0, //into a blank frame use no searchflag propertyValue ); xComponent.dispose(); } /// The converted file to URL private static string PathConverter(string file) { try { file = file.Replace(@"\", "/"); return "file:///" + file; } catch (System.Exception ex) { throw ex; } } } } ###########################
Created attachment 48668 [details] File That is open to show the hang
->Jochen, could you please take care of this ? Thanks.
The client process is not able to connect to the office. That is, the thread that creates the connection is caught up in a for loop where it tries to connect to the office via XUnoUrlResolver::resolve (cppuhelper/source/bootstrap.cxx, bootstrap() ) Interestingly there is no problem when the "Hidden" property false.
Created attachment 50091 [details] stacks of the office threads
jl->as: Please have a look at the stacks which I attached.
Created attachment 50092 [details] a working document
The bug does also not occur with the attached test.odt which is a very small document. So the problem depends on: 1. The way loadComponentFromUrl is used 2. the document used. jl->as: Please investigate further. Contact me if you need help with setting up the test scenario.
cc to myself.
Created attachment 50107 [details] code without build errors
Notes for setting up the scenario: 1.Create a C# console application with VS 2003 2.Substitute the code with the one attached. 3.Add references to cli assemblies which are in office/program/assembly in the solution explorer. 4.Install OOo completely, that is do not do an administrative installation.
AS: This problem occures under very rare circumstances only. a) It can be reproduced by using these special "Word RTF...odt" document only .. b) in case it's loaded in hidden state ... c) and using the remote uno bridge only (doesnt matter which language is used by the client ... e.g. I've tried it with a small Java example). It cant be reproduced by loading the same document inside the office process (e.g. by using a small basic macro) nor by loading other documents. The set of stacks attached to this issue doesnt show a classic deadlock. On some debug sessions I've found out that there must be a memory corruption. First the uno bridge detects some errors on reading bytes from the socket and close the connection. That will match to the fact that the bridge was closed and no further connections are possible ... But after that he office itself will become unusable. No repaints will happen nor it can be used in general ... it's frozen completely. But the mainthread wait's for messages ... but never will get one. So it seams that the windows queue mechanism of windows itself was damaged at this point. This task needs some further investigations ... but it seams it can be finished within a 2.4 time frame. So I will set a more approiate target.
has this issue been fixed in 2.4 current release candidate?
AS: Because it can be reproduced with the attached special test document only (not with other documents) these task isnt a bug related to uno bootstrap in real. Seams to be a problem of the document itself (more related to the filter!). New target OOo Later.
Hello, there's been a solution offered in the forum: http://www.oooforum.org/forum/viewtopic.phtml?t=63543 by Thant Zin Please search setup.xcu in your Program Files Folder. Then open the file and replace <prop oor:name="ooSetupInstCompleted"> <value>false</value> </prop> <prop oor:name="ooSetupShowIntro"> <value>true</value> </prop> with <prop oor:name="ooSetupInstCompleted" oor:type="xs:boolean"> <value>true</value> </prop> <prop oor:name="LicenseAcceptDate" oor:type="xs:string"> <value>2008-12-25T17:34:04</value> </prop> <prop oor:name="FirstStartWizardCompleted" oor:type="xs:boolean"> <value>true</value> </prop>
Reset assignee on issues not touched by assignee in more than 1000 days.