Issue 111400

Summary: Extension Manager does not join spawned uno process (-> smoketestoo_native fails)
Product: General Reporter: Stephan Bergmann <stephan.bergmann.secondary>
Component: codeAssignee: AOO issues mailing list <issues>
Severity: Trivial    
Priority: P2 CC: issues, oooforum
Version: DEV300m77   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Stephan Bergmann 2010-05-05 14:36:29 UTC
raise_uno_process in
desktop/source/deployment/registry/component/dp_component.cxx does not lead to a
call of osl_joinProcess on the obtained hProcess (let alone
osl_freeProcessHandle, see issue 77087).

That is most probably the reason why building smoketestoo_native can fail.  What
I have occasionally observed at least on DEV300_m77 based CWS sb122 is

OK (1)
rm: cannot remove
Device or resource busy
dmake:  Error code 1, while making 'cpptest'
1 module(s):
need(s) to be rebuilt
ERROR: error 65280 occurred while making

What happens is probably as follows:  The smoke test instantiates
TestExtension.oxt, the contained TestExtension.jar UNO component is instantiated
in a spawned uno.bin process.  After the soffice.bin process has terminated,
cpptest in solenv/inc/ (included in
smoketestoo_native/ calls "$(RM) -r $(MISC)/$(TARGET)/user" to
remove the temporary UserInstallation from the local output tree of
smoketestoo_native, which happens to be accessed via NFS.  Within the $(RM) -r,
unlinking .../TestExtesion.oxt/TestExtension.jar leaves the
.../TestExtension.oxt/.nfs000000001a59a678000010e4 file behind, as the still
running uno.bin has that file still open, and the following rmdir of
.../TestExtension.oxt thus fails as the directory is not empty.
Comment 1 joachim.lingner 2010-06-09 11:34:05 UTC
Comment 2 joachim.lingner 2010-06-30 08:54:45 UTC
The separate uno process dies when the remote bridge dies. That is, the reader
threads fails to read data from the remote connection, because it was closed on
the other end (soffice.bin). The uno process is a listener at the bridge and is
notified when this happens. The main function is blocked by a condition which is
set when the notification occurs. Then the main threads can leave the main
function an the process can eventually terminate.

However, it is undetermined when the process dies and frees its resources. The
best solution would therefore to use system functions, such as
WaitForMultipleObjects (Windows), waitpid (Linux), to make sure that all child
processes are terminated before the office process terminates itself.
Comment 3 joachim.lingner 2010-06-30 09:16:09 UTC
One possible solution is to dispose the remote bridges in the extension manager
when it is disposed and join the uno processes. The disposing call should block
as long as there are uno processes alive. 

It is still unclear what this means when there are services from the uno process
still in use by soffice.

Comment 4 Stephan Bergmann 2010-07-14 16:02:10 UTC
raising prio, as this affects build stability
Comment 5 Stephan Bergmann 2010-12-17 13:57:43 UTC
Issue 116159 implements a workaround for the failing smoketestoo_native.  That
workaround should be removed again when this issue is fixed.
Comment 6 joachim.lingner 2011-03-15 10:47:04 UTC
retargeted to 3.x
Comment 7 oooforum (fr) 2019-08-02 12:15:15 UTC