-
-
Notifications
You must be signed in to change notification settings - Fork 51
New update seems to have caused issues on Linux 2021.1.9f1 editor. Crashes and closes editor right away. #8
Comments
So it always crashes the Editor on launch now? Was it not happening in previous versions? |
Wait what? It dies on "Patcher.GUISkinHasLoaded()"? |
It looks like it, everything else before that point is pretty typical Unity stuff. This is from just above the Patcher lines from the log. I can try closing and reopening a few more times to see if I see anything different. Application.AssetDatabase Initial Script Refresh End
Application.AssetDatabase.Refresh Start
Refresh completed in 0.250891 seconds.
RefreshInfo: RefreshV2(ForceSynchronousImport) scanfilter:
RefreshProfiler: Total: 249.835ms
Application.AssetDatabase.Refresh End
RefreshInfo: StopAssetImportingV2(ForceSynchronousImport) scanfilter:
RefreshProfiler: Total: 1.802ms
Refresh completed in 0.258507 seconds.
RefreshInfo: RefreshV2(NoUpdateAssetOptions) scanfilter:
RefreshProfiler: Total: 257.750ms
Launched and connected shader compiler UnityShaderCompiler after 0.01 seconds
Initializing Unity extensions:
Refresh completed in 0.155609 seconds.
RefreshInfo: RefreshV2(NoUpdateAssetOptions) scanfilter:
RefreshProfiler: Total: 154.427ms
UpdateMenuTitleForLanguage: 10
Unloading 273 Unused Serialized files (Serialized files now loaded: 0)
System memory in use before: 113.9 MB.
System memory in use after: 113.4 MB.
Unloading 308 unused Assets to reduce memory usage. Loaded Objects now: 4282.
Total: 4.346984 ms (FindLiveObjects: 0.150812 ms CreateObjectMapping: 0.087814 ms MarkObjects: 3.629738 ms DeleteObjects: 0.478066 ms)
ProgressiveSceneManager::Cancel()
[MODES] ModeService[none].Initialize
[MODES] ModeService[none].LoadModes
[MODES] Loading mode Default (0) for mode-current-id-Test_Project
[LAYOUT] About to load Library/CurrentLayout-default.dwlt, keepMainWindow=False
Unhandled description string [
Unhandled description string ]
Unhandled description string \
[MODES] ModeService[default].InitializeCurrentMode
[MODES] ModeService[default].RaiseModeChanged(default, default)
[MODES] ModeService[default].UpdateModeMenus
Unhandled description string [
Unhandled description string ]
Unhandled description string \
IsTimeToCheckForNewEditor: Update time 1624411204 current 1624409192
[Project] Loading completed in 16.321 seconds
Project init time: 0.151 seconds
Template init time: 0.000 seconds
Package Manager init time: 0.000 seconds
Asset Database init time: 0.000 seconds
Global illumination init time: 0.000 seconds
Assemblies load time: 0.000 seconds
Unity extensions init time: 0.000 seconds
Asset Database refresh time: 0.000 seconds
Scene opening time: 1.641 seconds
Unhandled description string [
Unhandled description string ]
Unhandled description string \
Unhandled description string [
Unhandled description string ]
Unhandled description string \
NullReferenceException: Object reference not set to an instance of an object
at AV.Inspector.Patcher.GUISkinHasLoaded () [0x0000d] in /mnt/x/_unity/_test/Test_Project/Assets/Smart-Inspector/Patches/Provider/Patcher.cs:41
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs) (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/UnhandledExceptionHandler.bindings.cs:46)
(Filename: Assets/Smart-Inspector/Patches/Provider/Patcher.cs Line: 41) |
Can you try to comment out line 32 and 33 in Patcher.Init? |
Sure, one sec, I will give it a try. |
Unfortunately, that didn't help. Just to see, I commented out the [InitializeOnLoadMethod] of the Patcher init and it loaded just fine, but then I realized that, that method is probably what handles everything this asset is about, lol. |
You need to comment out the lines related to GUISkin check, not the whole Init :) |
Yeah, I did. I tried commenting 32 and 33 first, but it didn't seem to make a difference. It still closed right away when loading the editor. |
But what error it gives in this case? Couldn't be 41 line now |
I'd need to try to check this issue later on my Manjaro |
This was unfortunately all it gave this last time. Caught fatal signal - signo:11 code:1 errno:0 addr:0xf893b11
Obtained 2 stack frames.
#0 0x007fc6821a6bb0 in funlockfile
#1 0x00000041f976a7 in (Unknown)
Launching bug reporter
Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QObject(0x10029e0), parent's thread is QThread(0xd163d0), current thread is Thread(0xfbee70)
|
Looking at how this initializes, I will see if I can remove one of the patches at a time to see which one then allows it to load. |
Yes, it should be related to one of the patches being injected / initialized at a wrong time, as was with #5 |
Ok, I changed to the following and I found what looks like the one: static void GetPatches()
{
if (patches != null)
return;
patches = new List<PatchBase>();
var patchTypes = TypeCache.GetTypesDerivedFrom(typeof(PatchBase));
for (var i = 0; i < patchTypes.Count; i++)
{
if (i == 5) // Skipping: PropertyEditorPatch - Editor loaded when it skipped this one
{
Debug.Log($"Skipping: {patchTypes[i].Name}");
continue;
}
var type = patchTypes[i];
if (type.IsAbstract)
continue;
var instance = Activator.CreateInstance(type) as PatchBase;
patches.Add(instance);
}
} |
Hooh, we're getting somewhere! What if you comment out OnEnable and OnDisable patches in PropertyEditorPatch? |
I removed the skip, then made this adjustment, but it crashed as it had before. protected override IEnumerable<Patch> GetPatches()
{
// var onEnable = AccessTools.Method(PropertyEditorRef.type, "OnEnable");
// var onDisable = AccessTools.Method(PropertyEditorRef.type, "OnDisable");
var rebuildContent = AccessTools.Method(PropertyEditorRef.type, "RebuildContentsContainers");
var endRebuildContent = AccessTools.Method(PropertyEditorRef.type, "EndRebuildContentContainers");
// yield return new Patch(onEnable, postfix: nameof(OnEnable_));
// yield return new Patch(onDisable, nameof(_OnDisable));
yield return new Patch(rebuildContent, nameof(_RebuildContentsContainers), nameof(RebuildContentsContainers_));
#if UNITY_2020_1_OR_NEWER
yield return new Patch(endRebuildContent, postfix: nameof(EndRebuildContentContainers_));
#endif
} |
But it doesn't crash if the rest of these patches / Patch itself is skipped? |
If PropertyEditorPatch is skipped from loading via the method I used prior, the editor loads. If I set everything back to normal, but then in PropertyEditorPatch, I make the changes above, it crashes. Did I comment out the proper parts you were referring to? |
Yes, but wait. It crashes even when Editor is already launched? |
I am not sure, when I made the changes, I closed the editor and reopened it, and it crashed. |
I understand, but could you try to launch skipping PropertyEditorPatch and then comment it back in? |
Should I keep OnEnable and OnDisable commented out, or reenable them first? |
You can just skip the whole patch with |
Ok, like this? internal class PropertyEditorPatch : PatchBase
{
protected override IEnumerable<Patch> GetPatches()
{
yield break;
var onEnable = AccessTools.Method(PropertyEditorRef.type, "OnEnable");
var onDisable = AccessTools.Method(PropertyEditorRef.type, "OnDisable");
var rebuildContent = AccessTools.Method(PropertyEditorRef.type, "RebuildContentsContainers");
var endRebuildContent = AccessTools.Method(PropertyEditorRef.type, "EndRebuildContentContainers");
yield return new Patch(onEnable, postfix: nameof(OnEnable_));
yield return new Patch(onDisable, nameof(_OnDisable));
yield return new Patch(rebuildContent, nameof(_RebuildContentsContainers), nameof(RebuildContentsContainers_));
#if UNITY_2020_1_OR_NEWER
yield return new Patch(endRebuildContent, postfix: nameof(EndRebuildContentContainers_));
#endif
} |
Ok, so with that patch skipped, the editor open, you then want me to remove the skip but keep the yield break; and then recompile? |
No, once it's launched, you need to get patch back in by removing yield break; |
Ok, so, I removed the skip, removed the yield, and recompiled and it crashed. |
So it cuts down the problem to SmartInspector.OnRebuildContent(). |
I dont see anything with the name of RebuildToolbar within PropertyEditorPatch? --- Edit, oh, sorry, did you mean void RebuildToolbar()
{
toolbar?.Rebuild(this);
} in Base/SmartInspector? |
Only what's inside |
I did this, but it crashed: /// <see cref="PropertyEditorPatch.RebuildContentsContainers_"/>
internal void OnRebuildContent(RebuildStage stage)
{
RebuildingInspector = this;
FirstInitOnInspectorIfNeeded();
//Debug.Log(stage);
if (stage == RebuildStage.BeforeEditorElements)
{
editors.Clear();
RemoveUserElements();
}
if (stage == RebuildStage.BeforeRepaint)
{
// RebuildToolbar();
}
if (stage == RebuildStage.AfterRepaint)
{
// TODO: Fix one-frame issue when dragged element keeps expanded layout of element that was last there
}
} |
Okay I guess then it also might be caused by Or 71 line |
Hmm.... I just tried internal SmartInspector(EditorWindow propertyEditor)
{
this.propertyEditor = propertyEditor;
// this.tracker = PropertyEditorRef.GetTracker(propertyEditor);
} But it still crashed. :( |
That doesn't seem right.. Nothing else could be called by PropertyEditorPatch Could you both comment out tracker and skip Inject method? And if it doesn't work, the rest of the OnRebuildContent |
Like this? internal SmartInspector(EditorWindow propertyEditor)
{
this.propertyEditor = propertyEditor;
// this.tracker = PropertyEditorRef.GetTracker(propertyEditor);
}
internal void OnEnable() {}
internal void OnDisable() {}
internal void Inject()
{
// var result = TryInject();
//Debug.Log(result);
} |
Still crashed |
Okaay... Then I have another assumption - PropertyEditorPatch.Rebuild creates SmartInspector instance and makes it a RebuildingInspector Try to comment out line 51 and 52 in |
oi, this is not making it easy, is it? lol. I did the following, but still crashed static void Init_(VisualElement __instance, IMGUIContainer ___m_Header, IMGUIContainer ___m_Footer, EditorWindow ___inspectorWindow)
{
var smartInspector = SmartInspector.RebuildingInspector;
// var data = CreateEditorElement(__instance, ___m_Header, ___m_Footer, smartInspector);
// smartInspector.SetupEditorElement(data);
} |
That ain't right.. Other suspects are still commented out? I can't think of any other method that can be called during rebuild |
Oh, no, I was uncommenting things as we went along so that only the current one asked was commented. |
This is made that way because vanilla
We need to find the last commented out suspect that fixes the crash :) |
Happens to me as well (PopOS 20.10, Unity 2021.1.12f1) |
Here's a config with plugin and patches disabled - Smart Inspector Prefs.zip |
Ok, nice. I will give it a go and see how it turns out. 👍 |
Ok, nice. Adding the prefs to library was able to let me load up the editor. (Side note, this issue page for some reason is lagging my browser terribly. Each letter I type takes 1 second to appear. I have never had that happen on github before, and it is only this particular issue thread. Something I pasted into here before must be lagging it out.) Edit - even more strange, it seems to only happen on new posts. I hit edit on this post and now its fine again, so nevermind, must be one of my browser extensions. Anyways, it looks like having my settings like this, which I believe is the same as when I manually disabled the one patch via script, the edit loads up fine. |
What if you disable all other patches but enable PropertyEditorPatch? |
Doing that made it so the editor will no longer start. |
Hey there,
I created a test project a few weeks ago, whenever this was first released, it was using 2021.1.7f1 at the time and I pulled the new changes into the project and went to start it up, but as soon as the editor first loads after the initial Unity splash/loading image, the editor simply closes, or gives a bug report window. I removed the asset from my assets folder and started Unity again to be sure and it loaded just fine. I put the Smart-Inspector folder back in the project and as it was importing/compiling it just locked up. I forced the project closed, tried to open again, and once again it crashed. The below is an excerpt from the tail end of the logs, though, it doesn't seem too helpful, unfortunately.
---- Edit, I added another bit from a log that looks like it has some more info that is relevant to the patcher, not sure if it is related, but it came up just before it locked up again.
Tail end of logs
Additional Logs
Thanks,
-MH ------------------------------------
The text was updated successfully, but these errors were encountered: