Error handling from the middle ages
Well, it is no wonder that my attempts to debug the system where futile. I am using a 3rd party library to handle SQL parsing, and it fails on big SQL statements (admittedly, big here is defined in megabytes, but still). The part that utterly kills me is that I decided to track down the problem.
Here is what I found:
So if it is failing to parse the text it is going to kill the entire application!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Oh yeah, you can bet that I am angry now!
Comments
how did you know it was System.Environment.Exit? just checked it as one of possible options?
zvolkov,
There are very few things that can kill an app.
Certain exceptions, but we didn't get those.
Native heap corruption, but that has some manifestation.
Environment.Exit & Environment.FailFast
I just tried Exit first, and hit dirt, literally dirt
That would have been the next thing to try. You can actually set a breakpoint when apps are going to exit (I believe it would be !bp System.Environment.Exit with the assembly name, but do a !help bp to be sure).
Even if it was a native exception, you would have seen it in the WinDBG dump. You wouldn't have been able to do a !printexception (since that is SOS/Managed only) but you would have seen something.
Glad you got it figured out. Usually a combination of WinDBG/Reflector can track down most anything. But what a crappy thing to find.
Wow. Just wow.
Hmmm, I see a new 'pattern' emerging to use Environment.Exit instead of using exceptions. ;)
yikes. You might have to run that out of process :-/
Looks like another library you will need to write Ayende :)
Heh... wow... just wow is correct. Btw I don't think this and the last post were on your post schedule :)
Reverse engineer (there's a plugin you probably know about for .NET Reflector) - fix the frigging problem - compile -> happy life :-P
--larsw
Any feedback from developers?
Spectacular. On Error Goto Hell!
You're looking at a DLL compiled with Delphi for .NET. I believe that compiler is no longer supported, so you should consider moving to another library anyway.
There's no denying that's failing fast.
What did you use to track the problem down? I thought it was reflector, but it doesn't seem like so
This is incredible. That's literally the best programming WTF I've seen in a long time. I just lack words to express my admiration for the person who wrote this.
lonut,
It is reflector
why, if you cannot correct an error, you might as well let the app crash! ;-)
blogs.msdn.com/.../...tion-empty-catch-is-bad.aspx
except that now we get transactional memory, maybe that's going to be our solution for correcting state after exceptions? that and ... more power!
Comment preview