Stack Overflow being reported as a Shader Compiler error

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.

private JToken CaptureAsToken()
{ //stuff }

public JToken CaptureToCloud()
{
    return CaptureToCloud();
}

When the save function was called, the inspector would immediately crash. The only log updated in Logs was rather odd:

(file = shadercompiler-UnityShaderCompiler.exe0.log (in project folder/logs)
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'
Cmd: initializeCompiler

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

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]”.

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.