Unity crash due to code

So, I have encountered an issue with Unity crashing, and I can’t figure out exactly why. Well, after some time I isolated it to a particular function call, but I don’t know why the function call is crashing. For background, I’m crashing in a call executed during the Awake() call on an otherwise empty object.

Here’s where it happens:

		List<string> t_str = new List<string>()
			{
				"difficulty",
				"bonusLevelFollows",
				"rewardForCompletion",
				"startMessage",
				"gameGoalMessage",
			};
		throw new System.Exception( "LAWLER" );
		Dictionary<string, ParseResult> res = parser.ExtractElements( t_str );

for parser.ExtractElements :

	public Dictionary<string, ParseResult> ExtractAttributes( List<string> attributes )
	{
		throw new System.Exception( "=O" );
		//...

As written, this fails with the exception “LAWLER” as expected. However, if I uncomment that exception, Unity hangs. It does not end with an exception “=O”, but just hangs. This appears to me to suggest that either I’ve reached some stack height limit that just makes Unity freak out, or there’s some other obscure bug in Unity. Worse, further down in the stack, I call this same function without issue, catch the exception, and continue just fine.

I’m at a loss, and unable to proceed.

Does it mean anything that you call “ExtractElements” but posted the method “ExtractAttributes”? Can you post the ExtractElements method please?

if you have uncatched exceptions, unity will on win64 not just hang but flat out crash … is a win 32bit vs 64bit issue there though, nothing in unitys hands

Oh goodness, an infinite loop in ExtractElements.

Thanks for that Fizix.

Once again I find myself wishing that the debug output was a separate structure from the rest of the editor…