This project is read-only.
1
Vote

Crash due to Preset parser

description

Autoupdate of 1.5.28 to 1.5.30 fails in several respects
  • Auto-Update by the app installs to %ProgramFiles%\VidCoder, even if the running instance lives elsewhere and running the installer manually would recognize the last used installation path properly.
  • If done with queue entries using nlmeans or manual presets using nlmeans (as written by build 28), the app is not startable.
  • Deleting %AppData%\VidCoder\VidCoder.sqlite "fixes" the problem. Workaround would be acceptable if there was a way to export/import user presets into/from an xml file.
  • Executing an "UPDATE presetsXml SET xml = REPLACE(xml, '>NlMeans<', '>NLMeans<') WHERE xml LIKE '%>NlMeans<%'; UPDATE settings SET value = REPLACE(value, '>NlMeans<', '>NLMeans<') WHERE name = 'EncodeJobs2'; COMMIT TRANSACTION; VACUUM FULL;" against the sqlite database fixes the problem properly - but is that within everyones' skill set?.
  • Oh, and the installer overwriting a cleaned BuiltInPresets.xml without asking isn't to my liking either :) No, seriously: A "hide all builtin presets" preference would be ideal.
  • Other missing options: Auto-Vacuum, Auto-Cleanup of log files (those in appdata) and at least an option to disable the copying of tags (what I'd really like is the ability to automatically set all well-known tags from a sidecar file and/or automatically set a cover from a jpeg with same name in the source folder)
  • Minor criticism: Having the queue in a single blob inside the settings table seems silly. Shouldn't a blob-per-entry approach like for the presets be a bit more friendly to the fragile sqlite engine?
Note the "NlMeans" value it complains about didn't get there without pain either: When I updated from .26beta it modified all my presets and queue entries resetting them to no denoising because it didn't have a backwards compatibility translator for the old notation - but it didn't crash either. So it did have Exception handling in the preset parser in the past!

Crash output - redundant as the above should already be obvious:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: There is an error in XML document (1, 1205). ---> System.InvalidOperationException: Instance validation error: 'NlMeans' is not a valid value for Denoise.
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read71_Denoise(String s)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read75_VCProfile(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read86_Preset(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read253_Preset()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at VidCoder.Model.Presets.LoadPresetXmlString(String presetXml) in d:\docs\projects\VidCoder\VidCoder\Model\Presets.cs:line 159
   at VidCoder.Model.Presets.GetPresetListFromDb() in d:\docs\projects\VidCoder\VidCoder\Model\Presets.cs:line 748
   at VidCoder.Model.Presets.get_UserPresets() in d:\docs\projects\VidCoder\VidCoder\Model\Presets.cs:line 58
   at VidCoder.ViewModel.Components.PresetsViewModel..ctor() in d:\docs\projects\VidCoder\VidCoder\ViewModel\Components\PresetsViewModel.cs:line 36
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at GalaSoft.MvvmLight.Ioc.SimpleIoc.MakeInstance[TClass]()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService(Type serviceType, String key)
   at GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance[TService]()
   at VidCoder.ViewModel.Components.ProcessingViewModel..ctor() in d:\docs\projects\VidCoder\VidCoder\ViewModel\Components\ProcessingViewModel.cs:line 47
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at GalaSoft.MvvmLight.Ioc.SimpleIoc.MakeInstance[TClass]()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService(Type serviceType, String key)
   at GalaSoft.MvvmLight.Ioc.SimpleIoc.GetInstance[TService]()
   at VidCoder.ViewModel.MainViewModel..ctor() in d:\docs\projects\VidCoder\VidCoder\ViewModel\MainViewModel.cs:line 100
   at VidCoder.App.OnStartup(StartupEventArgs e) in d:\docs\projects\VidCoder\VidCoder\App.xaml.cs:line 137
   at System.Windows.Application.<.ctor>b__1(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

comments

RandomEngy wrote Dec 13, 2014 at 4:57 PM

As for the update going to a different place: Did you move it manually after the install or did you install originally in that directory? I'll look into adding a parameter to the updater to make sure it always installs to the current directory.

About the NLMeans crash: that was caused by HandBrake changing the capitalization on some of their enums. I've got a fix lined up for it for 1.5.31 and have changed my presets to stop relying on the HandBrake types (so they don't break preset compatibility).

As for the installer clearing out your BuiltInPresets.xml... I didn't really expect users to want to delete or hide these. Your own user profiles show up at the top, so they're not exactly in the way. Why do you want to do this?

About the log file cleanup: it does automatically clean up logs older than 30 days. Are you finding the size of a month's worth of logs too large? How big did it get for you?

About metadata tags: This is something handed by the HandBrake engine I use. I don't give any inputs to it regarding media tags.

About the queue being in a single blob in the SQLite DB: actually it has never given me any problems in terms of reliability. SQLite is very far from "fragile": it has journaling so it can keep the DB in a good state even when it crashes in the middle of a transaction. As long as I pass in a complete queue to save in the DB, it's always going to work. Not once have I had a bug report indicating that their DB was corrupt.

Thanks for the detailed feedback!

RandomEngy wrote Jan 2, 2015 at 5:39 AM

The NLMeans crash should be fixed in 1.5.31.

RandomEngy wrote Jan 2, 2015 at 5:40 AM

Also the installer should always try to install to the currently installed directory now.