Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 4.6.2 Editor crash with plugins

Discussion in 'Editor & General Support' started by nikxio, Feb 3, 2015.

  1. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    My company is developing a plugin for Unity (Coherent UI) which some of our users reported that had incompatibilities with the 4.6.2 version and it was causing a crash. I was able to verify that on my machine (Win8.1, i7, GTX970, although I don't think hardware/OS is the issue here).

    The crash is easily reproducible with our plugin and it crashes every second time some scene is played, which is even stranger - the first time everything works perfectly.

    The call stack is always the same:

    Code (csharp):
    1.  
    2. ========== OUTPUTING STACK TRACE ==================
    3.  
    4. (0x0B907F0C) c:\buildslave\mono-runtime-and-classlibs\build\mono\metadata\class.c (7020 + 0x0): mono_class_array_element_size + 0x38
    5. (0x006DE76E) c:\buildslave\unity\build\runtime\scripting\backend\mono\scriptingbackendapi_mono.cpp (505 + 0x0): scripting_array_new + 0xe
    6. (0x007C17F4) c:\buildslave\unity\build\runtime\misc\plugins.cpp (178 + 0x1f): TryVerifySignature + 0x64
    7. (0x007C1B1A) c:\buildslave\unity\build\runtime\misc\plugins.cpp (215 + 0xd): FindAndLoadUnityPlugin + 0x5a
    8. (0x0B929932) c:\buildslave\mono-runtime-and-classlibs\build\mono\metadata\loader.c (1288 + 0x3): mono_lookup_pinvoke_call + 0x156
    9. (0x0B938437) c:\buildslave\mono-runtime-and-classlibs\build\mono\metadata\marshal.c (8083 + 0xe): mono_marshal_get_native_wrapper + 0x108
    10. (0x0B9BF817) c:\buildslave\mono-runtime-and-classlibs\build\mono\mini\method-to-ir.c (6428 + 0x0): mono_method_to_ir + 0x4404
    11. (0x0B9DEE64) c:\buildslave\mono-runtime-and-classlibs\build\mono\mini\mini.c (3565 + 0x12): mini_method_compile + 0x4cc
    12. (0x0B9DFCB1) c:\buildslave\mono-runtime-and-classlibs\build\mono\mini\mini.c (4319 + 0x10): mono_jit_compile_method_inner + 0x1df
    13. (0x0B9E020C) c:\buildslave\mono-runtime-and-classlibs\build\mono\mini\mini.c (4532 + 0xf): mono_jit_compile_method_with_opt + 0x134
    14. (0x0B9E0279) c:\buildslave\mono-runtime-and-classlibs\build\mono\mini\mini.c (4557 + 0x12): mono_jit_compile_method + 0x1b
    15. (0x0B9D9D56) c:\buildslave\mono-runtime-and-classlibs\build\mono\mini\mini-trampolines.c (477 + 0x6): mono_magic_trampoline + 0x580
    16. (0x0BC90066) ((module-name not available)): (filename not available): (function-name not available) + 0x0
    17. (0x0E4420F2) (Mono JIT code): (filename not available):  (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) + 0x92 (0E442060 0E4421BD) [0BC16D20 - Unity Child Domain] + 0x0
    18. (0x0B91B6B5) c:\buildslave\mono-runtime-and-classlibs\build\mono\metadata\gc.c (227 + 0x0): mono_gc_run_finalize + 0x198
    19. (0x0B91B85C) c:\buildslave\mono-runtime-and-classlibs\build\mono\metadata\gc.c (987 + 0xc): finalize_domain_objects + 0x49
    20. (0x0B91B92B) c:\buildslave\mono-runtime-and-classlibs\build\mono\metadata\gc.c (1045 + 0x6): finalizer_thread + 0x90
    21. (0x0B9FB5D2) c:\buildslave\mono-runtime-and-classlibs\build\libgc\win32_threads.c (599 + 0x5): thread_start + 0x2b
    22. (0x774D919F) (KERNEL32): (filename not available): BaseThreadInitThunk + 0xe
    23. (0x77C90BBB) (ntdll): (filename not available): RtlInitializeExceptionChain + 0x84
    24. (0x77C90B91) (ntdll): (filename not available): RtlInitializeExceptionChain + 0x5a
    25.  
    26. ========== END OF STACKTRACE ===========
    27.  
    The same plugin is working fine with any pre-4.6.2 Unity version.

    I tried reproducing this with a very small test native plugin, and with the Rendering plugin example that comes with Unity, but they were working correctly.

    I also found this topic ( http://forum.unity3d.com/threads/editor-crash-scene-delete.291237/ ) which looks very similar, although for me instead of crashing pre 4.6.2 and working there it was the opposite.

    Any help would be appreciated.
     
    CWolf likes this.
  2. dcdemars

    dcdemars

    Joined:
    May 18, 2012
    Posts:
    22
    I had the exact same thing happen to me. I upgraded Unity to 4.6.2 this morning and now the editor crashes the second time I hit the Run button.

    Both of my projects using Coherent UI do this. I tried opening a couple of projects without Coherent UI and they were OK.

    I'm not 100% it is because of Coherent UI because those projects are much larger than the other ones I've tried, so there could be a conflict with something else...

    Note, I am on a Mac, not a Windows machine, so this apparently happens on both platforms.
     
    CWolf likes this.
  3. CWolf

    CWolf

    Joined:
    Oct 24, 2011
    Posts:
    106
    We have the exact same problem in the Editor. We had to revert back to 4.6.1 since 4.6.2 kept crashing every second play.

    We also use Coherent UI 2.x

    EDIT: My specs are Windows 7 x64 Pro, Nvidia Geforce GTX980, i7 5820K
     
    Last edited: Feb 7, 2015
  4. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    I've also opened a bug this week (Case 669336) but no answer there either.

    There's very little to work on with this call stack. The "TryVerifySignature" was my only clue, thought it might be related to the digital signatures of the files. I tried the same thing with unsigned DLLs but that didn't have any effect, plus that's only on Windows and as @dcdemars said it's happening on Mac, too.

    This issue is rendering the plugin useless with 4.6.2 at the moment so if anyone from Unity can shed some light that would be great.
     
    glacius3000 and CWolf like this.
  5. glacius3000

    glacius3000

    Joined:
    Oct 5, 2012
    Posts:
    69
    I am not using Coherent UI but my own plugin and am also experiencing this problem.
     
  6. seaders

    seaders

    Joined:
    Oct 28, 2014
    Posts:
    29
    +1 here

    We use a variety of plugins (Facebook SDK, Amazon Mobile SDK, Google Play SDK) and before upgrading to 4.6.2 Unity was unstable, but not crashing anywhere near as much as now. It's basically unusable now, and I'm going through *yet another* uninstall, and downgrade.
     
  7. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    We are using Coherent UI at our company and we are experiencing the same issues.
    The Editor crashes the second time Play is pressed.
    The IL2CPP version doesn't work either, but it's possible this is due to a Coherent UI error (seems Android dll-resources are included in the iOS build).
     
  8. dcdemars

    dcdemars

    Joined:
    May 18, 2012
    Posts:
    22
    I went back to 4.6.1 and was able to get my work done with no further issues. Guess I'll just have to wait on upgrading to 4.6.2.

    If it adds any information, here's what the crash looks like on the Mac for the thread that crashes. No surprise, it looks like the same place it crashes on Windows.

    Thread 4 Crashed:
    0 libsystem_kernel.dylib 0x946fd69a __pthread_kill + 10
    1 libsystem_pthread.dylib 0x98b4cf19 pthread_kill + 101
    2 libsystem_c.dylib 0x97b1eeee abort + 156
    3 libmono.0.dylib 0x0485459a mono_handle_native_sigsegv + 881
    4 libmono.0.dylib 0x0488dcb6 mono_runtime_posix_install_handlers + 1042
    5 libsystem_platform.dylib 0x9747c03b _sigtramp + 43
    6 ??? 0xffffffff 0 + 4294967295
    7 libmono.0.dylib 0x0488dc53 mono_runtime_posix_install_handlers + 943
    8 libsystem_c.dylib 0x97b1eeee abort + 156
    9 com.unity3d.UnityEditor4.x 0x016a6cb5 LaunchBugReporter(BugReportMode) + 1157
    10 com.unity3d.UnityEditor4.x 0x0095fb25 HandleSignal(int, __siginfo*, void*) + 53
    11 libmono.0.dylib 0x0488d896 mono_chain_signal + 76
    12 libmono.0.dylib 0x047d895e mono_sigsegv_signal_handler + 234
    13 libsystem_platform.dylib 0x9747c03b _sigtramp + 43
    14 ??? 0xffffffff 0 + 4294967295
    15 libmono.0.dylib 0x047d8874 mono_sigill_signal_handler + 59
    16 com.unity3d.UnityEditor4.x 0x0072d462 scripting_array_new(MonoClass*, unsigned long, unsigned long) + 18
    17 com.unity3d.UnityEditor4.x 0x0086df40 TryVerifySignature(char const*, unsigned char const*) + 128
    18 com.unity3d.UnityEditor4.x 0x0086dd70 FindAndLoadUnityPlugin(char const*) + 64
    19 libmono.0.dylib 0x048d5666 mono_lookup_pinvoke_call + 586
    20 libmono.0.dylib 0x048e9266 mono_marshal_get_native_wrapper + 390
    21 libmono.0.dylib 0x047f583b mono_method_to_ir + 95999
    22 libmono.0.dylib 0x047d60ee mini_method_compile + 2252
    23 libmono.0.dylib 0x047d7deb mono_jit_compile_method + 1637
    24 libmono.0.dylib 0x047d77b7 mono_jit_compile_method + 49
    25 libmono.0.dylib 0x0490f174 mono_compile_method + 36
    26 libmono.0.dylib 0x048558aa mono_magic_trampoline + 2184
    27 ??? 0x07677066 0 + 124219494
    28 ??? 0x141e4512 0 + 337528082
    29 libmono.0.dylib 0x048bd574 mono_gc_run_finalize + 1020
    30 libmono.0.dylib 0x048beef9 mono_gc_init + 1135
    31 libmono.0.dylib 0x0493b926 mono_thread_create_internal + 1645
    32 libmono.0.dylib 0x0496f334 CreateThread + 1558
    33 libmono.0.dylib 0x049952b1 GC_start_routine + 108
    34 libsystem_pthread.dylib 0x98b4ae13 _pthread_body + 138
    35 libsystem_pthread.dylib 0x98b4ad89 _pthread_start + 162
    36 libsystem_pthread.dylib 0x98b48e52 thread_start + 34
     
  9. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    @Horp1 the IL2CPP issue is different, basically there are functions for Android and iOS in the .NET DLL, but only the appropriate ones are used. This apparently isn't compatible with IL2CPP and we'll release a fixed 1.8.9 version shortly.

    The crash on second play still remains though...
     
  10. rlabrecque

    rlabrecque

    Joined:
    Aug 27, 2014
    Posts:
    15
    Yep, I'm experiencing the same issue as well as all of my users who have upgraded.
    Using my own plugin.

    My FogBugz case number is 671775.
     
  11. glacius3000

    glacius3000

    Joined:
    Oct 5, 2012
    Posts:
    69
    Might as well post my crash log as well. I'd also like to note that after the first play. It will also crash if you just let Unity sit for a few minutes.

    *** Launching bug reporter due to fatal error!
    Receiving unhandled NULL exception
    Launching bug reporter
    Obtained 31 stack frames.
    #0 0x00000001514506 in EditorUserBuildSettings::GetActiveBuildTarget() const
    #1 0x000000016acbd5 in LaunchBugReporter(BugReportMode)
    #2 0x000000014fcecd in EditorMonoConsole::LogToConsoleImplementation(std::string const&, int, char const*, int, int, int, int)
    #3 0x000000014fca5e in LogToConsoleImplementation(std::string const&, int, char const*, int, int, int, int)
    #4 0x00000000ab18d0 in DebugStringToFilePostprocessedStacktrace(char const*, char const*, char const*, int, char const*, int, int, int, int)
    #5 0x00000000ab0468 in DebugStringToFile(char const*, int, char const*, int, int, int, int)
    #6 0x0000000050e738 in GetManagerFromContext(int)
    #7 0x0000000095b312 in GetMonoManager()
    #8 0x00000000726bee in scripting_class_from_fullname(char const*, char const*, char const*)
    #9 0x0000000097f7cf in Scripting::GetMethod(char const*, char const*, char const*, char const*)
    #10 0x00000000970233 in ScriptingInvocation::ScriptingInvocation(char const*, char const*, char const*, char const*)
    #11 0x000000008689f5 in TryVerifySignature(char const*, unsigned char const*)
    #12 0x00000000868860 in FindAndLoadUnityPlugin(char const*)
    #13 0x0000000449e5da in mono_lookup_pinvoke_call
    #14 0x000000044b21da in mono_marshal_get_native_wrapper
    #15 0x000000043be7b7 in mono_method_to_ir
    #16 0x0000000439f06a in mini_method_compile
    #17 0x000000043a0d67 in mono_jit_compile_method
    #18 0x000000043a0733 in mono_jit_compile_method
    #19 0x000000044d80e8 in mono_compile_method
    #20 0x0000000441e82e in mono_magic_trampoline
    #21 0x00000005de7066 in (Unknown)
    #22 0x0000000d7a9512 in (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) + 0x92 (0xd7a9480 0xd7a95dd) [0x6e478c0 - Unity Child Domain]
    #23 0x000000044864ec in mono_gc_run_finalize
    #24 0x00000004487e71 in mono_gc_init
    #25 0x000000045048dd in mono_thread_create_internal
    #26 0x00000004538324 in CreateThread
    #27 0x0000000455e2a1 in GC_start_routine
    #28 0x000000964a45fb in _pthread_body
    #29 0x000000964a4485 in _pthread_struct_init
    #30 0x000000964a9cf2 in thread_start

    Edit: Actually after the first play. It'll crash when I edit and save a script. Then my crash log looks identical to rlabrecque's
     
    Last edited: Feb 18, 2015
  12. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    Just saw this post - according to it this issue should be fixed in 4.6.3p1
     
  13. m0rf

    m0rf

    Joined:
    Nov 4, 2014
    Posts:
    1
    We appear to be having this issue with another plugin - does anyone know if the issue fixed in 4.6.3p1 is specific to Coherent, or is it a fix to a general bug?
     
  14. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    @m0rf The crash call stack has nothing to do with Coherent UI so I'd assume this is a general issue with plugins. Only Unity3D devs know what the bug exactly was though, so that's just my guess.

    I can confirm that the bug (with Coherent UI at least) appears to be gone in 4.6.3.