Skip to content

"Unhandled exception loading vsClojure" in VS2013; then crashes VS #164

Open

Description

@renedamm

I've installed vsClojure 2.1.6 into Visual Studio Professional 2013 (Version 12.0.30110.0 Update 1) through NuGet. After restarting, the follow error message shows:

unhandledexceptionloadingvsclojure

After clicking OK, VS will eventually crash. Every subsequent launch will crash as well (without showing the dialog above, though) until vsClojure is uninstalled.

I have a host of other extensions installed (including ReSharper and ViEmu) so there may be some conflict here.

Activity

  1. changed the title [-]"Unhandled exception loading vsClosure" in VS2013; then crashes VS[/-] [+]"Unhandled exception loading vsClojure" in VS2013; then crashes VS[/+] on Apr 26, 2014
  2. frankhale commented on Apr 26, 2014

    @frankhale
    Contributor

    I'd ask you to build vsClojure from the master code but it requires a working vsClojure extension. I've built the latest master and have it on my OneDrive. I'd like to share the extension with you if you would like to try it. This would help me because I could determine if the problem still exists with the latest code. 2.1.6 is a bit behind master now. I'll need an email address in order to share the file with you because OneDrive requires an email when sharing files.

  3. renedamm commented on Apr 26, 2014

    @renedamm
    Author

    Sure, I'll give it a go. Address is rene.damm AT gmx.net.

  4. frankhale commented on Apr 26, 2014

    @frankhale
    Contributor

    Okay, I've sent you an invite to get the file. This is a build of the vsClojure extension from the master code.

  5. csnemes commented on Apr 27, 2014

    @csnemes

    I've the same issue when installed from the vsix package to VS2013 udpate 1. It fails on each start and kills VS. Running with debugging I've got this:

    System.TypeInitializationException was caught
      HResult=-2146233036
      Message=The type initializer for 'vsClojure.Metadata' threw an exception.
      Source=vsClojure.Metadata
      TypeName=vsClojure.Metadata
      StackTrace:
           at vsClojure.Metadata..ctor()
           at ClojureExtension.Deployment.ClojurePackage.<Initialize>b__0() in c:\Work\OpenSource\vsClojure\ClojureExtension.Deployment\ClojurePackage.cs:line 101
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.TypeInitializationException
           HResult=-2146233036
           Message=The type initializer for 'clojure.lang.RT' threw an exception.
           Source=Clojure
           TypeName=clojure.lang.RT
           StackTrace:
                at clojure.lang.Namespace..ctor(Symbol name)
                at clojure.lang.Namespace.findOrCreate(Symbol name)
                at clojure.lang.Var.internPrivate(String nsName, String sym)
                at vsClojure.Metadata..cctor()
           InnerException: clojure.lang.Compiler.AssemblyInitializationException
                HResult=-2146233088
                Message=Error initializing clojure.core.clj, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: Exception has been thrown by the target of an invocation.
                Source=Clojure
                StackTrace:
                     at clojure.lang.Compiler.InvokeInitType(Assembly assy, Type initType)
                     at clojure.lang.Compiler.InitAssembly(Assembly assy, String relativePath)
                     at clojure.lang.Compiler.LoadAssembly(FileInfo assyInfo, String relativePath)
                     at clojure.lang.RT.load(String relativePath, Boolean failIfNotFound)
                     at clojure.lang.RT.load(String relativePath)
                     at clojure.lang.RT.DoInit()
                     at clojure.lang.RT..cctor()
                InnerException: System.Reflection.TargetInvocationException
                     HResult=-2146232828
                     Message=Exception has been thrown by the target of an invocation.
                     Source=mscorlib
                     StackTrace:
                          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.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                          at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
                          at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
                          at clojure.lang.Compiler.InvokeInitType(Assembly assy, Type initType)
                     InnerException: System.TypeInitializationException
                          HResult=-2146233036
                          Message=The type initializer for '__Init__$clojure/core' threw an exception.
                          Source=clojure.core.clj
                          TypeName=__Init__$clojure/core
                          StackTrace:
                               at __Init__$clojure/core.Initialize()
                          InnerException: System.InvalidOperationException
                               HResult=-2146233079
                               Message=Pop without matching push
                               Source=Clojure
                               StackTrace:
                                    at clojure.lang.Var.popThreadBindings() in c:\Work\OpenSource\clojure-clr\Clojure\Clojure\Lib\Var.cs:line 681
                                    at __Init__$clojure/core..cctor()
                               InnerException: 
    

    I've used the 1.5.0 clojure-clr and vsClojure master. I've plenty of other extensions too (e.g. R#).

  6. frankhale commented on Apr 28, 2014

    @frankhale
    Contributor

    Thank you for the bug report.

    On Sun, Apr 27, 2014 at 1:40 PM, csnemes notifications@github.com wrote:

    I've the same issue when installed from the vsix package to VS2013 udpate

    1. It fails on each start and kills VS. Running with debugging I've got
      this:

    System.TypeInitializationException was caught
    HResult=-2146233036
    Message=The type initializer for 'vsClojure.Metadata' threw an exception.
    Source=vsClojure.Metadata
    TypeName=vsClojure.Metadata
    StackTrace:
    at vsClojure.Metadata..ctor()
    at ClojureExtension.Deployment.ClojurePackage.b__0() in c:\Work\OpenSource\vsClojure\ClojureExtension.Deployment\ClojurePackage.cs:line 101
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException: System.TypeInitializationException
    HResult=-2146233036
    Message=The type initializer for 'clojure.lang.RT' threw an exception.
    Source=Clojure
    TypeName=clojure.lang.RT
    StackTrace:
    at clojure.lang.Namespace..ctor(Symbol name)
    at clojure.lang.Namespace.findOrCreate(Symbol name)
    at clojure.lang.Var.internPrivate(String nsName, String sym)
    at vsClojure.Metadata..cctor()
    InnerException: clojure.lang.Compiler.AssemblyInitializationException
    HResult=-2146233088
    Message=Error initializing clojure.core.clj, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: Exception has been thrown by the target of an invocation.
    Source=Clojure
    StackTrace:
    at clojure.lang.Compiler.InvokeInitType(Assembly assy, Type initType)
    at clojure.lang.Compiler.InitAssembly(Assembly assy, String relativePath)
    at clojure.lang.Compiler.LoadAssembly(FileInfo assyInfo, String relativePath)
    at clojure.lang.RT.load(String relativePath, Boolean failIfNotFound)
    at clojure.lang.RT.load(String relativePath)
    at clojure.lang.RT.DoInit()
    at clojure.lang.RT..cctor()
    InnerException: System.Reflection.TargetInvocationException
    HResult=-2146232828
    Message=Exception has been thrown by the target of an invocation.
    Source=mscorlib
    StackTrace:
    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.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
    at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
    at clojure.lang.Compiler.InvokeInitType(Assembly assy, Type initType)
    InnerException: System.TypeInitializationException
    HResult=-2146233036
    Message=The type initializer for 'Init$clojure/core' threw an exception.
    Source=clojure.core.clj
    TypeName=Init$clojure/core
    StackTrace:
    at Init$clojure/core.Initialize()
    InnerException: System.InvalidOperationException
    HResult=-2146233079
    Message=Pop without matching push
    Source=Clojure
    StackTrace:
    at clojure.lang.Var.popThreadBindings() in c:\Work\OpenSource\clojure-clr\Clojure\Clojure\Lib\Var.cs:line 681
    at Init$clojure/core..cctor()
    InnerException:

    I've used the 1.5.0 clojure-clr and vsClojure master. I've plenty of other
    extensions too (e.g. R#).

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/164#issuecomment-41503147
    .

  7. csnemes commented on Apr 30, 2014

    @csnemes

    Thinking it over I believe it wasn't the brightest idea to try to reproduce the bug by rebuilding the package as the whole rebuilding process might have introduced variances, so it is not the same binary and for me it seems that it fails for a different reason than the original package. When I created a dump on the crashing VS using the original Vsix from the gallery it led me to a different problem. It fails to find Clojure.dll when it does the assembly binding first invoking the Metadata class. The stack trace is:

    1212e338 0dca29bf vsClojure.Metadata..ctor()
    1212e33c 0dca297e ClojureExtension.Editor.Intellisense.HippieCompletionSource.<Initialize>b__0()
    1212e348 73e4d93b System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
    1212e354 73e1df17 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
    

    Strange thing is that the fusion looks in the wrong place (see the appbase)

    File:        C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
    String:      === Pre-bind state information ===
    LOG: DisplayName = Clojure, Version=1.4.0.0, Culture=neutral, PublicKeyToken=d0a477b1756ef34d
     (Fully-specified)
    LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/
    LOG: Initial PrivatePath = NULL
    Calling assembly : vsClojure.Metadata, Version=0.0.0.0, Culture=neutral, PublicKeyToken=d0a477b1756ef34d.
    ===
    

    I installed the same package (from the gallery) into a virtual machine with a vanila VS2013 Update1 and it works there, so my guess that the problem should be with either one of the other packages or the number of the packages or it might be some timing issue given that you using the type in a separate thread.

  8. frankhale commented on May 1, 2014

    @frankhale
    Contributor

    Thank you for the investigative work!

  9. frankhale commented on Aug 22, 2014

    @frankhale
    Contributor

    Installation stability issues seem to be the primary concern right now. Any assistance you guys can give would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions