__hostHandle(nullptr),
__domainId(-1),
fd(0),
- __initialized(false)
+ __initialized(false),
+ __isProfileMode(false)
{
_INFO("Constructor called!!");
+ char *env = nullptr;
+ env = getenv("CORECLR_ENABLE_PROFILING");
+ if (env != nullptr && !strcmp(env, "1")) {
+ _INFO("profiling mode on");
+ __isProfileMode = true;
+ }
+
// plugin initialize should be called before start loader mainloop.
// 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.
CoreRuntime::~CoreRuntime()
{
+ // workaround : to prevent crash while process terminate on profiling mode,
+ // kill process immediately.
+ // see https://github.com/dotnet/coreclr/issues/26687
+ if (__isProfileMode) {
+ _INFO("shutdown process immediately.");
+ _exit(0);
+ }
+
dispose();
}