Log in

View Full Version : Avisynth is crashing, causing VirtualDub to crash too.


Various
1st March 2008, 18:03
This first occurred this while I had VirtualDub 1.7.7 serving frames to TMPGenc. I had opened my AVS file in VirtualDub. VirtualDub reported an out of range memory access. The film that I am creating is the product of Avisynth files and has many dissolves.

I actually have two versions of the film, both cause a crash. One is an AVS that calls other AVS files. The other is an AVS that only loads in existing AVI files and does a very simple dissolve of all of them as a sequence, 10 frames per dissolve. All of the inputs are 720x480, 30.000 fps.

In the AVS that is nested, I have ConvertToYV12 on all inputs, be they AVI (HuffyUV) or AVS.

In the AVS that is not nested, all inputs are AVIs encoded with HuffyUV.

After observing crashes while serving frames, I discovered that both AVS files cause crashes when I'm not serving frames, too. I was writing out a Divx file for each.

I then opened by nested Avs in the brand-new VirtualDub 1.8 and the first thing I did was use the pulldown menu item to scan for frame errors.

During this scan, I got a popup that said:
Avisynth read error:
CAVIStreamSynth: System exception: Access Violation 0x0, reading...

I am using Avisynth 2.5.8.

Here's the call stack from the most recent attempt to use VirtualDub to scan for frame error in the AVS input.

Thread call stack:
004e111f: VideoSourceAVI::_destruct()
004e11ba: VideoSourceAVI::~VideoSourceAVI()
004e22f8: VideoSourceAVI::(special)()
00433e86: VideoSource::Release()
004d606e: InputFileAVI::~InputFileAVI()
004d73f8: InputFileAVI::(special)()
00433ee6: ?$vdrefcounted::Release()
00433f21: ?$vdrefptr::(special)()
004a3d86: VDProject::CloseAVI()
00485cba: Deinit()
bff74272: KERNEL32.DLL!ThunkConnect32 [bff70000+2ebe+13b4]
bff52526: USER32.DLL!PaintDesktop [bff50000+2513+13]
0048fb83: WinMain@16()
0048fc91: WinMain@16()
0059298c: __set_flsgetvalue()
00592b38: _getptd_noexit()
0059010a: __tmainCRTStartup()
bff8b560: KERNEL32.DLL!IsDBCSLeadByte [bff70000+1af78+5e8]
bff7b326: KERNEL32.DLL!IsBadHugeWritePtr [bff70000+a5be+d68]
bff8b412: KERNEL32.DLL!IsDBCSLeadByte [bff70000+1af78+49a]

This is on Windows 98SE.

Guest
1st March 2008, 18:38
Make a minimal script with one source file fragment that crashes. Then post a link to the unprocessed source file and post your script.

Also, see here:

http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD:2005-08,GGLD:en&q=CAVIStreamSynth%3a+System+exception+site%3aforum%2edoom9%2eorg

Various
3rd March 2008, 13:03
After some analysis I realized this was being caused by corrupted video files. I wouldn't have guessed that bad input data would crash the program. Normally people write code so that bad input leads to an error, not a crash.

squid_80
3rd March 2008, 13:36
I wouldn't have guessed that bad input data would crash the program. Normally people write code so that bad input leads to an error, not a crash.
So are we talking about crashes or errors here:
VirtualDub reported an out of range memory access.
During this scan, I got a popup that said:

Quote:
Avisynth read error:
CAVIStreamSynth: System exception: Access Violation 0x0, reading...


Now you're probably going to say those error messages are insufficient. But that's all avisynth knows about the problem - if the input data is bad and the codec used for decompression is crashing that's outside avisynth's control. Another way of putting it - if you were given an error message that told you exactly what the problem was, wouldn't you prefer the program to just shut up and fix it?