Search Issue Tracker

Fixed in 2017.3.0f3

Fixed in 5.6.X, 2017.1.X, 2017.2.X

Votes

3

Found in

5.6.0f3

Issue ID

920116

Regression

No

Crashed in BuildReporting::BuildReport::BeginBuildStep when BuildAssetBundles is being called from an OnPreprocessBuild callback

Deployment Management

-

Steps to reproduce:

1) Download attached project 'BuildReportCrash.zip' and open in Unity
2) In the top-level toolbar, select Tests >> Run
Observe crash while building the player

========== OUTPUTING STACK TRACE ==================

0x00000001403043AC (Unity) BuildReporting::BuildReport::BeginBuildStep
0x0000000140287080 (Unity) BeginPlayerBuilding
0x00000001402E18E4 (Unity) BuildPlayer
0x0000000141302C71 (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck

Expected result: Unity should not crash while building the player
Actual result: Unity crashes while building the player

Reproduced with:
5.6.0b1, 5.6.1p3, 2017.1.0b9, 2017.2.0a3

Project didn't worked with 5.6.0a6 and older versions of Unity
------------------------------------------------------------
Fixed in: 2017.1.2p2, 2017.2.0p1, 2017.3.0a5

Comments (2)

  1. Alloc

    Jul 11, 2017 16:11

    Yeah, exactly the same here ... as long as the call to
    BuildPipeline.BuildAssetBundles
    is in a [PostProcessBuild] method the editor crashes *after* the first bundle was done (or at least after its usage report has been written to the log).

    [code]0x00000000779C8F24 (ntdll) RtlDeNormalizeProcessParams
    0x00000000779C8E54 (ntdll) RtlDeNormalizeProcessParams
    0x00000001402FAF8D (Unity) BuildReporting::BuildReport::AddMessage
    0x00000001402FB0FD (Unity) BuildReporting::BuildReport::AddMessage
    0x0000000140D499A7 (Unity) DebugStringToFilePostprocessedStacktrace
    0x0000000140D4A0CE (Unity) DebugStringToFile
    0x0000000140D4A65C (Unity) DebugStringToFile
    0x00000001414104C2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x000000003F0C9C6B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    0x000000003F0C9B54 (Mono JIT Code) [C:\buildslave\unity\build\Runtime\Export\Logger\DebugLogHandler.cs:9] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000000003F0C94E5 (Mono JIT Code) [C:\buildslave\unity\build\Runtime\Export\Logger\Logger.cs:41] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x000000003F0D01C6 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\runtime\DebugBindings.gen.cs:103] UnityEngine.Debug:Log (object)
    0x000000003F0CFF6C (Mono JIT Code) Logger:masterLog (string)
    0x000000003F0CFD9B (Mono JIT Code) Logger:Out (string)
    0x000000003F0CFCCB (Mono JIT Code) Log:Out (string)
    0x00000000133CC5D8 (Mono JIT Code) [E:\trunk_5.6\Assets\Editor\ReleasePreparations.cs:121] ReleasePreparations:CreateAssetBundles (UnityEditor.BuildTarget,string,bool)
    0x00000000133C791B (Mono JIT Code) [E:\trunk_5.6\Assets\Editor\Data_RedistCopy.cs:130] Data_RedistCopy:OnPostprocessBuild (UnityEditor.BuildTarget,string)
    0x00000000133C2CEB (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_object (object,intptr,intptr,intptr)
    0x000007FEDF005823 (mono) [c:\buildslave\mono\build\mono\mini\mini.c:4937] mono_jit_runtime_invoke
    0x000007FEDEF58435 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:2623] mono_runtime_invoke
    0x000007FEDEF5E943 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:3838] mono_runtime_invoke_array
    0x000007FEDEF1CE33 (mono) [c:\buildslave\mono\build\mono\metadata\icall.c:2750] ves_icall_InternalInvoke
    0x0000000018610257 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
    0x000000001860E3B2 (Mono JIT Code) [/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    0x000000003B1375FF (Mono JIT Code) [/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115] System.Reflection.MethodBase:Invoke (object,object[])
    0x00000000133C1D9F (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildPipelineInterfaces.cs:65] UnityEditor.Build.BuildPipelineInterfaces/AttributeCallbackWrapper:OnPostprocessBuild (UnityEditor.BuildTarget,string)
    0x00000000133C1947 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildPipelineInterfaces.cs:274] UnityEditor.Build.BuildPipelineInterfaces:OnBuildPostProcess (UnityEditor.BuildTarget,string,bool)
    0x000000003F0DBE63 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_object_sbyte (object,intptr,intptr,intptr)
    0x000007FEDF005823 (mono) [c:\buildslave\mono\build\mono\mini\mini.c:4937] mono_jit_runtime_invoke
    0x000007FEDEF58435 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:2623] mono_runtime_invoke
    0x0000000141072BA5 (Unity) scripting_method_invoke
    0x00000001410684F1 (Unity) ScriptingInvocation::Invoke
    0x00000001402A3998 (Unity) PreloadData::`vector deleting destructor'
    0x00000001402A8F72 (Unity) std::_Pop_heap_0<ResourceManager::Dependency * __ptr64,ResourceManager::Dependency,ResourceManager::Dependency::Sorter>
    0x00000001402E2564 (Unity) DoBuildPlayer
    0x00000001402E3296 (Unity) BuildPlayer
    0x0000000141308CD1 (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
    0x000000003F0D7097 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool)
    0x000000003F0D6F17 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:308] UnityEditor.BuildPipeline:BuildPlayerInternal (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions)
    0x000000003F0D6AE8 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:242] UnityEditor.BuildPipeline:BuildPlayer (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions)
    0x000000003F0D60D9 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:205] UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)
    0x000000003F0D5BAB (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:199] UnityEditor.BuildPipeline:BuildPlayer (string[],string,UnityEditor.BuildTarget,UnityEditor.BuildOptions) [/code]

    This is really annoying on build automation and even more so for all the devs that manually have to build the bundles now.

  2. zzgrzyt

    Jun 13, 2017 11:21

    I believe I have the same or very related problem in my project.
    Simply calling BuildAssetBundles() from a PostProcessBuild callback crashes unity 100%.
    I have 2 asset bundles configured. It seems to create one, and crash before it creates the second one.

    Unity Version:
    5.6.1f1 (2860b30f0b54) revision 2646195

    Callback code:
    [PostProcessBuild(2)]
    public static void BuildAssetBundles(BuildTarget target, string pathToBuildProject)
    {
    string fullBundleDirectory = Path.Combine(Path.GetDirectoryName(pathToBuildProject), "AssetBundles");
    if (!Directory.Exists(fullBundleDirectory)) {
    Directory.CreateDirectory(fullBundleDirectory);
    }
    BuildPipeline.BuildAssetBundles(fullBundleDirectory, BuildAssetBundleOptions.DeterministicAssetBundle, target);
    }

    Results in the following crash:
    0x00000001402F334D (Unity) BuildReporting::BuildReport::AddMessage
    0x00000001402F34BD (Unity) BuildReporting::BuildReport::AddMessage
    0x0000000140D3D5A7 (Unity) DebugStringToFilePostprocessedStacktrace
    0x0000000140D3DCCE (Unity) DebugStringToFile
    0x0000000140D3E25C (Unity) DebugStringToFile
    0x00000001402F3524 (Unity) BuildReporting::BuildReport::RegisterForLogMessages
    0x0000000140287160 (Unity) BeginPlayerBuilding
    0x00000001402E2F13 (Unity) RuntimeStatic<ModuleMetadata,0>::StaticDestroy
    0x00000001402E3806 (Unity) BuildAssetBundles
    0x00000001412F7084 (Unity) BuildPipeline_CUSTOM_BuildAssetBundlesInternal
    0x00000000371CCF39 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildAssetBundlesInternal (string,UnityEditor.BuildAssetBundleOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget)
    0x00000000371CCE03 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:490] UnityEditor.BuildPipeline:BuildAssetBundles (string,UnityEditor.BuildAssetBundleOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget)
    0x00000000371CCBE7 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:481] UnityEditor.BuildPipeline:BuildAssetBundles (string,UnityEditor.BuildAssetBundleOptions,UnityEditor.BuildTarget)
    0x00000000371CCACD (Mono JIT Code) [<my_project>\Assets\Editor\PostBuildSteps.cs:27] PostBuildSteps:BuildAssetBundles (UnityEditor.BuildTarget,string)
    0x00000000371CC74B (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_object (object,intptr,intptr,intptr)
    0x00007FFBA1405737 (mono) [c:\buildslave\mono\build\mono\mini\mini.c:4937] mono_jit_runtime_invoke
    0x00007FFBA1358435 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:2623] mono_runtime_invoke
    0x00007FFBA135E943 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:3838] mono_runtime_invoke_array
    0x00007FFBA131CE33 (mono) [c:\buildslave\mono\build\mono\metadata\icall.c:2750] ves_icall_InternalInvoke
    0x00000000006E0257 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
    0x00000000006DE3B2 (Mono JIT Code) [/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
    0x00000000007C2B5F (Mono JIT Code) [/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115] System.Reflection.MethodBase:Invoke (object,object[])
    0x00000000371CB44F (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildPipelineInterfaces.cs:65] UnityEditor.Build.BuildPipelineInterfaces/AttributeCallbackWrapper:OnPostprocessBuild (UnityEditor.BuildTarget,string)
    0x00000000371CAFF7 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\BuildPipeline\BuildPipelineInterfaces.cs:274] UnityEditor.Build.BuildPipelineInterfaces:OnBuildPostProcess (UnityEditor.BuildTarget,string,bool)
    0x0000000034BD66E3 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_object_sbyte (object,intptr,intptr,intptr)
    0x00007FFBA1405737 (mono) [c:\buildslave\mono\build\mono\mini\mini.c:4937] mono_jit_runtime_invoke
    0x00007FFBA1358435 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:2623] mono_runtime_invoke
    0x00000001410645B5 (Unity) scripting_method_invoke
    0x0000000141059DF1 (Unity) ScriptingInvocation::Invoke
    0x00000001402A2040 (Unity) PreloadData::`vector deleting destructor'
    0x00000001402A7642 (Unity) std::_Pop_heap_0<ResourceManager::Dependency * __ptr64,ResourceManager::Dependency,ResourceManager::Dependency::Sorter>
    0x00000001402DF9DA (Unity) DoBuildPlayer
    0x00000001402E0622 (Unity) BuildPlayer
    0x00000001412FA281 (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.