summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-09-19 13:19:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-09-19 18:28:33 +0200
commit6352710e02c12783280afccb3b5e03aab7948f19 (patch)
tree687d8f78ddf206f2917fc2120c9f183964b7458c /jvmfwk
parentbbc07c964ef9a4698b3867ff554259adcf81bc58 (diff)
try harder to remove "OSL_PIPE" pipe on SIGTERM
a) When oosplash got SIGTERM it used SIGKILL on soffice.bin, (concealed behind osl_terminateProcess) so soffice.bin has no chance to cleanup. Try SIGTERM, followed by SIGKILL if that doesn't work, to give soffice.bin a chance. b) java intercepts SIGTERM so if JNI_CreateJavaVM was called then our SIGTERM handler doesn't get called. Add -Xrs to jvm args to avoid this. Change-Id: I09f93d8093bc7c094482eda73b4eadc5a6cebb83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140152 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/source/framework.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 8aa85082b838..5f83e7be739e 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -229,7 +229,7 @@ javaFrameworkError jfw_startVM(
//options dialog
std::unique_ptr<JavaVMOption[]> sarJOptions(
new JavaVMOption[
- arOptions.size() + (sUserClassPath.isEmpty() ? 1 : 2) + vmParams.size()]);
+ arOptions.size() + (sUserClassPath.isEmpty() ? 2 : 3) + vmParams.size()]);
JavaVMOption * arOpt = sarJOptions.get();
if (! arOpt)
return JFW_E_ERROR;
@@ -248,6 +248,11 @@ javaFrameworkError jfw_startVM(
arOpt[index].extraInfo = nullptr;
++index;
+ // Don't intercept SIGTERM
+ arOpt[index].optionString = const_cast<char *>("-Xrs");
+ arOpt[index].extraInfo = nullptr;
+ ++index;
+
//add the options set by options dialog
for (auto const & vmParam : vmParams)
{