Log in

View Full Version : Vapoursynth + QTGMC + OS X crash issue


AndyL
5th June 2021, 13:30
I'm having a real problem trying to run QTGMC at the moment - it used to work, but seemed to break after I installed OSX 11.4 (reverting to 11.3.1 has not fixed it)

Main crash log message:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00007f9750000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [6657]


The crashed thread (almost) always looks something like this:

Thread 20 Crashed:
0 libmvtools.dylib 0x000000010f1db2b9 HorizontalWiener_avx2(unsigned char*, unsigned char const*, long, long, long, long) + 313
1 libmvtools.dylib 0x000000010ef54309 mvpRefine + 505
2 libmvtools.dylib 0x000000010ef645fb mvgofRefine + 43
3 libmvtools.dylib 0x000000010ef68066 mvsuperGetFrame + 870
4 libvapoursynth.dylib 0x000000010e3e8275 VSNode::getFrameInternal(int, int, VSFrameContext&) + 69
5 libvapoursynth.dylib 0x000000010e400fa2 VSThreadPool::runTasks(VSThreadPool*, std::__1::atomic<bool>&) + 2178
6 libvapoursynth.dylib 0x000000010e402fc0 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(VSThreadPool*, std::__1::atomic<bool>&), VSThreadPool*, std::__1::reference_wrapper<std::__1::atomic<bool> > > >(void*) + 48
7 libsystem_pthread.dylib 0x00007fff204d98fc _pthread_start + 224
8 libsystem_pthread.dylib 0x00007fff204d5443 thread_start + 15

The crash seems to be pretty random - one time it might get several thousand frames in, another it might not reach frame 100.

I've tried a lot of permutations of QTGMC params, and after looking at the crash log, I've tried four different versions of mvtools (versions 20 through 23) v22 seems to crash the least, but it still crashes a good deal.

At my wits end with this one - has anyone come across this, or got any suggestions on how I might be able to deal with it?

Full Crash log attached.

Selur
5th June 2021, 21:14
Are you using the libraries provided by l33tmeatwad or do you compile them yourself. If you don't use them, try them.

Cu Selur

AndyL
5th June 2021, 23:43
Are you using the libraries provided by l33tmeatwad or do you compile them yourself. If you don't use them, try them.

I've tried both. Started by trying each of the four l33tmeatwad versions, and tried compiling my own as a desperation move after that. Same result for all of them.

Selur
6th June 2021, 11:30
Hmm, sadly I can't reproduce this since the VM I run MacOS in seems to be stuck at 11.1 (even 'softwareupdate -i -a' doesn't list any available updates,...)

From the looks of it the problem is with the HorizontalWiener_avx2 code in libmvtools.
Is your CPU AVX2 capable?
Are you using QTGMC from havsfunc or G41fun ?
What does your script look like?
My guess that you use 'Slow', 'Slower' or 'Placebo' preset, Try using SubPel=1
0 for soft interpolation (bilinear)
1 for bicubic interpolation (4 tap Catmull-Rom),
2 for sharper Wiener interpolation (6 tap, similar to Lanczos) <- this is where the crash happens

-> managed to get my VM updated and QTGMC with presets Slower&Co works fine, so it's not a general MacOS 11.4 issue.

Cu Selur

AndyL
6th June 2021, 19:41
Hmm, sadly I can't reproduce this since the VM I run MacOS in seems to be stuck at 11.1 (even 'softwareupdate -i -a' doesn't list any available updates,...)

Well - thanks for giving that a go. I can supply the file if it would help?

From the looks of it the problem is with the HorizontalWiener_avx2 code in libmvtools.
Is your CPU AVX2 capable?

Yep. Coffee Lake i7-8700K

Are you using QTGMC from havsfunc or G41fun ?

Tried both, with the same result.

What does your script look like?

My guess that you use 'Slow', 'Slower' or 'Placebo' preset, Try using SubPel=1

Key part of the script:
clip = G41Fun.QTGMC(clip, Preset='Slow', TFF=True, FPSDivisor=2)
#clip = core.tdm.TDeintMod(clip, 1)

clip = core.vivtc.VDecimate(clip)


I've now tweaked it to add SubPel=1 in. It's looking very promising - it's been going for around 30 minutes, which is the longest it's gone without a crash. I'm cautiously optimistic - the render has another 40 mins or so to go, so I'll report back when it's done.

Thanks again for your help.

AndyL
6th June 2021, 21:58
The job finished successfully - so I think this has worked. Thanks again.

Selur
7th June 2021, 17:48
That didn't really fix the underlying issue, it just overwrites the settings to avoid 'SubPel=2' which would be used according to the preset
Very Very Super Ultra
# Preset groups: Placebo Slow Slower Slow Medium Fast Faster Fast Fast Fast Draft
...
if SubPel is None: SubPel = [ 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 ][pNum]


Cu Selur

AndyL
7th June 2021, 22:09
That didn't really fix the underlying issue, it just overwrites the settings to avoid 'SubPel=2' which would be used according to the preset
Very Very Super Ultra
# Preset groups: Placebo Slow Slower Slow Medium Fast Faster Fast Fast Fast Draft
...
if SubPel is None: SubPel = [ 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1 ][pNum]


Cu Selur

Yeah - I figured - but it seems to be doing a good enough job for what I need - and until a better solution comes along, I'm just pleased to have it working reliably.