Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Unty 2017.1.0f3 WebGL error: Uncaught RuntimeError: memory access out of bounds

Discussion in 'WebGL' started by HJ_KH, Sep 20, 2017.

  1. HJ_KH

    HJ_KH

    Joined:
    Sep 18, 2017
    Posts:
    4
    I have encountered this problem when I try to access the WebGL game I had built:

    An error occurred running the Unity content on this page.
    See your browser JavaScript console for more info.
    The error was: Uncaught RuntimeError: memory access out of bounds.

    And I also looked for some article to fix it like adding "UnityLoader.SystemInfo.hasWasm = false; " before
    var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Auto3DModeling.json", {onProgress:
    UnityProgress}); in the index.html

    But it show more errors like these:




    And here are the results from JavaScript Console:




    But the total size of my WebGL project is only 15.5mb

    Could anyone know how to fix this problem??><

    Thanks in advanced~~~
     
    Last edited: Sep 20, 2017
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,580
    Any out-of-memory "alert" message?

    Could you try to make a development build and post the callstack here? Maybe disable WebAssembly in PlayerSettings for the time being.
     
    HJ_KH likes this.
  3. HJ_KH

    HJ_KH

    Joined:
    Sep 18, 2017
    Posts:
    4
    Thank you for your reply,Marco.

    I can build and run without ticking development build option.

    And when I hit the "BuildRoom" button, it will pop out an alert message like this:



    Then I try to adding -->
    【UnityLoader.SystemInfo.hasWasm = false; "】
    before-->
    【var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Auto3DModeling.json", {onProgress:
    UnityProgress}); 】in the index.html.

    So you can see the errors discussed above.

    【MY first question】Why the same player settings between my project and an empty project will end in different result?

    Then I had token your advised to make a development build(And I also ticked "Use pre-built engine" and "Script only built"), but I cannot build my project successfully.

    But if I build an empty project through the same settings, it can build and run successfully...

    The followings are the settings and building errors:





    【1】
    Failed running D:\Unity\2017.1.0f3\Unity\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --development-mode --dotnetprofile="net45" --compile-cpp --libil2cpp-static --platform="WebGL" --architecture="EmscriptenJavaScript" --configuration="Debug" --outputpath="D:\Delta_Unity\Auto3DModeling\Assets /../Temp/StagingArea/Data\Native\build.bc" --cachedirectory="D:\Delta_Unity\Auto3DModeling\Assets\..\Library/il2cpp_cache" --compiler-flags="-Oz -DIL2CPP_EXCEPTION_DISABLED=1 " --map-file-parser="D:\Unity\2017.1.0f3\Unity\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --assembly="D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" --assembly="D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\Managed\UnityEngine.Analytics.dll" --assembly="D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\Managed\UnityEngine.dll" --generatedcppdir="D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\il2cppOutput"

    stdout:
    Building build.bc with EmscriptenToolChain.
    Output directory: D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\Native
    Cache directory: D:\Delta_Unity\Auto3DModeling\Library\il2cpp_cache
    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\il2cppOutput\UnityClassRegistration.cpp:443:16: error: use of undeclared identifier 'AssetImporter'
    RegisterClass<AssetImporter>();
    ^
    1 error generated.
    ERROR:root:compiler frontend failed to generate LLVM bitcode, halting

    Invocation was: Executable: "D:\Unity\2017.1.0f3\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
    Arguments: "D:\Unity\2017.1.0f3\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\em++" -Wno-unused-value -Wno-invalid-offsetof -nostdinc -fno-strict-overflow -std=c++11 -O1 -g0 -Oz -DIL2CPP_EXCEPTION_DISABLED=1 -DIL2CPP_DEVELOPMENT=1 -DNET_4_0 -DRUNTIME_IL2CPP -I"D:\Unity\2017.1.0f3\Unity\Editor\Data\il2cpp\libil2cpp" -I"D:\Unity\2017.1.0f3\Unity\Editor\Data\il2cpp\external\boehmgc\include" -I"D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\il2cppOutput" "D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\il2cppOutput\UnityClassRegistration.cpp" -o "D:\Delta_Unity\Auto3DModeling\Library\il2cpp_cache\C10AF4F5D817481E6C687A1B04C5F9DA.o"

    �� Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    �� Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    �� Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner(CppProgramBuilder builder, IBuildStatistics& statistics)
    �� il2cpp.Program.DoRun(String[] args)
    �� il2cpp.Program.Run(String[] args)
    �� il2cpp.Program.Main(String[] args)
    stderr:

    ���B�z���ҥ~���p: Unity.IL2CPP.Building.BuilderFailedException: D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\il2cppOutput\UnityClassRegistration.cpp:443:16: error: use of undeclared identifier 'AssetImporter'
    RegisterClass<AssetImporter>();
    ^
    1 error generated.
    ERROR:root:compiler frontend failed to generate LLVM bitcode, halting

    Invocation was: Executable: "D:\Unity\2017.1.0f3\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
    Arguments: "D:\Unity\2017.1.0f3\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\em++" -Wno-unused-value -Wno-invalid-offsetof -nostdinc -fno-strict-overflow -std=c++11 -O1 -g0 -Oz -DIL2CPP_EXCEPTION_DISABLED=1 -DIL2CPP_DEVELOPMENT=1 -DNET_4_0 -DRUNTIME_IL2CPP -I"D:\Unity\2017.1.0f3\Unity\Editor\Data\il2cpp\libil2cpp" -I"D:\Unity\2017.1.0f3\Unity\Editor\Data\il2cpp\external\boehmgc\include" -I"D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\il2cppOutput" "D:\Delta_Unity\Auto3DModeling\Temp\StagingArea\Data\il2cppOutput\UnityClassRegistration.cpp" -o "D:\Delta_Unity\Auto3DModeling\Library\il2cpp_cache\C10AF4F5D817481E6C687A1B04C5F9DA.o"

    �� Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
    �� Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    �� Unity.IL2CPP.Building.Statistics.BuildingTestRunnerHelper.BuildAndLogStatsForTestRunner(CppProgramBuilder builder, IBuildStatistics& statistics)
    �� il2cpp.Program.DoRun(String[] args)
    �� il2cpp.Program.Run(String[] args)
    �� il2cpp.Program.Main(String[] args)

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:324)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:305)
    UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:151)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:41)
    UnityEditor.HostView:OnGUI()

    【2】
    Exception: D:\Unity\2017.1.0f3\Unity\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!
    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:130)
    UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:324)
    UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (System.Collections.Generic.ICollection`1[T] userAssemblies, System.String outputDirectory, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:305)
    UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:151)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry, System.Boolean debugBuild) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:41)
    UnityEditor.WebGL.WebGlBuildPostprocessor.CompileBuild (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:340)
    UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:873)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:263)
    UnityEditor.HostView:OnGUI()

    【3】
    UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    UnityEditor.HostView:OnGUI()

    【MY second question】If I only tick "Development Build",it can build and run no matter for my project or an empty project. Do you know the differences between these two settings?

    But if I only tick "Development Build" option, it can build and run successfully!!@@"



    However, when I hit "Build_Room" button, it show an error message like this:



    An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
    uncaught exception: abort(110) at jsStackTrace (Output.asm.framework.unityweb:1161:12)
    stackTrace (Output.asm.framework.unityweb:1175:11)
    abort (Output.asm.framework.unityweb:19434:43)
    nullFunc_iii (Output.asm.framework.unityweb:15074:2)
    b110 (Output.asm.code.unityweb:2666836:1)
    _LogManager_GetClassFullName_m2245088715 (Output.asm.code.unityweb:1601009:1)
    _LogManager_GetCurrentClassLogger_m3935487690 (Output.asm.code.unityweb:2200625:1)
    _AccessOG__cctor_m426584326 (Output.asm.code.unityweb:2261929:1)
    __Z31RuntimeInvoker_Void_t1841601450PFvvEPK10MethodInfoPvPS4_ (Output.asm.code.unityweb:2564241:1)
    __ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException (Output.asm.code.unityweb:2393264:1)
    __ZN6il2cpp2vm7Runtime9ClassInitEP11Il2CppClass (Output.asm.code.unityweb:1139036:1)
    __ZN6il2cpp2vm6Object16NewAllocSpecificEP11Il2CppClass (Output.asm.code.unityweb:1902734:1)
    __ZN6il2cpp2vm6Object3NewEP11Il2CppClass (Output.asm.code.unityweb:2615468:1)
    _ParseData_InitialOG_m3662289776 (Output.asm.code.unityweb:1674107:1)
    _ParseData_OpenAssetConfig_m1482245994 (Output.asm.code.unityweb:208033:1)
    _ParseData_GetAssetConfig_m1444074103 (Output.asm.code.unityweb:2089937:1)
    _ParseData_GetRackInfo_m581970209 (Output.asm.code.unityweb:2045963:1)
    _GUIbtnTest_OnGUI_m1295899384 (Output.asm.code.unityweb:593857:1)
    __Z31RuntimeInvoker_Void_t1841601450PFvvEPK10MethodInfoPvPS4_ (Output.asm.code.unityweb:2564241:1)
    __ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException (Output.asm.code.unityweb:2393264:1)
    _il2cpp_runtime_invoke (Output.asm.code.unityweb:2422050:1)
    __Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb (Output.asm.code.unityweb:2208572:1)
    __ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb (Output.asm.code.unityweb:1315829:1)
    __Z18MonoBehaviourDoGUIiR14ObjectGUIStateN13MonoBehaviour13GUILayoutTypeEi18ScriptingMethodPtr4PPtrIS1_E (Output.asm.code.unityweb:686127:1)
    __ZN11IMGUIModule18MonoBehaviourDoGUIEiR14ObjectGUIStateN13MonoBehaviour13GUILayoutTypeEi18ScriptingMethodPtr4PPtrIS2_E (Output.asm.code.unityweb:1946160:1)
    __ZN13MonoBehaviour5DoGUIENS_13GUILayoutTypeEii (Output.asm.code.unityweb:1156778:1)
    __ZL18MonoBehaviourDoGUIPvN13MonoBehaviour13GUILayoutTypeEii (Output.asm.code.unityweb:2508357:1)
    __ZN10GUIManager10DoGUIEventER10InputEventb (Output.asm.code.unityweb:178104:1)
    __ZN10GUIManager16SendQueuedEventsEv (Output.asm.code.unityweb:957397:1)
    __ZZN10GUIManager14InitGUIManagerEvEN41PreUpdateIMGUISendQueuedEventsRegistrator7ForwardEv (Output.asm.code.unityweb:2358888:1)
    __Z10PlayerLoopv (Output.asm.code.unityweb:527984:1)
    __ZL8MainLoopv (Output.asm.code.unityweb:1541299:1)
    dynCall_v (Output.asm.code.unityweb:2669140:1)
    browserIterationFunc (Output.asm.framework.unityweb:2408:4)
    runIter (Output.asm.framework.unityweb:2510:5)
    Browser_mainLoop_runner (Output.asm.framework.unityweb:2446:3)

    ----------------------------------------------------------------------------------------------------------
    Let me leave those building errors above behind.

    I guess that maybe the problem occurs when I hit the "Build_Room" button.

    Let me explain this button function.

    We have already had some static data which record racks and assets' details.

    And if I hit "Build_Room" button, it will try to connect the operational gateway to retrieve the data to auto build the data center in 3D way.

    Because we have many dlls defined before, I will referenced the dlls used in my code.

    And actually I faced a problem I had figured out is that I cannot build and run if I don't add every relative dll in my code even I don't use certain dll.

    For example, I reference A.dll which is referenced by B.dll or references C.dll.

    But I even do not use B or C dll, it cannot build and run if I don't add B and C.dll into my code....

    So I guess maybe this is the rule(?) Unity had to prevent the null error or something, am I right? ><

    【MY third question】 "The memory out of bounds." Is that because the connecting and retrieving data caused the memory out of bounds? But why other webGL games developed by Unity won't face this problem? I don't know how to allocate the memory use through connective or retrieving layer even I had read many resources online such as: https://blogs.unity3d.com/2016/09/20/understanding-memory-in-unity-webgl/
    Or do I go wrong way to see my problem?><

    But if I build and run as .exe file, it run quickly and successfully.

    Thank you for your reply and help in advanced.
     
    Last edited: Sep 21, 2017
  4. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    222
    Okay I think we have the same error (2017.3.0p1...our first attempt at 2017.3)! It happens randomly for us, but I think it's related to animation/mecanim. The issue is when using asm.js, Unity just hangs (freezes permanently in both chrome and firefox) instead of throwing an exception so I can't track it down exactly. It seems to only happen in some of our "applications" though (all of our applications share the same binary) so it's been a challenge to debug. I'll see if can create a small and consistent repro case, but for now I'll attach a screenshot of the (useless?) wasm error. I can also PM you guys a link to a test deployment where we can repro the case on a semi-consistent basis, but I don't see how that's anymore helpful than the screenshot.

    Also...is there a way to make wasm exceptions not useless in the future? :)

    2017_3_bug.png
     
    Last edited: Jan 10, 2018
  5. Gaurav-Gulati

    Gaurav-Gulati

    Joined:
    Sep 22, 2014
    Posts:
    52
    Getting the same 'memory out of bounds' from unity 2017.3.0p1 .
     
  6. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,580
    This
    does not seem web-related and it seem other people experienced it on other platforms when using Scripts Only Build build.

    Could you try to reproduce with exceptions enabled?
     
  7. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,580
    could you try to run it using Firefox 54.0.1 to see if you get symbols?
     
  8. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    222
    No symbols in 57.0.4, same as chrome. Do I need to downgrade? That build did have full exceptions enabled (and like I said, unfortunately just hangs with asm.js).

    It's interesting you mention the scripts only build; we don't use that option but essentially our binary is "scripts only". I wonder if I disable stripping perhaps the bug would go away (obviously not a real solution, but an interesting data point)?
     
  9. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,580
    No, but I suggest you have a separate installation of 54.0.1 for the debugging purposes. Unfortunately, something changed in Wasm and we get no callstack symbols in current stable Firefox (same problem with other browsers). This is going to be solved in 2018.x
     
  10. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,580
    it's possible, perhaps in the log you have something like: Could not produce class with ID... ?
     
  11. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    222
    Great call on 54.0.1!

    2017_3__set_transform_bug.png

    Seems to be crashing on setting the parent of a Transform. For context, we instantiate various GameObjects/Prefabs with null parents (we need their Awake() to fire) and then insert them into an existing hierarchy (that may or may not be enabled). Why this throws exceptions only sometimes is still a mystery to me. I'll see if I can debug it further, but at least we know the problem! Thanks @Marco-Trivellato !
     
  12. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    222
    That's definitely it:

    Code (CSharp):
    1. var clone = Instantiate(prefab) as GameObject;
    2. if (clone != null)
    3. {
    4.     Debug.Log("setting parent (" + gameObject.name + ") for " + clone.name);
    5.     clone.transform.SetParent(transform, worldPositionStays); <--- Unity sometimes dies here
    6.     Debug.Log("done");
    7.     ...
    8. }
     
  13. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,580
    have you sanity checked the transform passed to SetParent? (is it null? clone.transform == tranform?)
    are you able to repro on a different platform too?
     
  14. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    222
    I changed the code to preform other sanity checks (even though I believe they should be impossible) just in case and got the same result.

    Code (CSharp):
    1. var clone = Instantiate(prefab) as GameObject;
    2. if (clone == null)
    3. {
    4.     return null;
    5. }
    6. Transform transCache = clone.transform;
    7. if (transCache != null && transform != null && transform != transCache)
    8. {
    9.     Debug.Log("setting parent (" + gameObject.name + ") for " + clone.name);
    10.     transCache.SetParent(transform, worldPositionStays); <----- Unity will still randomly(?) crash here
    11.     Debug.Log("done");
    Some notes:
    • I checked the mercurial history, that script hasn't changed in 6 months (so worked with 2017.2.0p1/2017.1.x/5.6.x/etc.). I won't discount the possibility though that some other script indirectly impacted this script/error.
    • The error is completely random. Sometimes you need to reload the level 10 times before it happens, sometimes it happens the first time you load the level. There doesn't seem to be any consistency. And if the level loads without error, the application runs perfectly fine.
    • Our Windows Store 10/UWP build (il2cpp) seems fine, but because this error is random I can't say for sure. We started building/testing iOS on 2017.3 today so perhaps I can have another data point for you by Tuesday/Wednesday. Android and macOS won't be started until further next week though.
    • I can't seem to make a simple reproduction case to send you. Even using a prefab that throws the error in our "normal build" seems fine (I think the issue though is unrelated to the underlining prefab, when it does throw an error, it's always the first prefab it tries to instantiate/parent). Perhaps since it's random and this is a simple scene I just haven't been "unlucky" enough to trigger the error. The only difference I can think of is our normal build uses asset bundles (and has scene/level switching) where the "test build" just loads an empty scene once on application load. I'll try to keep figuring out what exactly causes the error and hopefully submit a good reproduction case.
     
    Last edited: Jan 12, 2018
  15. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    222
    Well @Marco-Trivellato you're off the hook, it happens in iOS too. Oddly though in a different place (adjusting a RectTransform property, not setting the parent), but the crash is still the same. When Unity calls UpdateIfTransformDispatchIsDirty(), it sometimes crashes on ShouldUpdateTransformBefore() with a bad memory access. Not sure why it doesn't happen on UWP (il2cpp), but perhaps we haven't been "unlucky" enough yet.

    And it would seem we're not alone: https://forum.unity.com/threads/2017-3-0f3-ios-build-crashes-all-the-time.509586/

    Guess we'll stick with 2017.2.x for a bit. :(
     
  16. kognito1

    kognito1

    Joined:
    Apr 7, 2015
    Posts:
    222
    jvalencia and Marco-Trivellato like this.
  17. sanddoll1234

    sanddoll1234

    Joined:
    Jul 7, 2018
    Posts:
    3
     
  18. sanddoll1234

    sanddoll1234

    Joined:
    Jul 7, 2018
    Posts:
    3
    i have same error but only at casualarena gamesite,i have not built any games
     
  19. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,580
    I suggest submitting a bug report.

    Have you tried to enable exception?

    as a test could you try to make a WebAssembly build in 2018.2 ? If the problem is the size of the Unity Heap, it will automatically grow and should solve your problem.
     
  20. sanddoll1234

    sanddoll1234

    Joined:
    Jul 7, 2018
    Posts:
    3
    seems to me that this issue is mainly people making games,i have never made a game. i cannot get on
    casual arena gamesite because of this error