Search Issue Tracker
Fixed in 5.6.0
Votes
0
Found in
5.6.0a1
Issue ID
849344
Regression
Yes
Unity crashes when calling Material.SetColor with specific arguments
Add the following code to a script or add the script from the attached project to a scene and press play in the Editor. Unity crashes.
Script:
var mat = new Material (Shader.Find("Diffuse"));
mat.SetColor (1397476922, new Color(0, 0, 0, 0));
Stacktrace:
0x00000001409B814A (Unity) GetBuiltinVectorParamName
0x0000000140F4C121 (Unity) Material::SetColor
0x0000000013447C4B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Material:INTERNAL_CALL_SetColorImpl (UnityEngine.Material,int,UnityEngine.Color&)
0x0000000013447B33 (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:196] UnityEngine.Material:SetColorImpl (int,UnityEngine.Color)
0x0000000013447A56 (Mono JIT Code) [C:\buildslave\unity\build\Runtime\Export\Graphics.cs:379] UnityEngine.Material:SetColor (int,UnityEngine.Color)
0x00000000135BB765 (Mono JIT Code) [D:\UserTestProjects\New Unity Project\Assets\NewBehaviourScript.cs:10] NewBehaviourScript:Start ()
0x0000000012A769E2 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FFAC6CD512B (mono) [c:\buildslave\mono\build\mono\mini\mini.c:4937] mono_jit_runtime_invoke
0x00007FFAC6C283F1 (mono) [c:\buildslave\mono\build\mono\metadata\object.c:2623] mono_runtime_invoke
0x0000000140EA9C25 (Unity) scripting_method_invoke
0x0000000140EA2891 (Unity) ScriptingInvocation::Invoke
0x00000001412B34C5 (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00000001412B35FC (Unity) MonoBehaviour::InvokeMethodOrCoroutineChecked
0x00000001412B43FE (Unity) MonoBehaviour::Start
0x00000001412B4CA9 (Unity) MonoBehaviour::DelayedStartCall
0x00000001409A0CFD (Unity) DelayedCallManager::Update
0x0000000140C23B02 (Unity) PlayerLoop
0x00000001415405DE (Unity) Application::UpdateScene
0x0000000141540A97 (Unity) Application::EnterPlayMode
0x0000000141549F8F (Unity) Application::SetIsPlaying
0x000000014154AA84 (Unity) Application::TickTimer
0x00000001416172C0 (Unity) FindMonoBinaryToUse
0x00000001416188DD (Unity) WinMain
0x0000000141931150 (Unity) strnlen
0x00007FFAFE1F8364 (KERNEL32) BaseThreadInitThunk
0x00007FFB00535E91 (ntdll) RtlUserThreadStart
Seems to happen with all Unity versions
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Physics 2D Profiler module does not display the information about processed physics in the scene when profiling the application as a Development Build
- A Script Component that has a serialized custom class is not detecting changes in the first boolean variable when entering the Play mode with the Script Components GameObject opened in the Inspector
- “SendMessage cannot be called during Awake“ warnings appear when loading a scene with “LoadSceneAsync“ if using UI Toolkit in the scene
- Audio Source Spatial Blend value gets set to 1 in the WebGL Player when the Spatial Blend value is bigger than 0
- [Linux] Crash on g_type_check_instance_cast after changing Editor layout, creating a new VR template or HDRP project
Add comment