Editor Crash when quitting while in Playmode
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
調査の方向性
FastScriptReloadManager の静的初期化とファイナライザから始め、次に issue で説明されている LoggerScoped.LogInternal と EditorApplication.quitting イベントを調べます。Playmode 中に Unity Editor を終了して再現します。完了の条件は、manager のファイナライズ時にシャットダウンでクラッシュしなくなり、通常のクリーンアップには影響がないことです。
索引モデルが issue の本文から書いたものです。
説明
So when closing the UnityEditor while in playmode, the Finalizer of FastScriptReloadManager causes Unity to Crash.
Here is the Stack Trace from the Unity Log:
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at UnityEngine.DebugLogHandler:Internal_Log <0x000f9>
at UnityEngine.DebugLogHandler:LogFormat <0x000da>
at UnityEngine.Logger:Log <0x001dd>
at ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogInternal <0x000eb>
at ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogError <0x00072>
at FastScriptReload.Editor.FastScriptReloadManager:Finalize <0x00172>
at System.Object:runtime_invoke_virtual_void__this__ <0x0018b>
=================================================================
The problem is that LoggerScoped uses UnityEngine.Debug.unityLogger.Log in the background, which is null as soon as Unity is quitting... An exception in that state causes Unity to hard-crash...
private static void LogInternal(LogType logType, object message, Object context)
{
UnityEngine.Debug.unityLogger.Log(logType, string.Empty, (object) (LoggerScoped.LogPrefix + message), context);
}
To fix the issue I created a Flag that is set as reaction to the quitting Event of the Editor Application.
When the flag is set during deconstruction, it exits early and makes no calls to the LoggerScoped.
Cleanup of the FileWatchers should be savely ommittable in this instance as the process is shutting down anyway. The watchers being IDisposables should automatically dispose themselves.
@@ -239,6 +239,10 @@ static FastScriptReloadManager()
//do not add init code in here as with domain reload turned off it won't be properly set on play-mode enter, use Init method instead
EditorApplication.update += Instance.Update;
EditorApplication.playModeStateChanged += Instance.OnEditorApplicationOnplayModeStateChanged;
+ EditorApplication.quitting += () =>
+ {
+ _editorIsClosing = true;
+ };
///if <see cref="FastScriptReloadPreference.WatchOnlySpecified"/> is enabled, disable auto reload automatically when launching editor. Will be enabled automatically when adding file watcher manually
if ((bool)FastScriptReloadPreference.WatchOnlySpecified.GetEditorPersistedValueOrDefault() && SessionState.GetBool("NEED_EDITOR_SESSION_INIT", true))
@@ -248,8 +252,10 @@ static FastScriptReloadManager()
}
}
+ private static bool _editorIsClosing;
~FastScriptReloadManager()
{
+ if (_editorIsClosing) return;
LoggerScoped.LogDebug("Destroying FSR Manager ");
if (_instance != null)
{
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 169
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
handzlikchris/FastScriptReload のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
handzlikchris/FastScriptReload#202 · リアクション 2 件 ·
-
csc.rsp supportオープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
Failed to find entry-points対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
handzlikchris/FastScriptReload#203 · コメント 4 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
handzlikchris/FastScriptReload#197 · コメント 1 件 ·
handzlikchris/FastScriptReload の issue をすべて見る
似ている issue
-
Bug: Hidden loading rings keep the compositor running, so Files uses 7-94% of a CPU core while idleオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
files-community/Files#19026 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Physgun SFX Spamオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
SubtitleEdit/subtitleedit#15946 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BHoM/Civil3D_Toolkit#118 ·
-
Reason-phrase table has misspelled entries (`Unathorized`, `Switching Protcols`, `Multiple Choises`)オープンbug severity:low
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100