Search Unity

Bug Occasional crash when closing certain editor windows and dropdowns

Discussion in 'Linux' started by LukaKotar, Nov 24, 2015.

  1. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    When editing AnimationCurves, Unity will sometimes crash once the curve editor window is closed. It doesn't happen every time (however there were more than a few instances), and I can't make a reliable example project. The following appears in the editor log during the crash:
    Code (CSharp):
    1. ../../third_party/tcmalloc/chromium/src/tcmalloc.cc:289] Attempt to free invalid pointer 0x7f10735dc6a5
    2. Receiving unhandled NULL exception
    3. Launching bug reporter
    4. #0  0x007f10696ee140 in funlockfile
    5. #1  0x007f10696ee6e8 in tcmalloc::Abort()
    6. #2  0x007f10696ee6f0 in tcmalloc::Log(tcmalloc::LogMode, char const*, int, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem)
    7. #3  0x007f10696ee810 in (anonymous namespace)::InvalidFree(void*)
    Edit: I should also mention that I use a custom inspector for the script, and I use EditorGUILayout.CurveField to show the variable.

    Edit 2: The custom inspector has nothing to do with the crash.
     
    Last edited: Nov 25, 2015
  2. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    It happens with other windows with the native title bar as well. This appears in the log when the editor crashed upon closing a color picker window:
    Code (CSharp):
    1. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll
    2. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll
    3. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll
    4. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll
    5. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
    6. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
    7. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll
    8. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll
    9. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UsbDevices.cpp:UsbDevicesQuery
    10. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    11. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll
    12. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll
    13. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll
    14. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll
    15. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
    16. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll
    17. Symbol file LoadedFromMemory doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll
    18. Symbol file /opt/Unity/Editor/Data/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll.mdb doesn't match image /opt/Unity/Editor/Data/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll
    19. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    20. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    21. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    22. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    23. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    24. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    25. /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.c../../third_party/tcmalloc/chromium/src/tcmalloc.cc:289] Attempt to free invalid pointer 0x7fcbe1d0c700
    26. Receiving unhandled NULL exception
    27. Launching bug reporter
    28. #0  0x007fcbe1d09140 in funlockfile
    29. #1  0x007fcbe1d096e8 in tcmalloc::Abort()
    30. #2  0x007fcbe1d096f0 in tcmalloc::Log(tcmalloc::LogMode, char const*, int, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem)
    31. #3  0x007fcbe1d09810 in (anonymous namespace)::InvalidFree(void*)
    Edit: Unrelated to this thread, but the bug reporter window doesn't open after the crash, even though the log claims it's being launched.
     
  3. Wulfara

    Wulfara

    Joined:
    Aug 11, 2015
    Posts:
    40
    I'm having this issue too (with Unity Editor 5.3.0f4). Specially when closing the "Sprite Editor" window which I use very often. Editor.log shows same errors than LukaKotar's.
     
  4. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    Okay, I have a theory, although I can't confirm it just yet. It doesn't seem to crash (or, didn't crash yet) if I close it by clicking outside the window, instead of with the X button.

    My guess is that Unity wants to close the window after it was already closed with the X button, because it thinks that the user clicked outside of that window (and either loses the reference to the window (assuming the window is treated as a pointer), tries to clear the pointer each time, or loses the reference to a pointer somewhere in that window when it closes and attempts to clear it again, which could explain the "Attempt to free invalid pointer" error).

    So when you click outside the window, it only tries to close it once, and thus the editor doesn't crash. But again, this is all just speculation.
     
  5. Wulfara

    Wulfara

    Joined:
    Aug 11, 2015
    Posts:
    40
    Nice information. For me clicking outside the window doesn't close it but inspired by your post I just made some testing:
    1. I opened and closed the Sprite Editor window like 100 times closing it with Alt+F4 shortcut without any crashes
    2. It also seems to work fine when closing the window through the "Menu -> Close tab" option
    3. Next I closed it with the X button and it crashed at the first try
    4. Re-opened Unity and Sprite Editor window, closed it with X button and it crashed at the first try one more time
    5. Re-opened Unity and Sprite Editor window and keep trying some times more with Alt+F4 and menu -> close tab without problems.
    The conclussion is that for me the X button crashes Unity almost every time and Alt+F4 or menu -> close tab options work fine.

    Note that other Unity sub-windows like the "Search Sprite" or the "Build Settings" which are decorated by my system's default Window Decoration (KDE) instead of Unity's own decoration never crashed for me when hitting their X button.

    The behaviour seems similar to the crash when adding component via "add component button" (it crashes when using mouse buttons, but works fine when using keyboard or alternative menus) so I guess both issues may be related.
     
    Last edited: Jan 15, 2016
  6. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    I feel the need to bump this thread, as it is now even more relevant in Ubuntu 16.04. Seems to crash 50% of the time when closing windows (like the color picker) or editor popups (such as the gizmos or scene-view effects dropdowns).

    ../../third_party/tcmalloc/chromium/src/tcmalloc.cc:289] Attempt to free invalid pointer 0x30
    Receiving unhandled NULL exception
    Launching bug reporter
    #0 0x007ffcbe759cc0 in funlockfile
    #1 0x007ffcbe75a258 in tcmalloc::Abort()
    #2 0x007ffcbe75a260 in tcmalloc::Log(tcmalloc::LogMode, char const*, int, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem, tcmalloc::LogItem)
    #3 0x007ffcbe75a380 in (anonymous namespace)::InvalidFree(void*)
    #4 0x007ffcbe75a400 in AuxWindowManager::CloseViews(GUIView*)
    #5 0x007ffcbe75a420 in AuxWindowManager::OnMouseDown(GUIView*)
    #6 0x007ffcbe75a440 in OnGUIViewButtonPress(GUIView*, void*)
    #7 0x007ffcbe75a600 in gtk_marshal_VOID__UINT_STRING
    #8 0x007ffcbe75a630 in g_closure_invoke
    #9 0x007ffcbe75a6a0 in g_signal_handler_disconnect
    #10 0x007ffcbe75a7f0 in g_signal_emit_valist
    #11 0x007ffcbe75a9b0 in g_signal_emit
    #12 0x007ffcbe75aa90 in gtk_widget_translate_coordinates
    #13 0x007ffcbe75aad0 in gtk_propagate_event
    #14 0x007ffcbe75ab00 in gtk_main_do_event
    #15 0x007ffcbe75ab50 in gdk_event_get_graphics_expose
    #16 0x007ffcbe75ab60 in g_main_context_dispatch
    #17 0x007ffcbe75abf0 in g_main_context_dispatch
    #18 0x007ffcbe75ac50 in g_main_loop_run
    #19 0x007ffcbe75ac80 in gtk_main
    #20 0x007ffcbe75ad00 in main
    #21 0x007ffcbe75b0a0 in __libc_start_main
    #22 0x007ffcbe75b160 in _start
    /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UsbDevices.cpp:UsbDevicesQuery
    /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
    /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
     
  7. gnat

    gnat

    Joined:
    Sep 4, 2014
    Posts:
    9
  8. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    I'm seeing this very frequently with 16.04 as well - we're still getting to the bottom of it.
     
    gnat likes this.
  9. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
  10. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394