8

Closed

Including TypeScript.js crashes VS when debugging

description

1) With version 0.8.1.0 create a new HTML Application with TypeScript
2) Copy the TypeScript binaries into the project
3) Add a script source reference to typescript.js in default.htm
4) Try to debug the application. Visual Studio crashes.

file attachments

Closed Jan 29, 2013 at 12:07 AM by RyanCavanaugh
Please reopen if you're still seeing this on 0.8.2.0. Thanks!

comments

billti wrote Nov 16, 2012 at 10:33 PM

I just tried these exact steps with the new release and it worked perfectly for me. Could you please outline:
  • The details of the crash error message, or events logged to the Application Log when this occurs.
  • Which version/build of VS you are using (Help / About, e.g. Visual Studio 2012 Web Express, 11.0.51106.01 Update 1).
  • If you had any issues debugging JavaScript applications prior to installing TypeScript.
  • If the scenario works if you uninstall TypeScript.
We have noticed that some systems that are pending an update already, don't get full functionality until they reboot (as any pending reboots suppress propagation of some system change notifications). Could you please also see if a reboot helps in case there was another system update pending.

Thanks!

phillod wrote Nov 16, 2012 at 11:22 PM

Thanks Bill. I just tried this on a second system and got the same problem.

VS Version: Ultimate 2012, 11.0.50727.1 RTMREL

I have done an uninstall/reboot/install/reboot and same thing. Here is the callstack from EventViewer:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at TypeScriptDebugEngine.SourceMapReader.getSourceMappingOfJsSource(Microsoft.VisualStudio.Debugger.Script.DkmScriptDocument)
at TypeScriptDebugEngine.SourceMapper.LoadFileMappings(Microsoft.VisualStudio.Debugger.Script.DkmScriptDocument)
at TypeScriptDebugEngine.SymbolProvider.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmModuleSymbolsUpdatedNotification.OnModuleSymbolsUpdated(Microsoft.VisualStudio.Debugger.DkmModuleInstance, Microsoft.VisualStudio.Debugger.Symbols.DkmModule, Microsoft.VisualStudio.Debugger.DkmWorkList, Microsoft.VisualStudio.Debugger.DkmEventDescriptor)
at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmModuleSymbolsUpdatedNotification_OnModuleSymbolsUpdated(IntPtr, IntPtr, IntPtr, IntPtr, IntPtr)
at Microsoft.VisualStudio.Debugger.NativeDkmModuleInstance.Proc7C740EFAED2FCAE33007EF4EB2BCA3CF(IntPtr, IntPtr)
at Microsoft.VisualStudio.Debugger.DkmModuleInstance.OnSymbolsUpdated(Microsoft.VisualStudio.Debugger.Symbols.DkmModule)
at TypeScriptDebugEngine.DebugMonitor.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmScriptSymbolsUpdatedNotification.OnScriptSymbolsUpdated(Microsoft.VisualStudio.Debugger.Script.DkmScriptRuntimeInstance, Microsoft.VisualStudio.Debugger.Script.DkmScriptDocument[], Microsoft.VisualStudio.Debugger.DkmWorkList, Microsoft.VisualStudio.Debugger.DkmEventDescriptor)
at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmScriptSymbolsUpdatedNotification_OnScriptSymbolsUpdated(IntPtr, IntPtr, IntPtr, IntPtr, IntPtr)

billti wrote Nov 17, 2012 at 5:15 PM

Thanks. Looking at the code where this is crashing, looks like we may have an issue if trying to debug a JS or TS file which isn't actually part of the Project being debugged (i.e. pulled in via a reference from somewhere outside the project, or the source file is marked as "Exclude from project"). Is that possible in your scenario?

phillod wrote Nov 19, 2012 at 2:39 AM

Yup. This appears to be the scenario. Adding the JS module to the project I can debug without crashing VS. Thanks for the pointer.

XVincentX wrote Nov 20, 2012 at 8:12 AM

It makes my Visual C++ project crash too when i hit f5!

onovotny wrote Nov 24, 2012 at 10:20 PM

This is crashing trying to debug a WP8 project. No javascript files in the solution or in the solution dir.

Here's the stack trace:
Stack:
at TypeScriptDebugEngine.TypeScriptInstruction.GetScriptInstructionAddress(Microsoft.VisualStudio.Debugger.DkmInstructionAddress)
at TypeScriptDebugEngine.SymbolProvider.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmLanguageInstructionDecoder.GetMethodName(Microsoft.VisualStudio.Debugger.Evaluation.DkmLanguageInstructionAddress, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags)
at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmLanguageInstructionDecoder_GetMethodName(IntPtr, IntPtr, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags, IntPtr ByRef)

Xilefius wrote Nov 26, 2012 at 3:40 PM

Not exactly the same error but we upgraded to 0.8.1 is a large project and debugging an exception in another silverlight client project (not using anything typescript, that is only used in the hosting project) visual studio also crashes. Only on the pc of the person developing the typescript the debugging works.

Exception message from eventlog:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
Stack:
at System.Collections.Generic.Dictionary2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].FindEntry(System.__Canon)
at System.Collections.Generic.Dictionary
2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ContainsKey(System.__Canon)
at TypeScriptDebugEngine.SourceMapper.GetFileMappings(Microsoft.VisualStudio.Debugger.Script.DkmScriptDocument)
at TypeScriptDebugEngine.SymbolProvider.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmSymbolQuery.GetSourcePosition(Microsoft.VisualStudio.Debugger.Symbols.DkmInstructionSymbol, Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionSession, Boolean ByRef)
at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmSymbolQuery_GetSourcePosition(IntPtr, IntPtr, Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, IntPtr, Byte ByRef, IntPtr ByRef)
at Microsoft.VisualStudio.Debugger.Symbols.NativeDkmInstructionSymbol.Proc74625D16DFFBC0BBB0B76F58AC775415(IntPtr, Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, IntPtr, Byte ByRef, IntPtr ByRef)
at Microsoft.VisualStudio.Debugger.Symbols.DkmInstructionSymbol.GetSourcePosition(Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionSession, Boolean ByRef)
at TypeScriptDebugEngine.SymbolProvider.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmLanguageFrameDecoder.GetFrameName(Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionContext, Microsoft.VisualStudio.Debugger.DkmWorkList, Microsoft.VisualStudio.Debugger.CallStack.DkmStackWalkFrame, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags, Microsoft.VisualStudio.Debugger.DkmCompletionRoutine`1<Microsoft.VisualStudio.Debugger.Evaluation.DkmGetFrameNameAsyncResult>)
at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmLanguageFrameDecoder_GetFrameName(IntPtr, IntPtr, IntPtr, IntPtr, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags, IntPtr)

gibwar wrote Nov 28, 2012 at 8:33 PM

billti: Sure, I can pretty much reproduce it on command with one of my projects. Before installing 0.8.1.0 it didn't crash and after installing it started to crash.
  • Microsoft Visual Studio Ultimate 2012 11.0.51106.01 Update 1
  • Had no issues debugging this project prior. No javascript files are even included in the solution. The solution contains 4 projects: 2 MVC, 1 WebForm, 1 Class Library. All targeting .Net 4.
  • Debugging works as expected if I uninstall TypeScript. Reinstalling it causes the crashes. Pretty much at demand at this point.
  • Definitely rebooted immediately after installing Update 1. Rebooted a couple times while troubleshooting too.
The following stack trace is identical for all crashes I encountered with TypeScript installed.

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException
Stack:
at System.Collections.Generic.Dictionary2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].FindEntry(System.__Canon)
at System.Collections.Generic.Dictionary
2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ContainsKey(System.__Canon)
at TypeScriptDebugEngine.SourceMapper.GetFileMappings(Microsoft.VisualStudio.Debugger.Script.DkmScriptDocument)
at TypeScriptDebugEngine.SymbolProvider.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmSymbolQuery.GetSourcePosition(Microsoft.VisualStudio.Debugger.Symbols.DkmInstructionSymbol, Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionSession, Boolean ByRef)
at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmSymbolQuery_GetSourcePosition(IntPtr, IntPtr, Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, IntPtr, Byte ByRef, IntPtr ByRef)
at Microsoft.VisualStudio.Debugger.Symbols.NativeDkmInstructionSymbol.Proc74625D16DFFBC0BBB0B76F58AC775415(IntPtr, Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, IntPtr, Byte ByRef, IntPtr ByRef)
at Microsoft.VisualStudio.Debugger.Symbols.DkmInstructionSymbol.GetSourcePosition(Microsoft.VisualStudio.Debugger.Symbols.DkmSourcePositionFlags, Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionSession, Boolean ByRef)
at TypeScriptDebugEngine.SymbolProvider.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmLanguageFrameDecoder.GetFrameName(Microsoft.VisualStudio.Debugger.Evaluation.DkmInspectionContext, Microsoft.VisualStudio.Debugger.DkmWorkList, Microsoft.VisualStudio.Debugger.CallStack.DkmStackWalkFrame, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags, Microsoft.VisualStudio.Debugger.DkmCompletionRoutine`1<Microsoft.VisualStudio.Debugger.Evaluation.DkmGetFrameNameAsyncResult>)
at Microsoft.VisualStudio.Debugger.EntryPoint.IDkmLanguageFrameDecoder_GetFrameName(IntPtr, IntPtr, IntPtr, IntPtr, Microsoft.VisualStudio.Debugger.Evaluation.DkmVariableInfoFlags, IntPtr)