Skip to main content
GameDev.net gamedev.net
🔒 Locked

More crashes with try/catch

Started by Miss Apr 6, 2025 at 8:11 PM 3 replies 2.4k views
Original Post
Miss
Miss

Back in 2023, we had this issue: https://www.gamedev.net/forums/topic/714882-crash-in-trycatch-blocks/5459220/?page=1

I am now running into a very similar issue:

class Bar {}
class Foo { Bar@ Bar; }
void Main() {
	Foo@ f;
	for (int i = 0; i < 1000; i++) {
		try {
			auto foo = f.Bar;
		} catch { }
	}
}

When executing this, we get:

It looks like we are running out of space on the stack, causing an out-of-bounds write, if I am reading this correctly.

Additionally, would it make sense to add some (debug-only) assertions to this code, so that these cases can be caught more reliably? I've had some trouble getting this to break at the right point due to it essentially being heap corruption.

WitchLord
WitchLord

Thanks for the bug report. I'll investigate this and have it fixed.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.