BuildPipeline.BuildPlayer with DetailedBuildReport crashes Unity (2022.3.14/15, 2023.2.3)

Hey,

I hope this is the right forum to report this issue. I was having a lot of issues extending our custom builder tool to support iOS and after spending some hours of debugging I found using

BuildPlayerOptions options = new();
… set required options…
options.options = BuildOptions.DetailedBuildReport; ← offender

causes

BuildPipeline.BuildPlayer( buildPlayerOptions );

to crash reliably.

Cheers,
Dirk

I did not test this in depth, but it appears OSX builds also crashes when using the DetailedBuildReport option.

Can you please create a bug and submit a repro project? (you can drop case number here, so we can check immediately)

I cannot use the full project for a bug report and just tried to set up a new project from scratch, but building worked just fine. I am now going through the logs by myself trying to figure out what is causing the actual crash. Maybe I find the offending assets. Problem is, we also have some custom import processors running for textures and shaders and maybe they cause some confusion during the compilation process.

The crash usually happens somewhere during the shader compilation process. I have seen some rare occasions where the asset data looked like a video. I’ll check if adding the Post Processing Package will trigger the crash.

This is the output from one of the logs:

Base path: ‘/Applications/Unity/Hub/Editor/2022.3.14f1/Unity.app/Contents’, plugins path ‘/Applications/Unity/Hub/Editor/2022.3.14f1/Unity.app/Contents/PlaybackEngines’
Cmd: initializeCompiler

Cmd: compileComputeKernel
insize=5009 file=Packages/com.unity.postprocessing/PostProcessing/Shaders/Builtins/Lut3DBaker.compute kernel=KGenLut3D_NeutralTonemap ppOnly=0 stripLineD=0 buildPlatform=9 km=<TONEMAPPING_NEUTRAL=1>,<UNITY_VERSION=202239> pKW=UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 SHADER_API_MOBILE UNITY_LIGHTMAP_DLDR_ENCODING uKW=SHADER_STAGE_COMPUTE platform=metal flags=268439552 reqs=16385 forceDXC=0 forceFXC=0 ok=1 outsize=8343

Unhandled exception: Protocol error - failed to read magic number (error -2147483644, transferred 0/4)

Quitting shader compiler process

9536275–1346233–logs.rar (2.46 KB)

We are observing an editor crash in 2021.3.36 when building for iOS with BuildOptions.DetailedBuildReport enabled. Sounds like a regression of this issue.

Top of the crash stacktrace is:
std::__1::__tree_node_base<void*>& std::__1::__tree<core::basic_string<char, core::StringStorageDefault>, std::__1::less<core::basic_string<char, core::StringStorageDefault>>, std::__1::allocator<core::basic_string<char, core::StringStorageDefault>>>::__find_equal<core::basic_string<char, core::StringStorageDefault>>(std::__1::__tree_const_iterator<core::basic_string<char, core::StringStorageDefault>, std::__1::__tree_node<core::basic_string<char, core::StringStorageDefault>, void>, long>, std::__1::__tree_end_node<std::__1::__tree_node_base<void>>&, std::__1::tree_node_base<void*>&, core::basic_string<char, core::StringStorageDefault> const&)
BuildReporting::ScenesUsingAssets::RegisterScenesUsingAssets(core::hash_map<core::basic_string<char, core::StringStorageDefault>, std::__1::set<core::basic_string<char, core::StringStorageDefault>, std::__1::less<core::basic_string<char, core::StringStorageDefault>>, std::__1::allocator<core::basic_string<char, core::StringStorageDefault>>>, core::hash<core::basic_string<char, core::StringStorageDefault>>, std::__1::equal_to<core::basic_string<char, core::StringStorageDefault>>> const&)
BuildReporting::BuildReport::UpdateSummary()
BuildReport_CUSTOM_get_summary_Injected(ScriptingBackendNativeObjectPtrOpaque
, BuildSummary
&)
(wrapper managed-to-native) UnityEditor.Build.Reporting.BuildReport:get_summary_Injected (UnityEditor.Build.Reporting.BuildReport,UnityEditor.Build.Reporting.BuildSummary&) [{0x14e691f48} + 0xcc] (0x4bb726c18 0x4bb726d78) [0x157ec2a80 - Unity Child Domain]

Hi, we’re having the same issue in 2022.3 LTS. Commenting out DetailedBuildReport from the BuildOptions solves it. Does anyone know what’s causing this issue?

1 Like