YomikoR/VapourSynth-Editor

Expr Crash

nobananasforyou opened this issue · 3 comments

Hi!

VsEdit keeps crashing and I get the following error:
setVideoInfo: The VSVideoFormat pointer passed by Expr was not obtained from registerFormat() or getFormatPreset()
setVideoInfo: The VSVideoFormat pointer passed by Expr was not obtained from registerFormat() or getFormatPreset()

Could possibly be because the script below utilizes akarin.Expr.

Script:
import vapoursynth as vs
from vsutil import depth
from vsdehalo import fine_dehalo, YAHR, edge_cleaner
core = vs.core

src = core.d2v.Source(r'saz_v1_01.d2v')
src = src.vivtc.VFM(order=1, scthresh=8, cthresh=8).vivtc.VDecimate()
src = depth(src, 16)
src = edge_cleaner(src)
src = YAHR(src, expand=3)
src = fine_dehalo(src, darkstr=0)
src.set_output()

Are you using IEW packages with the latest versions?

Formerly there was an issue in vs-kernels (see vapoursynth/vapoursynth#897 (comment)). To make things clearer, VSEditor relies on vsscript, a component of VapourSynth, to evaluate .vpy scripts, which loads a python library and won't unload it. By keeping a reference of VS core in a python module, the core is never freed when script evaluation ends, causing a conflict on the second evaluation (same python, same core, but different environment).

To address this issue, the maintainers of IEW packages added some mechanism to detect such environment change (see vs_proxy.py in vs-tools), and prevent the script evaluation from working on, instead of letting VS crash. This probably affects VSEditor, vspreview-rs and Wobbly. The python based vspreview is different, as the VS core can be safely reused.

Unfortunately, when multiple references of VS core are kept, VS crashes even before their detection works.