This project is read-only.
1
Vote

The IDE crashes when I copy/paste some code in a header file (v1.8)

description

doesn't happen all the time, but for this specific file, it always happens. it all starts with the following AV:

(1ef0.1fc4): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=230b02b8 ecx=0028e2c8 edx=00000010 esi=0028e2c4 edi=00000000
eip=3ec6288d esp=0028e27c ebp=0028e280 iopl=0 nv up ei pl nz na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206
vcpkg!ATL::CComPtr<IDispatch>::GetIDOfName+0xa:
3ec6288d 8b08 mov ecx,dword ptr [eax] ds:002b:00000000=????????
0:000> k
ChildEBP RetAddr
0028e280 3ec628bd vcpkg!ATL::CComPtr<IDispatch>::GetIDOfName+0xa
0028e2a0 3ec915b7 vcpkg!ATL::CComPtr<IDispatch>::GetPropertyByName+0x16
0028e2dc 1c045eeb vcpkg!CVCCodeAttribute::get_Collection+0x96
0028e358 1c045c5b DomainBoundILStubClass.IL_STUB_CLRtoCOM()+0x9b
0028e370 1c045b84 Highlighterr!Highlighterr.Intellisenser.GetIntellisenserTypeFromElement(EnvDTE80.CodeElement2)+0x8b
0028e384 5ac721db Highlighterr!Highlighterr.Intellisenser.CodeModelEvents_ElementAdded(EnvDTE.CodeElement)+0x24
0028e394 5ac94a2a clr!CallDescrWorker+0x33
0028e410 5ac94bcc clr!CallDescrWorkerWithHandler+0x8e
0028e550 5ac94c01 clr!MethodDesc::CallDescr+0x194
0028e56c 5ac94c21 clr!MethodDesc::CallTargetWorker+0x21
0028e584 5ad07856 clr!MethodDescCallSite::CallWithValueTypes+0x1c
0028e748 5ad07ba3 clr!CallWithValueTypes_RetArgSlotWrapper+0x5c
0028ea20 5ad07d65 clr!InvokeImpl+0x621
*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\246f1a5abb686b9dcdf22d3505b08cea\mscorlib.ni.dll
0028eaec 584ed689 clr!RuntimeMethodHandle::InvokeMethodFast+0x180
0028eb40 584ed37c mscorlib_ni!System.RuntimeMethodHandle.InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.Signature, System.Reflection.MethodAttributes, System.RuntimeType)+0x49
0028eb78 584ebcdb mscorlib_ni!System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)+0xfc
0028eba4 58b5dde1 mscorlib_ni!System.Delegate.DynamicInvokeImpl(System.Object[])+0x77
0028ebb8 58b5caba mscorlib_ni!System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper.Invoke(System.Object[])+0x91
0028ebcc 58b5c883 mscorlib_ni!System.Runtime.InteropServices.ComEventsMethod.Invoke(System.Object[])+0x2a
0028ebf8 58b5e642 mscorlib_ni!System.Runtime.InteropServices.ComEventsSink.System.Runtime.InteropServices.NativeMethods.IDispatch.Invoke(Int32, System.Guid ByRef, Int32, System.Runtime.InteropServices.ComTypes.INVOKEKIND, System.Runtime.InteropServices.ComTypes.DISPPARAMS ByRef, IntPtr, IntPtr, IntP
tr)+0x183
0028ec24 5ac725c1 mscorlib_ni!DomainNeutralILStubClass.IL_STUB_COMtoCLR(Int32, IntPtr, Int32, Int32, IntPtr, Int32, Int32, Int32)+0x22
0028ec4c 5adf729b clr!COMToCLRDispatchHelper+0x28
0028ece0 5adf7374 clr!InvokeStub+0xca
0028ed04 5adf73da clr!COMToCLRWorkerBody+0xb4
0028ed5c 5adf753f clr!COMToCLRWorkerDebuggerWrapper+0x34
0028ef6c 0036a1e2 clr!COMToCLRWorker+0x1b7
0028ef80 593ab189 CLRStub[StubLinkStub]@25d2d00036a1e2
0028f010 593aaf2e msenv!CProxy_dispCodeModelEvents<CCodeModelEventsContainer>::Fire_CodeElementAdded+0xd6
0028f048 59411bdb msenv!CCodeElementEvents::FireCodeElementEvent+0x39
0028f060 3ec6434b msenv!CExtSer::FireCodeModelEvent+0x1e
0028f09c 3ebe9ba9 vcpkg!CVCCodeModelService::FireAdd+0x9b
0028f1a8 3ebc6111 vcpkg!CHItemMap::FireEvents+0x2eb
0028f1b8 3eb7b81b vcpkg!CVCCodeModelService::FireEvents+0x17
0028f1e4 3eb7b039 vcpkg!CVCCodeModelService::OnIdle+0x5b
0028f220 5914dd22 vcpkg!CVCPackage::FDoIdle+0x8e
0028f254 5914de11 msenv!SCM::FDoIdleLoop+0x10a
0028f280 5914deb6 msenv!SCM::FDoIdle+0x88
0028f28c 5914dbe4 msenv!SCM_MsoStdCompMgr::FDoIdle+0x13
0028f2d0 591530cb msenv!CMsoCMHandler::EnvironmentMsgLoop+0x107
0028f310 59152ffc msenv!CMsoCMHandler::FPushMessageLoop+0x156
0028f334 59152f5d msenv!SCM::FPushMessageLoop+0xab
0028f350 59152f2a msenv!SCM_MsoCompMgr::FPushMessageLoop+0x2a
0028f370 59152e6c msenv!CMsoComponent::PushMsgLoop+0x28
0028f408 5906db92 msenv!VStudioMainLogged+0x553
0028f434 2fa67435 msenv!VStudioMain+0xbc
0028f46c 2fa70445 devenv!util_CallVsMain+0xfd
0028f758 2fa7167c devenv!CDevEnvAppId::Run+0x938
0028f788 2fa716ec devenv!WinMain+0x9c
0028f81c 761e3677 devenv!__tmainCRTStartup+0x150
0028f828 76fe9d42 kernel32!BaseThreadInitThunk+0xe
0028f868 76fe9d15 ntdll!__RtlUserThreadStart+0x70
0028f880 00000000 ntdll!_RtlUserThreadStart+0x1b
0:000> g
(1ef0.1fc4): CLR exception - code e0434352 (first chance)
(1ef0.1fc4): C++ EH exception - code e06d7363 (first chance)
(1ef0.1fc4): CLR exception - code e0434352 (!!! second chance !!!)
eax=0028e690 ebx=00000005 ecx=00000005 edx=00000000 esi=0028e73c edi=00498b00
eip=7618b727 esp=0028e690 ebp=0028e6e0 iopl=0 nv up ei pl nz ac pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000216
KERNELBASE!RaiseException+0x58:
7618b727 c9 leave
0:000>

comments

ranamauro wrote Jan 6, 2011 at 7:48 AM

I've verified that the AV is the root cause of the issue:

0:000> g
(1ed4.13ec): CLR exception - code e0434352 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=0030ea70 ebx=00000005 ecx=00000005 edx=00000000 esi=0030eb1c edi=007d8b00
eip=7618b727 esp=0030ea70 ebp=0030eac0 iopl=0 nv up ei pl nz ac po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000212
KERNELBASE!RaiseException+0x58:
7618b727 c9 leave
0:000> !pe
Exception object: 1befdc4c
Exception type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
InnerException: System.AccessViolationException, Use !PrintException 1bee7bc4 to see more.
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80131604
0:000> !PrintException 1bee7bc4
Exception object: 1bee7bc4
Exception type: System.AccessViolationException
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
InnerException: <none>
StackTrace (generated):
SP       IP       Function
00000000 00000000 Highlighterr_a630000!EnvDTE80.CodeElement2.get_Collection()+0x1
0030E740 07ABE74B Highlighterr_a630000!Highlighterr.Intellisenser.GetIntellisenserTypeFromElement(EnvDTE80.CodeElement2)+0x8b
0030E758 07ABE674 Highlighterr_a630000!Highlighterr.Intellisenser.CodeModelEvents_ElementAdded(EnvDTE.CodeElement)+0x24
StackTraceString: <none>
HResult: 80004003
0:000>

dexy wrote Jan 6, 2011 at 8:20 AM

Thanks for reporting this,
It's interesting that the get_Collection method on the Code Element makes this exception..
Is it possible for you to download the code, and run it in debug mode? If so, you could set a breakpoint on line 324 of Intellisenser.cs, and then report any properties of the CodeElement2 e object. The value of vsCMElement ek would also be helpful to find out a solution to the problem.
Regards,
dexy

ranamauro wrote Jan 9, 2011 at 1:13 AM

didn't get around doing this, but I hit it again in the debugger and here some more spew in case it helps: 0:000> !dso OS Thread Id: 0x5ec (0) ESP/REG Object Name ebx 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E718 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E734 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E738 2d778a24 System.__ComObject 0039E780 2d778a24 System.__ComObject 0039E7AC 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E7B4 23b7d530 System.Runtime.CompilerServices.CallSite`1[[System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]], mscorlib]] 0039E7C0 2d778a24 System.__ComObject 0039E7C8 14ef83c8 Highlighterr.Intellisenser 0039E7D8 2d778a24 System.__ComObject 0039E890 2d778a24 System.__ComObject 0039E894 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039E928 2d778a24 System.__ComObject 0039E958 2d778a24 System.__ComObject 0039EA70 2d778a24 System.__ComObject 0039EAA0 2d778a24 System.__ComObject 0039EB3C 2d778a24 System.__ComObject 0039EB6C 2d778a24 System.__ComObject 0039EC20 2d778a24 System.__ComObject 0039EC50 2d778a24 System.__ComObject 0039EC80 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EC88 2d778a24 System.__ComObject 0039ECB8 2d778a24 System.__ComObject 0039ED84 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039ED88 2d778ac0 System.Object[] (System.Object[]) 0039EE2C 2d778a24 System.__ComObject 0039EE5C 2d778a24 System.__ComObject 0039EE94 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EE98 2d778ac0 System.Object[] (System.Object[]) 0039EEB4 2d7786a0 System.Signature 0039EF1C 2d778a34 System.Collections.Generic.List`1[[System.Reflection.RuntimeMethodInfo, mscorlib]] 0039EF20 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EF24 23c5f0c0 System.RuntimeType 0039EF2C 2d778610 System.Reflection.RuntimeMethodInfo 0039EF38 2d778a24 System.__ComObject 0039EF68 2d778ac0 System.Object[] (System.Object[]) 0039EF6C 2d778610 System.Reflection.RuntimeMethodInfo 0039EF70 2d7786d4 System.Object[] (System.RuntimeType[]) 0039EF74 23c5f0c0 System.RuntimeType 0039EF78 037258b8 System.RuntimeType 0039EF9C 23c5f0c0 System.RuntimeType 0039EFA0 2d778610 System.Reflection.RuntimeMethodInfo 0039EFB0 23c5f0c0 System.RuntimeType 0039EFB8 2d7786a0 System.Signature 0039EFBC 2d778ac0 System.Object[] (System.Object[]) 0039EFC4 2d778ac0 System.Object[] (System.Object[]) 0039EFC8 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EFD4 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EFD8 2d778610 System.Reflection.RuntimeMethodInfo 0039EFF0 2d7789f0 System.Object[] (System.Object[]) 0039EFFC 2d7789f0 System.Object[] (System.Object[]) 0039F000 2d7789f0 System.Object[] (System.Object[]) 0039F008 14f07538 System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper 0039F014 2d7789f0 System.Object[] (System.Object[]) 0039F01C 14f07524 System.Object[] (System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper[]) 0039F03C 2d778a14 System.Boolean[] 0039F040 2d778a04 System.Int32[] 0039F044 2d7789f0 System.Object[] (System.Object[]) 0039F048 14f07510 System.Runtime.InteropServices.ComEventsMethod 0039F0C4 14f074c0 System.Runtime.InteropServices.ComEventsSink 0039F154 14f074c0 System.Runtime.InteropServices.ComEventsSink 0:000> !do 14ef83c8 Name: Highlighterr.Intellisenser MethodTable: 0efa75a4 EEClass: 0d74e5a0 Size: 84(0x54) bytes File: C:\Users\mauroot\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\dexy\Highlighterr\1.8\Highlighterr.dll Fields: MT Field Offset Type VT Attr Value Name 56a4f9ac 400006c c System.String 0 instance 14ef8af4 SolutionName 0efa6fb0 400006d 10 EnvDTE80.DTE2 0 instance 0388cefc Dte2 0efa7334 400006e 14 EnvDTE.Solution 0 instance 14ef8350 SolutionObject 0efa8b58 400006f 18 ...0.CodeModelEvents 0 instance 14f05d44 CodeModelEvents 0efa88a4 4000070 1c ...AddedEventHandler 0 instance 14f07370 CodeModelElementAddedHandler 0efa8964 4000071 20 ...angedEventHandler 0 instance 14f07390 CodeModelElementChangedHandler 0efa8adc 4000072 24 ...letedEventHandler 0 instance 14f073b0 CodeModelElementDeletedHandler 56a4f35c 4000074 28 System.Boolean[] 0 instance 14ef8568 IsIdentifierChar 56a06c28 4000075 2c System.Object[] 0 instance 14ef8674 _Dictionaries 56a4f9ac 4000076 30 System.String 0 instance 14f312a0 SDFFileName 56a4f9ac 4000077 34 System.String 0 instance 14f311e8 SDFConnectionString 56a52978 4000078 44 System.Int32 1 instance 178075 ItemsLoadedFromSDF 56a52978 4000079 48 System.Int32 1 instance 132047 TotalItemsInDictionary 56a4a204 400007a 4 System.Int64 1 instance 523510 LastElementID 56a52978 400007b 4c System.Int32 1 instance 532128 WordsParsed 0efa83c8 400007c 38 ...m, Highlighterr]] 0 instance 14ef8a84 _IDDictionary 56a55534 400007d 3c ...tring, mscorlib]] 0 instance 14ef8adc _ErrorLog 00000000 400007e 40 ...enserLogItemAdded 0 instance 00000000 OnLogItemAdded 56a4f9ac 4000073 8 System.String 0 static 14ef841c IdentifierChars 0:000> !do 14ef83c8 Name: Highlighterr.Intellisenser MethodTable: 0efa75a4 EEClass: 0d74e5a0 Size: 84(0x54) bytes File: C:\Users\mauroot\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\dexy\Highlighterr\1.8\Highlighterr.dll Fields: MT Field Offset Type VT Attr Value Name 56a4f9ac 400006c c System.String 0 instance 14ef8af4 SolutionName 0efa6fb0 400006d 10 EnvDTE80.DTE2 0 instance 0388cefc Dte2 0efa7334 400006e 14 EnvDTE.Solution 0 instance 14ef8350 SolutionObject 0efa8b58 400006f 18 ...0.CodeModelEvents 0 instance 14f05d44 CodeModelEvents 0efa88a4 4000070 1c ...AddedEventHandler 0 instance 14f07370 CodeModelElementAddedHandler 0efa8964 4000071 20 ...angedEventHandler 0 instance 14f07390 CodeModelElementChangedHandler 0efa8adc 4000072 24 ...letedEventHandler 0 instance 14f073b0 CodeModelElementDeletedHandler 56a4f35c 4000074 28 System.Boolean[] 0 instance 14ef8568 IsIdentifierChar 56a06c28 4000075 2c System.Object[] 0 instance 14ef8674 _Dictionaries 56a4f9ac 4000076 30 System.String 0 instance 14f312a0 SDFFileName 56a4f9ac 4000077 34 System.String 0 instance 14f311e8 SDFConnectionString 56a52978 4000078 44 System.Int32 1 instance 178075 ItemsLoadedFromSDF 56a52978 4000079 48 System.Int32 1 instance 132047 TotalItemsInDictionary 56a4a204 400007a 4 System.Int64 1 instance 523510 LastElementID 56a52978 400007b 4c System.Int32 1 instance 532128 WordsParsed 0efa83c8 400007c 38 ...m, Highlighterr]] 0 instance 14ef8a84 _IDDictionary 56a55534 400007d 3c ...tring, mscorlib]] 0 instance 14ef8adc _ErrorLog 00000000 400007e 40 ...enserLogItemAdded 0 instance 00000000 OnLogItemAdded 56a4f9ac 4000073 8 System.String 0 static 14ef841c IdentifierChars 0:000> !dso OS Thread Id: 0x5ec (0) ESP/REG Object Name ebx 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E718 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E734 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E738 2d778a24 System.__ComObject 0039E780 2d778a24 System.__ComObject 0039E7AC 23b7e52c System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]] 0039E7B4 23b7d530 System.Runtime.CompilerServices.CallSite`1[[System.Func`3[[System.Runtime.CompilerServices.CallSite, System.Core],[System.Object, mscorlib],[EnvDTE80.CodeElement2, Highlighterr]], mscorlib]] 0039E7C0 2d778a24 System.__ComObject 0039E7C8 14ef83c8 Highlighterr.Intellisenser 0039E7D8 2d778a24 System.__ComObject 0039E890 2d778a24 System.__ComObject 0039E894 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039E928 2d778a24 System.__ComObject 0039E958 2d778a24 System.__ComObject 0039EA70 2d778a24 System.__ComObject 0039EAA0 2d778a24 System.__ComObject 0039EB3C 2d778a24 System.__ComObject 0039EB6C 2d778a24 System.__ComObject 0039EC20 2d778a24 System.__ComObject 0039EC50 2d778a24 System.__ComObject 0039EC80 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EC88 2d778a24 System.__ComObject 0039ECB8 2d778a24 System.__ComObject 0039ED84 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039ED88 2d778ac0 System.Object[] (System.Object[]) 0039EE2C 2d778a24 System.__ComObject 0039EE5C 2d778a24 System.__ComObject 0039EE94 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EE98 2d778ac0 System.Object[] (System.Object[]) 0039EEB4 2d7786a0 System.Signature 0039EF1C 2d778a34 System.Collections.Generic.List`1[[System.Reflection.RuntimeMethodInfo, mscorlib]] 0039EF20 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EF24 23c5f0c0 System.RuntimeType 0039EF2C 2d778610 System.Reflection.RuntimeMethodInfo 0039EF38 2d778a24 System.__ComObject 0039EF68 2d778ac0 System.Object[] (System.Object[]) 0039EF6C 2d778610 System.Reflection.RuntimeMethodInfo 0039EF70 2d7786d4 System.Object[] (System.RuntimeType[]) 0039EF74 23c5f0c0 System.RuntimeType 0039EF78 037258b8 System.RuntimeType 0039EF9C 23c5f0c0 System.RuntimeType 0039EFA0 2d778610 System.Reflection.RuntimeMethodInfo 0039EFB0 23c5f0c0 System.RuntimeType 0039EFB8 2d7786a0 System.Signature 0039EFBC 2d778ac0 System.Object[] (System.Object[]) 0039EFC4 2d778ac0 System.Object[] (System.Object[]) 0039EFC8 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EFD4 14f07370 EnvDTE80._dispCodeModelEvents_ElementAddedEventHandler 0039EFD8 2d778610 System.Reflection.RuntimeMethodInfo 0039EFF0 2d7789f0 System.Object[] (System.Object[]) 0039EFFC 2d7789f0 System.Object[] (System.Object[]) 0039F000 2d7789f0 System.Object[] (System.Object[]) 0039F008 14f07538 System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper 0039F014 2d7789f0 System.Object[] (System.Object[]) 0039F01C 14f07524 System.Object[] (System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper[]) 0039F03C 2d778a14 System.Boolean[] 0039F040 2d778a04 System.Int32[] 0039F044 2d7789f0 System.Object[] (System.Object[]) 0039F048 14f07510 System.Runtime.InteropServices.ComEventsMethod 0039F0C4 14f074c0 System.Runtime.InteropServices.ComEventsSink 0039F154 14f074c0 System.Runtime.InteropServices.ComEventsSink 0:000> !do 2d778a24 Name: System.__ComObject MethodTable: 56a4b87c EEClass: 56785fdc Size: 16(0x10) bytes File: C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll Fields: MT Field Offset Type VT Attr Value Name 56a4f5e8 40001cf 4 System.Object 0 instance 00000000 __identity 56a5537c 40002cc 8 ...ections.Hashtable 0 instance 00000000 m_ObjectToDataMap 0:000> !da 2d778ac0 Name: System.Object[] MethodTable: 56a06c28 EEClass: 56789698 Size: 20(0x14) bytes Array: Rank 1, Number of elements 1, Type CLASS Element Methodtable: 56a4f5e8 [0] 2d778a24 0:000> !do 2d778a24 Name: System.__ComObject MethodTable: 56a4b87c EEClass: 56785fdc Size: 16(0x10) bytes File: C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll Fields: MT Field Offset Type VT Attr Value Name 56a4f5e8 40001cf 4 System.Object 0 instance 00000000 __identity 56a5537c 40002cc 8 ...ections.Hashtable 0 instance 00000000 m_ObjectToDataMap 0:000> !dumpstack OS Thread Id: 0x5ec (0) Current frame: vcpkg!ATL::CComPtr<IDispatch>::GetIDOfName+0xa ChildEBP RetAddr Caller, Callee 0039e6e0 3e4d28bd vcpkg!ATL::CComPtr<IDispatch>::GetPropertyByName+0x16, calling vcpkg!ATL::CComPtr<IDispatch>::GetIDOfName 0039e700 3e5015b7 vcpkg!CVCCodeAttribute::get_Collection+0x96, calling vcpkg!ATL::CComPtr<IDispatch>::GetPropertyByName 0039e73c 11ca793b (MethodDesc 10f87394 +0x9b DomainBoundILStubClass.IL_STUB_CLRtoCOM()) 0039e75c 11ca793b (MethodDesc 10f87394 +0x9b DomainBoundILStubClass.IL_STUB_CLRtoCOM()) 0039e760 11ca77f1 (MethodDesc 10f87298 +0x91 DomainBoundILStubClass.IL_STUB_CLRtoCOM()) 0039e7b8 11ca76ab (MethodDesc 0efa74f4 +0x8b Highlighterr.Intellisenser.GetIntellisenserTypeFromElement(EnvDTE80.CodeElement2)), calling 020999b6 0039e7d0 11ca98e3 (MethodDesc 0efa7560 +0x23 Highlighterr.Intellisenser.CodeModelEvents_ElementAdded(EnvDTE.CodeElement)), calling (MethodDesc 0efa74f4 +0 Highlighterr.Intellisenser.GetIntellisenserTypeFromElement(EnvDTE80.CodeElement2)) 0039e7e4 5d9021db clr!CallDescrWorker+0x33 0039e7f4 5d924a2a clr!CallDescrWorkerWithHandler+0x8e, calling clr!CallDescrWorker 0039e848 5d91c58d clr!ArgIterator::Init+0x6b, calling clr!MetaSig::HasRetBuffArg 0039e870 5d924bcc clr!MethodDesc::CallDescr+0x194, calling clr!CallDescrWorkerWithHandler 0039e89c 5d9228bb clr!MetaSig::MetaSig+0x3c, calling MSVCR100_CLR0400!memcpy 0039e8ac 5d924b0a clr!MethodDesc::CallDescr+0xa8, calling clr!ClrSafeInt<unsigned int>::addition 0039e8b8 5d924b1a clr!MethodDesc::CallDescr+0xb4, calling clr!_alloca_probe_16 0039e91c 5d986180 clr!ComObject::SupportsInterface+0x405, calling clr!_EH_epilog3_GS 0039e928 5d9cb6a3 clr!CheckSupportsComDispatchInterface+0x5a, calling clr!GCFrame::Pop 0039e950 5d9cb6cb clr!ObjIsInstanceOf+0x8c, calling clr!CheckSupportsComDispatchInterface 0039e958 5d993620 clr!ObjIsInstanceOf+0x110, calling clr!GCFrame::Pop 0039e96c 5d924aa5 clr!MethodDesc::CallDescr+0x21, calling clr!_alloca_probe_16 0039e9b0 5d924c01 clr!MethodDesc::CallTargetWorker+0x21, calling clr!MethodDesc::CallDescr 0039e9cc 5d924c21 clr!MethodDescCallSite::CallWithValueTypes+0x1c, calling clr!MethodDesc::CallTargetWorker 0039e9e4 5d997856 clr!CallWithValueTypes_RetArgSlotWrapper+0x5c, calling clr!MethodDescCallSite::CallWithValueTypes 0039ea64 5d986180 clr!ComObject::SupportsInterface+0x405, calling clr!_EH_epilog3_GS 0039ea70 5d9cb6a3 clr!CheckSupportsComDispatchInterface+0x5a, calling clr!GCFrame::Pop 0039ea98 5d9cb6cb clr!ObjIsInstanceOf+0x8c, calling clr!CheckSupportsComDispatchInterface 0039eaa0 5d993620 clr!ObjIsInstanceOf+0x110, calling clr!GCFrame::Pop 0039eb30 5d986180 clr!ComObject::SupportsInterface+0x405, calling clr!_EH_epilog3_GS 0039eb3c 5d9cb6a3 clr!CheckSupportsComDispatchInterface+0x5a, calling clr!GCFrame::Pop 0039eb64 5d9cb6cb clr!ObjIsInstanceOf+0x8c, calling clr!CheckSupportsComDispatchInterface 0039eb6c 5d993620 clr!ObjIsInstanceOf+0x110, calling clr!GCFrame::Pop 0039eb90 5d997df4 clr!MethodDescCallSite::MethodDescCallSite+0x22, calling clr!MetaSig::MetaSig 0039eba8 5d997ba3 clr!InvokeImpl+0x621, calling clr!CallWithValueTypes_RetArgSlotWrapper 0039ec14 5d986180 clr!ComObject::SupportsInterface+0x405, calling clr!_EH_epilog3_GS 0039ec20 5d9cb6a3 clr!CheckSupportsComDispatchInterface+0x5a, calling clr!GCFrame::Pop 0039ec48 5d9cb6cb clr!ObjIsInstanceOf+0x8c, calling clr!CheckSupportsComDispatchInterface 0039ec50 5d993620 clr!ObjIsInstanceOf+0x110, calling clr!GCFrame::Pop 0039ec78 5d997a91 clr!InvokeImpl+0x369, calling clr!_alloca_probe_16 0039ec94 5d99796c clr!InvokeImpl+0x120, calling clr!_alloca_probe_16 0039ee20 5d986180 clr!ComObject::SupportsInterface+0x405, calling clr!_EH_epilog3_GS 0039ee2c 5d9cb6a3 clr!CheckSupportsComDispatchInterface+0x5a, calling clr!GCFrame::Pop 0039ee54 5d9cb6cb clr!ObjIsInstanceOf+0x8c, calling clr!CheckSupportsComDispatchInterface 0039ee5c 5d993620 clr!ObjIsInstanceOf+0x110, calling clr!GCFrame::Pop 0039ee88 5d997d65 clr!RuntimeMethodHandle::InvokeMethodFast+0x180, calling clr!InvokeImpl 0039eeb4 5d910ad1 clr!MethodTable::IsExternallyVisible+0x2f, calling clr!IsTypeDefExternallyVisible 0039eecc 5d901b19 clr!_EH_epilog3_catch_GS+0xa, calling clr!__security_check_cookie 0039eee4 5d997cc4 clr!RuntimeMethodHandle::InvokeMethodFast+0xb3, calling clr!zzz_AsmCodeRange_Begin 0039ef30 5d95c3ea clr!TypeHandle::IsValueType+0x1c, calling clr!TypeHandle::IsNativeValueType 0039ef54 569ed689 (MethodDesc 567b0330 +0x49 System.RuntimeMethodHandle.InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.Signature, System.Reflection.MethodAttributes, System.RuntimeType)), calling clr!RuntimeMethodHandle::InvokeMethodFast 0039efa8 569ed37c (MethodDesc 567ad054 +0xfc System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)), calling (MethodDesc 567b0330 +0 System.RuntimeMethodHandle.InvokeMethodFast(S ystem.IRuntimeMethodInfo, System.Object, System.Object[], System.Signature, System.Reflection.MethodAttributes, System.RuntimeType)) 0039efe0 569ebcdb (MethodDesc 567ac730 +0x77 System.Delegate.DynamicInvokeImpl(System.Object[])), calling (MethodDesc 567ad054 +0 System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boo lean)) 0039f00c 5705dde1 (MethodDesc 5683bd40 +0x91 System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper.Invoke(System.Object[])) 0039f020 5705caba (MethodDesc 5683c93c +0x2a System.Runtime.InteropServices.ComEventsMethod.Invoke(System.Object[])), calling (MethodDesc 5683bd40 +0 System.Runtime.InteropServices.ComEventsMethod+DelegateWrapper.Invoke(System.Object[])) 0039f034 5705c883 (MethodDesc 5683e90c +0x183 System.Runtime.InteropServices.ComEventsSink.System.Runtime.InteropServices.NativeMethods.IDispatch.Invoke(Int32, System.Guid ByRef, Int32, System.Runtime.InteropServices.ComTypes.INVOKEKIND, System.Runtime.InteropServices.ComTypes.DISPPARAMS ByRef, IntP tr, IntPtr, IntPtr)), calling (MethodDesc 5683c93c +0 System.Runtime.InteropServices.ComEventsMethod.Invoke(System.Object[])) 0039f060 5705e642 (MethodDesc 56832694 +0x22 DomainNeutralILStubClass.IL_STUB_COMtoCLR(Int32, IntPtr, Int32, Int32, IntPtr, Int32, Int32, Int32)) 0039f08c 5d9025c1 clr!COMToCLRDispatchHelper+0x28 0039f0ac 07b6cc58 07b6cc58, calling 0207a19c 0039f0b4 5da8729b clr!InvokeStub+0xca, calling clr!COMToCLRDispatchHelper 0039f0e8 07b6cc58 07b6cc58, calling 0207a19c 0039f148 5da87374 clr!COMToCLRWorkerBody+0xb4, calling clr!InvokeStub 0039f16c 5da873da clr!COMToCLRWorkerDebuggerWrapper+0x34, calling clr!COMToCLRWorkerBody 0039f1c4 5da8753f clr!COMToCLRWorker+0x1b7, calling clr!COMToCLRWorkerDebuggerWrapper 0039f1ec 5d993702 clr!JITutil_IsInstanceOfAny+0x110, calling clr!Frame::Pop 0039f1f0 5d99371a clr!JITutil_IsInstanceOfAny+0x128, calling clr!_EH_epilog3 0039f204 10e1f49d (MethodDesc 18109010 +0x3d Microsoft.VisualStudio.Editor.Implementation.VsCodeWindowAdapter.PreProcessMessage(System.Windows.Forms.Message ByRef)), calling (MethodDesc 18109048 +0 Microsoft.VisualStudio.Editor.Implementation.VsCodeWindowAdapter.IsReadOnlyEdit(System.Windows.Forms.M essage)) 0039f238 5d901d85 clr!UnsafeEETryEnterCriticalSection+0xf, calling ntdll!RtlTryEnterCriticalSection 0039f288 5da380e0 clr!DispatchInfo::InvokeMember+0x62d, calling clr!_EH_epilog3_catch_GS 0039f28c 5da371b9 clr!InternalDispatchImpl_Invoke+0x15f, calling clr!DispatchInfo::InvokeMember 0039f29c 5d901bd0 clr!Thread::EnablePreemptiveGC+0x11, calling clr!Thread::CatchAtSafePoint 0039f2c8 5d901b19 clr!_EH_epilog3_catch_GS+0xa, calling clr!__security_check_cookie 0039f2cc 5d994a52 clr!SetupThreadNoThrow+0x17d, calling clr!_EH_epilog3_catch_GS 0039f2f8 777ce1cc ntdll!RtlpLowFragHeapAllocFromContext+0xaec, calling ntdll!__SEH_epilog4 0039f30c 5d9b48ad clr!CanRunManagedCode+0x52, calling clr!AuxUlibIsDLLSynchronizationHeld 0039f328 5d901bd0 clr!Thread::EnablePreemptiveGC+0x11, calling clr!Thread::CatchAtSafePoint 0039f338 5d901b19 clr!_EH_epilog3_catch_GS+0xa, calling clr!__security_check_cookie 0039f380 777ce1cc ntdll!RtlpLowFragHeapAllocFromContext+0xaec, calling ntdll!__SEH_epilog4 0039f398 07b6cc58 07b6cc58, calling 0207a19c 0039f3d4 0207a1e2 0207a1e2, calling clr!COMToCLRWorker 0039f3e8 5d18b189 msenv!CProxy_dispCodeModelEvents<CCodeModelEventsContainer>::Fire_CodeElementAdded+0xd6 0039f404 07b6cc58 07b6cc58, calling 0207a19c 0039f408 5d18b189 msenv!CProxy_dispCodeModelEvents<CCodeModelEventsContainer>::Fire_CodeElementAdded+0xd6 0039f478 5d18af2e msenv!CCodeElementEvents::FireCodeElementEvent+0x39, calling msenv!CProxy_dispCodeModelEvents<CCodeModelEventsContainer>::Fire_CodeElementAdded 0039f4b0 5d1f1bdb msenv!CExtSer::FireCodeModelEvent+0x1e, calling msenv!CCodeElementEvents::FireCodeElementEvent 0039f4c8 3e4d434b vcpkg!CVCCodeModelService::FireAdd+0x9b 0039f504 3e459ba9 vcpkg!CHItemMap::FireEvents+0x2eb, calling vcpkg!CVCCodeModelService::FireAdd 0039f610 3e436111 vcpkg!CVCCodeModelService::FireEvents+0x17, calling vcpkg!CHItemMap::FireEvents 0039f620 3e3eb81b vcpkg!CVCCodeModelService::OnIdle+0x5b 0039f64c 3e3eb039 vcpkg!CVCPackage::FDoIdle+0x8e 0039f688 5cf2dd22 msenv!SCM::FDoIdleLoop+0x10a 0039f6bc 5cf2de11 msenv!SCM::FDoIdle+0x88, calling msenv!SCM::FDoIdleLoop 0039f6e8 5cf2deb6 msenv!SCM_MsoStdCompMgr::FDoIdle+0x13, calling msenv!SCM::FDoIdle 0039f6f4 5cf2dbe4 msenv!CMsoCMHandler::EnvironmentMsgLoop+0x107 0039f70c 777e1073 ntdll!LdrpUnloadDll+0x43b, calling ntdll!__SEH_epilog4 0039f738 5cf330cb msenv!CMsoCMHandler::FPushMessageLoop+0x156, calling msenv!CMsoCMHandler::EnvironmentMsgLoop 0039f75c 5ce0cca8 msenv!MsoIAppendPx+0x188, calling *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\system32\MSVCR100.dll - MSVCR100!memcpy 0039f778 5cf32ffc msenv!SCM::FPushMessageLoop+0xab 0039f79c 5cf32f5d msenv!SCM_MsoCompMgr::FPushMessageLoop+0x2a, calling msenv!SCM::FPushMessageLoop 0039f7b8 5cf32f2a msenv!CMsoComponent::PushMsgLoop+0x28 0039f7d8 5cf32e6c msenv!VStudioMainLogged+0x553, calling msenv!CMsoComponent::PushMsgLoop 0039f82c 5ce55ac6 msenv!CVsLocalRegistryRoots::Init+0xae, calling msenv!_EH_epilog3 0039f830 5ce55b1d msenv!CVsLocalRegistryRoots::CreateInstance+0x54, calling msenv!CVsLocalRegistryRoots::Init 0039f838 5ce55b3e msenv!CVsLocalRegistryRoots::CreateInstance+0x79, calling msenv!_EH_epilog3 0039f870 5ce4db92 msenv!VStudioMain+0xbc, calling msenv!VStudioMainLogged 0039f89c 2f3f7435 devenv!util_CallVsMain+0xfd 0039f8d4 2f400445 devenv!CDevEnvAppId::Run+0x938, calling devenv!util_CallVsMain 0039f908 2f4095aa devenv!CVsActivityLogSingleton::CVsActivityLogSingleton+0x2d, calling devenv!_EH_epilog3 0039fa50 777ce1cc ntdll!RtlpLowFragHeapAllocFromContext+0xaec, calling ntdll!__SEH_epilog4 0039fad8 777ce1cc ntdll!RtlpLowFragHeapAllocFromContext+0xaec, calling ntdll!__SEH_epilog4 0039fadc 777cdf32 ntdll!RtlAllocateHeap+0x206, calling ntdll!RtlpLowFragHeapAllocFromContext 0039fb28 777e0e92 ntdll!RtlEncodePointer+0x17, calling ntdll!ZwQueryInformationProcess 0039fb50 74460c7c MSVCR100!unlock+0x15, calling ntdll!RtlLeaveCriticalSection 0039fb5c 74462263 MSVCR100!msize+0x32, calling MSVCR100!unlock 0039fb64 7446aa39 MSVCR100!set_purecall_handler+0x85, calling MSVCR100!msize+0x2b 0039fb68 7446aa6f MSVCR100!onexit+0x35, calling MSVCR100!unlock+0x5e 0039fbb4 2f4088a3 devenv!util_GetUnicodeCommandLine+0x7a, calling devenv!IsWhitespace 0039fbc0 2f40167c devenv!WinMain+0x9c, calling devenv!CDevEnvAppId::Run 0039fbf4 2f4016ec devenv!__tmainCRTStartup+0x150, calling devenv!WinMain 0039fc5c 2f40e873 devenv!__security_init_cookie+0x65, calling kernel32!QueryPerformanceCounterStub 0039fc88 76593677 kernel32!BaseThreadInitThunk+0xe 0039fc94 777d9d42 ntdll!__RtlUserThreadStart+0x70 0039fcc8 0655ff12 (MethodDesc 05e74420 +0x2 System.Collections.Generic.ObjectComparer`1[[System.Windows.Ink.StrokeIntersection, PresentationCore]].Compare(System.Windows.Ink.StrokeIntersection, System.Windows.Ink.StrokeIntersection)) 0039fcd4 777d9d15 ntdll!_RtlUserThreadStart+0x1b, calling ntdll!__RtlUserThreadStart 0:000> dv this = <value unavailable> lpsz = 0x3e473298 "Attributes" pdispid = 0x0039e708 0:000> .frame 1 01 0039e700 3e5015b7 vcpkg!ATL::CComPtr<IDispatch>::GetPropertyByName+0x16 [f:\dd\public\vc\inc\atlmfc\atlcomcli.h @ 412] 0:000> dv this = 0x0039e724 { 00000000 } lpsz = <value unavailable> pVar = 0x0039e728 hr = 0x00000000 dwDispID = 0n1044853400 0:000> !do 0388cefc Name: System.__ComObject MethodTable: 56a4b87c EEClass: 56785fdc Size: 16(0x10) bytes File: C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll Fields: MT Field Offset Type VT Attr Value Name 56a4f5e8 40001cf 4 System.Object 0 instance 00000000 __identity 56a5537c 40002cc 8 ...ections.Hashtable 0 instance 00000000 m_ObjectToDataMap 0:000> dt 0388cefc Symbol not found at address 0388cefc. 0:000> .frame 2 02 0039e73c 11ca793b vcpkg!CVCCodeAttribute::get_Collection+0x96 [f:\dd\vc\designtime\pkg\codemodel\vccodeattribute.cpp @ 818] 0:000> dv this = 0x205664a8 ppCollection = 0x0039e788 hr = <value unavailable> spParent = class ATL::CComPtr<IDispatch> ddParent = class ATL::CComQIPtr<IDispatch,&_GUID_00020400_0000_0000_c000_000000000046> varAttributes = class ATL::CComVariant 0:000> .frame 6 06 0039e7f4 5d924a2a clr!CallDescrWorker+0x33 [f:\dd\ndp\clr\src\vm\i386\asmhelpers.asm @ 878] 0:000> dv pSrcEnd = 0x39e8c0 numStackSlots = 0 pArgumentRegisters = 0x39e890 fpRetSize = 0 pTarget = 0x9a5c208 doubleRet = 0x39e994 0:000>

dexy wrote Jan 10, 2011 at 8:14 AM

Whoa! that certainly was an interesting stack trace.. The interesting part is

Current frame: vcpkg!ATL::CComPtr<IDispatch>::GetIDOfName+0xa ChildEBP RetAddr Caller, Callee
0039e6e0 3e4d28bd vcpkg!ATL::CComPtr<IDispatch>::GetPropertyByName+0x16, calling vcpkg!ATL::CComPtr<IDispatch>::GetIDOfName
0039e700 3e5015b7 vcpkg!CVCCodeAttribute::get_Collection+0x96, calling vcpkg!ATL::CComPtr<IDispatch>::GetPropertyByName

My code is essentially calling get_Collection on a CVCCodeAttribute (the CodeElement), which is causing the access violation. As to why, I have no idea.. That method(/property) is not supposed to make an error!
Anyway, I think the only way for me to properly solve this is if I can reproduce the problem - otherwise I'm stabbing in the dark. Do you have a specific solution which causes the problem when pasting, or is there a way I can get it to do it in a 'test' (blank, new) solution (ie by pasting a certain amount/type of text)?
Regards,
-dexy

ranamauro wrote Jan 10, 2011 at 8:01 PM

I was pasting the following code, as an additional parameter to some method:
[in,size_is(cProps)] CEPROPVAL* rgVals

this caused the exception, and the dump of the CodeElement2 object from VS is as follows:
  • Collection '(e).Collection' threw an exception of type 'System.AccessViolationException' EnvDTE.CodeElements {System.AccessViolationException}
    Kind    vsCMElementAttribute    EnvDTE.vsCMElement
    Name    "size_is"   string

dexy wrote Jan 29, 2011 at 3:51 AM

Thanks, sorry for delayed response, haven't had time for Highlighterr lately. I'm still trying to think of a good solution to this problem, hopefully with the code you gave there I can reproduce the error.