Apache OpenOffice (AOO) Bugzilla – Issue 111400
Extension Manager does not join spawned uno process (-> smoketestoo_native fails)
Last modified: 2019-08-02 12:15:20 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 unxlngi6.pro is [...] OK (1) rm: cannot remove `./unxlngi6.pro/misc/smoketest/user/user/uno_packages/cache/uno_packages/sdIHT0_/TestExtension.oxt/.nfs000000001a59a678000010e4': Device or resource busy dmake: Error code 1, while making 'cpptest' 1 module(s): smoketestoo_native need(s) to be rebuilt Reason(s): ERROR: error 65280 occurred while making /net/so-cwsserv01/export/cws/sb122/DEV300/sun/../ooo/smoketestoo_native 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/installationtest.mk (included in smoketestoo_native/makefile.mk) 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.
.
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.
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.
raising prio, as this affects build stability
Issue 116159 implements a workaround for the failing smoketestoo_native. That workaround should be removed again when this issue is fixed.
retargeted to 3.x