View Full Version : Disabling Avisynth exception catching
SansGrip
16th November 2002, 19:14
Is it possible to stop Avisynth catching, for example, memory read/write exceptions? A search turned up a reference to doing it, but it didn't say how to do it.
trbarry
17th November 2002, 18:54
I'm not sure what you are attempting but this has been a confusing issue to me also. I like to debug in the VS6 IDE. But some errors are trapped and handled in Avisynth, Virtualdub, etc. so I don't get control on them.
For my purposes I had to change the error trapping in VS6. Under the Debug menu there is a selection Exceptions, but even though I sort of remembered it I could not find it because it is greyed out unless you are actually running the test program. But under that selection it is possible to set "Stop Always" for selected type of exceptions.
Don't know if this rambling at all relates to what you want to do. ;)
- Tom
SansGrip
18th November 2002, 01:37
I'm not sure what you are attempting but this has been a confusing issue to me also.
Glad I'm not the only one ;).
Basically I don't want Avisynth trapping memory exceptions, etc., when I'm debugging. It makes it very time-consuming to locate where the exception is occurring (there's only so much one can do with conditional breakpoints and stepping before one considers packing it all in and becoming a monk).
If I were able to turn off Avisynth's trapping of these exceptions then the debugger would catch them and drop me straight into the code where the exception was triggered, and I could inspect state instead of guessing.
For my purposes I had to change the error trapping in VS6. Under the Debug menu there is a selection Exceptions, but even though I sort of remembered it I could not find it because it is greyed out unless you are actually running the test program. But under that selection it is possible to set "Stop Always" for selected type of exceptions.
Interesting, I didn't know about that one. I'll have to find the option in VS7.
Don't know if this rambling at all relates to what you want to do. ;)
It does ;). Thanks.
Richard Berg
18th November 2002, 04:01
One workaround would be to use Win9x, which doesn't care if you overwrite random memory ;) Seriously though, I don't think it's our code that throws these errors (although VDub's use of catch(...) is what catches it) -- it's in the runtime.
SansGrip
18th November 2002, 05:13
One workaround would be to use Win9x, which doesn't care if you overwrite random memory ;)
I'd rather print a binary dump of the code and step through it on paper :D.
Seriously though, I don't think it's our code that throws these errors (although VDub's use of catch(...) is what catches it) -- it's in the runtime.
I was referring to when Avisynth displays the red-on-black "Unhandled exception" messages. Surely that's Avisynth and not the runtime?
trbarry
18th November 2002, 06:21
One more thing to watch out for if you start trapping all errors in the VS6 IDE. I don't know about anyone else but with Avisynth 2.5 YV12 I wiil always start out a script with approx 27 trapped addressing exceptions in Divx!.dll. I have no idea of the cause of this but it is annoying.
- Tom
sh0dan
18th November 2002, 09:55
@trbarry: I get them too - seems like there are bugs in the DivX (unfortunately) - using Xvid will probably solve this.
In v2.5 debug mode, the internal exception catching it disabled in AviSynth (using some ifdefs), so if you have compiled your AviSynth.dll in debug mode, MS VC should get the error.
Otherwise my own solution is to use "Stop Always". You may note that these can be changed runtime, so you can:
1) Start up vdub.
2) Load the AVS.
3) Enable "Stop Always".
4) Go to the first frame.
A better solution would be to add a script function that disables the exception catching - it _is_ very annoying!
trbarry
18th November 2002, 15:33
I remember there was talk on the Xvid list about a YV12 decoder that would replace that Divx one. Anyone know if this is possible now, or how to activate it if so? It would certainly simplify YV12 debugging.
- Tom
SansGrip
18th November 2002, 16:41
In v2.5 debug mode, the internal exception catching it disabled in AviSynth (using some ifdefs), so if you have compiled your AviSynth.dll in debug mode, MS VC should get the error.
I notice an occasional first-chance exception in 2.06 along the lines of "IScriptEnvironment: not found" or something. I have no idea what that means.
Otherwise my own solution is to use "Stop Always".
Sounds like this is the answer, for now. Thanks :).
A better solution would be to add a script function that disables the exception catching - it _is_ very annoying!
Sounds like this is the answer, for 2.5 ;). Or, maybe even better, something (in the filter) along the lines of:
#ifdef _DEBUG
env->SetExceptions(NO_EXCEPTIONS);
#endif
NO_EXCEPTIONS could be an all-zero bitmask, with other constants for the various kinds of exceptions (e.g. MEMORY_EXCEPTIONS, UNKNOWN_EXCEPTIONS). This way they could be turned on and off at whim without having to alter the script.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.