summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoongsuk Cho <ws77.cho@samsung.com>2024-03-12 10:47:36 +0900
committer조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>2024-03-12 13:31:43 +0900
commit15f113ebfb2c3a61f1de01b22a2a74d707bdd26b (patch)
treeed2e8f8072b9b334d8c6241f58a1d651bbe6b974
parent4019f2e3d6a2e0e22a5a49f437f3f17471f9efd2 (diff)
downloadlauncher-15f113ebfb2c3a61f1de01b22a2a74d707bdd26b.tar.gz
launcher-15f113ebfb2c3a61f1de01b22a2a74d707bdd26b.tar.bz2
launcher-15f113ebfb2c3a61f1de01b22a2a74d707bdd26b.zip
Register default signal handler
When the .NET Runtime receives SIGABRT and the previous handler is the default handler, the .NET Runtime restores the default handler as the current handler and continues. As a result, if a signal handler has not been registered before the .NET Runtime, the application will be terminated only after calling SIGAGRT twice. To avoid this situation, add signal handler before coreclr_initialize()
-rw-r--r--NativeLauncher/launcher/lib/core_runtime.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/NativeLauncher/launcher/lib/core_runtime.cc b/NativeLauncher/launcher/lib/core_runtime.cc
index 39c3695..8431610 100644
--- a/NativeLauncher/launcher/lib/core_runtime.cc
+++ b/NativeLauncher/launcher/lib/core_runtime.cc
@@ -307,6 +307,13 @@ int CoreRuntime::initialize(const char* appType, LaunchMode launchMode)
__isProfileMode = true;
}
+ // When the .NET Runtime receives SIGABRT and the previous handler is the default handler,
+ // the .NET Runtime restores the default handler as the current handler and continues.
+ // As a result, if a signal handler has not been registered before the .NET Runtime,
+ // the application will be terminated only after calling SIGAGRT twice.
+ // To avoid this situation, add signal handler before coreclr_initialize()
+ registerSigHandler();
+
// plugin initialize should be called before creating threads.
// In case of VD plugins, attaching secure zone is done in the plugin_initialize().
// When attaching to a secure zone, if there is a created thread, it will failed.
@@ -420,10 +427,9 @@ int CoreRuntime::initialize(const char* appType, LaunchMode launchMode)
return -1;
}
- // VD has their own signal handler.
- if (!pluginHasLogControl()) {
- registerSigHandler();
- }
+ // This code is no longer needed because log redirection is performed by the system.
+ // However, since additional work can be done in the VD plugin, the function call is kept.
+ pluginHasLogControl();
int st = createDelegate(__hostHandle, __domainId, "Tizen.Runtime", "Tizen.Runtime.Environment", "SetEnvironmentVariable", (void**)&setEnvironmentVariable);
if (st < 0 || setEnvironmentVariable == nullptr) {