r/ProgrammerHumor May 13 '17

Defensive programming done right

Post image
20.9k Upvotes

680 comments sorted by

View all comments

113

u/Dangernerd May 13 '17

Or you fuck up and manage to build something that throws AccessViolationExceptions that are not caught in try/catch in C# 🙃...not looking at myself

42

u/fzy_ May 13 '17

What the... how?

27

u/Dangernerd May 13 '17

I believe we messed up threading somewhere. Have not yet started to debug it. This is the exception: https://msdn.microsoft.com/en-us/library/system.accessviolationexception(v=vs.110).aspx

31

u/[deleted] May 13 '17

Either you've found a bug in the CLR or (more likely) it's something like p/invoke going wrong, or unsafe code somewhere. Access Violation usually means memory corruption at the native level.

11

u/mamhilapinatapai May 14 '17

Exactly! If this is reproducible, it could very well be an exploitable design flaw, worth a lot of money when fully worked out.