Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Stack Overflow being reported as a Shader Compiler error

Discussion in 'Editor & General Support' started by Tkrain42, Jul 30, 2023.

  1. Tkrain42

    Tkrain42

    Joined:
    Jul 25, 2015
    Posts:
    43
    Using Unity 2022.1.5
    To start, I'll own up, I caused the stack overflow... I had a method call itself instead of calling the method it supposed to with a similar name.

    Code (CSharp):
    1.  
    2. private JToken CaptureAsToken()
    3. { //stuff }
    4.  
    5. public JToken CaptureToCloud()
    6. {
    7.     return CaptureToCloud();
    8. }
    When the save function was called, the inspector would immediately crash. The only log updated in Logs was rather odd:
    Code (CSharp):
    1. (file = shadercompiler-UnityShaderCompiler.exe0.log (in project folder/logs)
    2. Base path: 'C:/Program Files/Unity/Hub/Editor/2022.3.5f1/Editor/Data', plugins path 'C:/Program Files/Unity/Hub/Editor/2022.3.5f1/Editor/Data/PlaybackEngines'
    3. Cmd: initializeCompiler
    4.  
    5. Unhandled exception: Protocol error - failed to read magic number (error -2147483644, transferred 0/4)
    6.  
    7. Quitting shader compiler process
    If I build out the player, it simply hangs, which is actually what I expect with a recursive stack overflow... it has to finish using up my 32 gig of memory before it finishes crashing. I never let it get to the point of fully crashing, as that's when I figured out what was going on and went back and found my recursion and fixed it. It would be handy if instead of a cryptic logout like this, we got something like "Unity has detected a stack overflow in [script][method]".
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,263
    It always feels like it kinda depends where your SO happens: where in code, what platform you're on, etc.

    In some places it's a silent forever lock... in others it throws a StackOverflowExceptions... in others it just SIG_TERMs and gives you nothing.