Search Issue Tracker

Fixed in 2020.2.X

Fixed in 2019.4.X, 2020.1.X

Votes

19

Found in

2019.3.16f1

2019.4.0f1

2020.1.0b11

2020.2.0a12

Issue ID

1254964

Regression

Yes

Crash on Shader::GetLocalKeywordRemap or ShaderLab::Pass::ApplyPass when Trees are painted on a Terrain

Terrain

-

Reproduction steps:
1. Open attached project "1254964"
2. Open scene "myscene" and select "Terrain" from the Hierarchy
3. In the Inspector, press on the Paint Trees tab and select the "Forest_Tree_1B"
4. Left-click on the terrain to paint the trees
-- observe crash

Reproducible with: 2019.3.16f1, 2019.4.1f1, 2020.1.0b11, 2020.1.0b13, 2020.2.0a12, 2020.2.0a15
Not reproducible with: 2018.4.23f1, 2019.3.15f1, 2020.1.0a1, 2020.1.0b10, 2020.2.0a1, 2020.2.0a11

  1. Resolution Note (fix version 2020.2):

    Fixed in 2020.2.0a16

  2. Resolution Note (fix version 2020.1):

    Fixed in 2020.1.0b15

  3. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.3f1

Comments (5)

  1. divyajiwebmaster

    Feb 15, 2021 06:03

    Also happens for me in 2019.4.0f1. Moving certain lines of C# Code around fixes the problem, but it's very odd - maybe it indicates some form of memory corruption

  2. FallenTreeGames

    Jul 06, 2020 19:56

    We've had to turn off shadows while we wait for the fix to be released.

  3. kuwabara_

    Jun 19, 2020 03:26

    This issue also occurred in our project.
    We have confirmed that it has also occurred in Unity 2019.4.1f1 released today.
    The call stack when the phenomenon occurred was as follows.

    > UnityPlayer.dll!Shader::GetLocalKeywordRemap(int,int)
    UnityPlayer.dll!ShaderLab::Pass::ApplyPass(unsigned int,class ShaderPropertySheet const *,struct ShaderPassContext &,class Shader *,int,int,class ShaderLab::GrabPasses const *,class ShaderLab::SubPrograms *,struct DeviceRenderStateBlock const *)
    UnityPlayer.dll!ApplyMaterialPassWithCache(struct SharedMaterialData const &,struct ShaderPassContext &,class Shader *,class ShaderLab::Pass *,int,int,bool,class ShaderLab::GrabPasses const *,class ShaderLab::SubPrograms *,struct DeviceRenderStateBlock const *)
    UnityPlayer.dll!ApplyMaterialPassAndKeywordsWithCache(struct SharedMaterialData const &,struct ShaderPassContext &,class Shader *,class ShaderLab::Pass *,int,int,bool,class ShaderLab::GrabPasses const *,class ShaderLab::SubPrograms *,struct DeviceRenderStateBlock const *)
    UnityPlayer.dll!BatchRenderer::ApplyShaderPass(struct ShaderPassContext &,struct SharedMaterialData const *,class Shader *,struct BatchRenderer::PassInfo &,enum BatchingFlags,bool,bool,class ShaderLab::GrabPasses const *,struct DeviceRenderStateBlock const *)
    UnityPlayer.dll!RenderCasters()
    UnityPlayer.dll!ShadowMapJob()
    UnityPlayer.dll!GfxDevice::ExecuteAsync(int,void (*)(struct GfxDeviceAsyncCommand::ArgScratch *,struct GfxDeviceAsyncCommand::Arg const *),struct GfxDeviceAsyncCommand::ArgScratch * *,struct GfxDeviceAsyncCommand::Arg const *,struct JobFence const &)
    UnityPlayer.dll!GfxDeviceClient::ExecuteAsync(int,void (*)(struct GfxDeviceAsyncCommand::ArgScratch *,struct GfxDeviceAsyncCommand::Arg const *),struct GfxDeviceAsyncCommand::ArgScratch * *,struct GfxDeviceAsyncCommand::Arg const *,struct JobFence const &)
    UnityPlayer.dll!RenderShadowMaps(struct ShadowMapJobHeader const *,struct ShaderPassContext &,enum RenderTexture::SetActiveFlags)
    UnityPlayer.dll!ForwardShaderRenderLoop::RenderLightShadowMaps(struct ForwardShadowMap &,bool,bool,struct ShaderPassContext &)
    UnityPlayer.dll!ForwardShaderRenderLoop::PerformRendering(struct JobFence &,struct ActiveLight const *,struct ShadowJobData const &,bool,bool,bool,enum Camera::RenderFlag)
    UnityPlayer.dll!DoForwardShaderRenderLoop(struct RenderLoopContext const &,struct dynamic_array<struct RenderObjectData,0> &,struct CullResults const &,bool,bool,bool,enum Camera::RenderFlag)
    UnityPlayer.dll!DoRenderLoop(struct RenderLoop &,enum RenderingPath,struct CullResults &,struct ShadowMapCache &)
    UnityPlayer.dll!Camera::DoRender(struct CullResults &,enum Camera::RenderFlag,class Camera::PerformRenderFunction *)
    UnityPlayer.dll!Camera::CustomRender(struct CullResults &,struct ShaderPassContext &,struct CameraRenderingParams const *,enum Camera::RenderFlag,class Camera::PerformRenderFunction *,void (*)(void),void (*)(void))
    UnityPlayer.dll!RenderManager::RenderCameras(int,void (*)(void),void (*)(void))
    UnityPlayer.dll!PlayerRender(bool)
    UnityPlayer.dll!`InitPlayerLoopCallbacks'::`2'::PostLateUpdateFinishFrameRenderingRegistrator::Forward()
    UnityPlayer.dll!ExecutePlayerLoop(struct NativePlayerLoopSystem *)
    UnityPlayer.dll!ExecutePlayerLoop(struct NativePlayerLoopSystem *)
    UnityPlayer.dll!PlayerLoop(void)
    UnityPlayer.dll!PerformMainLoop()
    UnityPlayer.dll!MainMessageLoop()
    UnityPlayer.dll!UnityMainImpl(struct HINSTANCE__ *,struct HINSTANCE__ *,wchar_t *,int)
    UnityPlayer.dll!UnityMain()

    Shader::GetLocalKeywordRemap:
    00007FFAA4F334C0 mov r9,qword ptr [rcx+50h]
    00007FFAA4F334C4 movsxd rcx,edx
    00007FFAA4F334C7 mov rax,qword ptr [r9]
    00007FFAA4F334CA mov rax,qword ptr [rax+rcx*8]
    00007FFAA4F334CE movsxd rcx,r8d
    00007FFAA4F334D1 add rcx,rcx
    >00007FFAA4F334D4 mov rax,qword ptr [rax+60h]
    00007FFAA4F334D8 movsxd rdx,dword ptr [rax+rcx*8+8]
    00007FFAA4F334DD test edx,edx
    00007FFAA4F334DF jns Shader::GetLocalKeywordRemap+24h (07FFAA4F334E4h)
    00007FFAA4F334E1 xor eax,eax
    00007FFAA4F334E3 ret
    00007FFAA4F334E4 mov rax,rdx
    00007FFAA4F334E7 shl rax,8
    00007FFAA4F334EB add rax,qword ptr [r9+0A8h]
    00007FFAA4F334F2 ret
    00007FFAA4F334F3 int 3
    00007FFAA4F334F4 int 3
    00007FFAA4F334F5 int 3
    00007FFAA4F334F6 int 3
    00007FFAA4F334F7 int 3
    00007FFAA4F334F8 int 3
    00007FFAA4F334F9 int 3
    00007FFAA4F334FA int 3
    00007FFAA4F334FB int 3
    00007FFAA4F334FC int 3
    00007FFAA4F334FD int 3
    00007FFAA4F334FE int 3
    00007FFAA4F334FF int 3

  4. RaventurnPatrick

    Jun 16, 2020 11:02

    If needed I can provide crash dumps. Btw for me it's not related to Terrain at all but rather happens when drawing the Game View (in game) after switching to another scene

    Unity.exe caused an Access Violation (0xc0000005)
    in module Unity.exe at 0033:426779c3.
    0x00007FF7426779C3 (Unity) Shader::GetLocalKeywordRemap
    0x00007FF741513A13 (Unity) ShaderLab::Pass::ApplyPass
    0x00007FF7414D2B13 (Unity) ApplyMaterialPassWithCache
    0x00007FF7414D2715 (Unity) ApplyMaterialPassAndKeywordsWithCache
    0x00007FF740C6A5B4 (Unity) BatchRenderer::ApplyShaderPass
    0x00007FF740B7E34E (Unity) RenderCasters
    0x00007FF740B8590E (Unity) ShadowMapJob
    0x00007FF73FF8AEF3 (Unity) GfxDevice::ExecuteAsync
    0x00007FF740B81481 (Unity) RenderShadowMaps
    0x00007FF740C74C8A (Unity) ForwardShaderRenderLoop::RenderLightShadowMaps
    0x00007FF740C71BF7 (Unity) ForwardShaderRenderLoop::PerformRendering
    0x00007FF740C6D2CF (Unity) DoForwardShaderRenderLoop
    0x00007FF740C57962 (Unity) DoRenderLoop
    0x00007FF740BFFDC5 (Unity) Camera::CustomRender
    0x00007FF740C0DB36 (Unity) RenderManager::RenderCameras
    0x00007FF73F6A7F9B (Unity) RepaintController::RenderPlayModeViewCameras
    0x00007FF73FDB661E (Unity) EditorGUIUtility::RenderPlayModeViewCamerasInternal

  5. RaventurnPatrick

    Jun 16, 2020 10:58

    Also happens for me in 2019.4.0f1. Moving certain lines of C# Code around fixes the problem, but it's very odd - maybe it indicates some form of memory corruption

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.