I cannot even open Handbrake for the first time

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
doggeria
New User
Posts: 1
Joined: Sat Jan 05, 2019 3:02 am

I cannot even open Handbrake for the first time

Post by doggeria » Sat Jan 05, 2019 3:06 am

Description of problem or question:
Every time I try to open Handbrake for the first time I just get met with this issue
An Unknown Error has occurred.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'HandBrake.Interop.Interop.HandBrakeUtils' threw an exception. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at HandBrake.Interop.Interop.HbLib.HBFunctions.hb_global_init()
at HandBrake.Interop.Interop.HandBrakeUtils..cctor() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrake.Interop\Interop\HandBrakeUtils.cs:line 60
--- End of inner exception stack trace ---
at HandBrake.Interop.Interop.HandBrakeUtils.add_MessageLogged(EventHandler`1 value)
at HandBrakeWPF.Services.Logging.LogService..ctor() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Services\Logging\LogService.cs:line 57
at HandBrakeWPF.Services.Logging.LogService.GetLogger() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Services\Logging\LogService.cs:line 158
at HandBrakeWPF.Services.Scan.LibScan..ctor() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Services\Scan\LibScan.cs:line 51
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Caliburn.Micro.SimpleContainer.ActivateInstance(Type type, Object[] args)
at Caliburn.Micro.SimpleContainer.<>c__DisplayClass7_0.<RegisterSingleton>b__0(SimpleContainer container)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Caliburn.Micro.SimpleContainer.DetermineConstructorArgs(Type implementation)
at Caliburn.Micro.SimpleContainer.<>c__DisplayClass7_0.<RegisterSingleton>b__0(SimpleContainer container)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Caliburn.Micro.SimpleContainer.DetermineConstructorArgs(Type implementation)
at Caliburn.Micro.SimpleContainer.<>c__DisplayClass7_0.<RegisterSingleton>b__0(SimpleContainer container)
at HandBrakeWPF.Startup.AppBootstrapper.GetInstance(Type service, String key) in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Startup\AppBootstrapper.cs:line 130
at Caliburn.Micro.BootstrapperBase.DisplayRootViewFor(Type viewModelType, IDictionary`2 settings)
at HandBrakeWPF.Startup.AppBootstrapper.OnStartup(Object sender, StartupEventArgs e) in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Startup\AppBootstrapper.cs:line 113
at System.Windows.Application.OnStartup(StartupEventArgs e)
at HandBrakeWPF.App.OnStartup(StartupEventArgs e) in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\App.xaml.cs:line 121
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)



Steps to reproduce the problem (If Applicable):
Open handbrake


HandBrake version (e.g., 1.0.0):

HandBrake-20181230-8fdce9d_x86_64-Win_GUI.exe, that is the nightly version, but I also had the same issue with the latest non-nightly version.


Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Windows 10 64 bit


HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

An Unknown Error has occurred.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'HandBrake.Interop.Interop.HandBrakeUtils' threw an exception. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at HandBrake.Interop.Interop.HbLib.HBFunctions.hb_global_init()
   at HandBrake.Interop.Interop.HandBrakeUtils..cctor() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrake.Interop\Interop\HandBrakeUtils.cs:line 60
   --- End of inner exception stack trace ---
   at HandBrake.Interop.Interop.HandBrakeUtils.add_MessageLogged(EventHandler`1 value)
   at HandBrakeWPF.Services.Logging.LogService..ctor() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Services\Logging\LogService.cs:line 57
   at HandBrakeWPF.Services.Logging.LogService.GetLogger() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Services\Logging\LogService.cs:line 158
   at HandBrakeWPF.Services.Scan.LibScan..ctor() in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Services\Scan\LibScan.cs:line 51
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Caliburn.Micro.SimpleContainer.ActivateInstance(Type type, Object[] args)
   at Caliburn.Micro.SimpleContainer.<>c__DisplayClass7_0.<RegisterSingleton>b__0(SimpleContainer container)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Caliburn.Micro.SimpleContainer.DetermineConstructorArgs(Type implementation)
   at Caliburn.Micro.SimpleContainer.<>c__DisplayClass7_0.<RegisterSingleton>b__0(SimpleContainer container)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Caliburn.Micro.SimpleContainer.DetermineConstructorArgs(Type implementation)
   at Caliburn.Micro.SimpleContainer.<>c__DisplayClass7_0.<RegisterSingleton>b__0(SimpleContainer container)
   at HandBrakeWPF.Startup.AppBootstrapper.GetInstance(Type service, String key) in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Startup\AppBootstrapper.cs:line 130
   at Caliburn.Micro.BootstrapperBase.DisplayRootViewFor(Type viewModelType, IDictionary`2 settings)
   at HandBrakeWPF.Startup.AppBootstrapper.OnStartup(Object sender, StartupEventArgs e) in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\Startup\AppBootstrapper.cs:line 113
   at System.Windows.Application.OnStartup(StartupEventArgs e)
   at HandBrakeWPF.App.OnStartup(StartupEventArgs e) in C:\HandBrake\hbworkspace\workspace\WindowsGui64\win\CS\HandBrakeWPF\App.xaml.cs:line 121
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

User avatar
s55
HandBrake Team
Posts: 9315
Joined: Sun Dec 24, 2006 1:05 pm

Re: I cannot even open Handbrake for the first time

Post by s55 » Sat Jan 05, 2019 10:48 am

Please make sure your Graphics drivers are fully up-to-date. We've also had feedback from AMD Ryzen users that a BIOS update helps in some cases.

Failing that, try boot into Windows Safe Mode. If HandBrake works there (and it seems to for most folks with this problem), you have an application installed with a broken win32 shell extension. The app doesn't have to be running for this problem to show up.

Unfortunately, no-one has told us what they have installed or decided to go to the hassle un-install/re-install software until they find the culprit so we don't have any more feedback to give. The guess is it'll be some utility package (Something that integrates into Windows explorer / the R-Click Menus), or some monitoring / overclocking software such as MSI Afterburner, RivaTuner or anything along those lines.

Don't currently believe it's an Antivirus software problem but you could try disabling for 2 minutes to confirm.

cyko
Posts: 2
Joined: Wed Jan 09, 2019 7:12 pm

Re: I cannot even open Handbrake for the first time

Post by cyko » Wed Jan 09, 2019 7:15 pm

Have the exact same issue, no solution so far, Version 1.1.1 still works fine, so thats what I am using at the moment.

User avatar
s55
HandBrake Team
Posts: 9315
Joined: Sun Dec 24, 2006 1:05 pm

Re: I cannot even open Handbrake for the first time

Post by s55 » Wed Jan 09, 2019 8:29 pm

Have you tried any of the suggestions above?
Can you post the error your getting?

cyko
Posts: 2
Joined: Wed Jan 09, 2019 7:12 pm

Re: I cannot even open Handbrake for the first time

Post by cyko » Thu Jan 10, 2019 3:46 pm

Already had a Ticket opened (#1777) and stopped nearly all background tasks with no success. Haven't tried uninstalling something.
When someone could point out how to debug hb.dll in windows I could take a look at that (Yes, I have programming experience). Anyway, the main question is why handbrake suddenly relies on some broken shell extension? Also how do I you found out (from the log) that the problem is some shell extension? What about the Direct 3D Hooks mentioned in the sticky post?

User avatar
s55
HandBrake Team
Posts: 9315
Joined: Sun Dec 24, 2006 1:05 pm

Re: I cannot even open Handbrake for the first time

Post by s55 » Sun Jan 13, 2019 4:26 pm

It can be debugged with gdb but that's a bit of a painful experience on Windows. (You'd have to compile hb.dll with symbols)
Anyway, the main question is why handbrake suddenly relies on some broken shell extension?
It doesn't rely on shell extensions. Applications hooking into windows, are causing breakage such that when HandBrake tries to initialise, it crashes inside Windows which takes out the whole application.

Also note, we've had reports confirming Driver updates and also BIOS Updates (AMD side only.) have also resolved this particular crash too, so it appears there are several root causes.

If anyone can share their hardware setup + installed software + driver versions, I can try look into a bit further but right now, I don't have much to go on.

The logs don't provide anything useful regarding this error as there is no logging. Purely though user feedback that we've understand various issues.

Post Reply