application:
0xC0000005: Access violation reading location 0x73bc0000
This error didn't occur until I added a TabControl to my form and placed a
CheckedListBox on the second page. This error only occurs when the
application is terminating and only if the second page of the tab control is
visible and the CheckedListBox contains at least one item. The access
violation occurs whether there is only one item in the CheckedListBox or
several. The access violation appears 26 consecutive times in the debugger's
Output window. (I have Unmanaged Debugging enabled since this C# .NET
application utilizes an unmanaged DLL.)
The unmanaged DLL does not appear to be causing the access violation. All
threads spun by it are terminated before the application shuts down and all
API's exposed by it are very simple and handle based (no pointers except for
Unicode string marshalling.)
When the error occurs there's only one thread still running in the
application. This is a snapshot of the Threads window from the debugger:
1804 Win32 Thread _IsBadReadPtr@8 Normal 0
Here is a snapshot of the call stack for the thread from the Call Stack
window of the debugger:
kernel32.dll!_IsBadReadPtr@8() + 0x39
wblind.dll!6604fefc()
kernel32.dll!_BasepGetModuleHandleExW@16() + 0x172
ntdll.dll!_RtlFreeHeapSlowly@12() + 0x23d19
This is a snippet of the disassembly where the access violation occurred.
(The instruction pointer is signified by "->" in the left margin.)
...
7C809EB3 6A 10 push 10h
7C809EB5 68 18 9F 80 7C push 7C809F18h
7C809EBA E8 0C 86 FF FF call __SEH_prolog (7C8024CBh)
7C809EBF A1 3C 30 88 7C mov eax,dword ptr
[_BaseStaticServerData (7C88303Ch)]
7C809EC4 8B B0 2C 01 00 00 mov esi,dword ptr [eax+12Ch]
7C809ECA 8B 45 0C mov eax,dword ptr [ebp+0Ch]
7C809ECD 85 C0 test eax,eax
7C809ECF 74 3A je _IsBadReadPtr@8+55h (7C809F0Bh)
7C809ED1 8B 55 08 mov edx,dword ptr [ebp+8]
7C809ED4 85 D2 test edx,edx
7C809ED6 0F 84 7C 29 00 00 je _IsBadReadPtr@8+6Ah (7C80C858h)
7C809EDC 8D 7C 02 FF lea edi,[edx+eax-1]
7C809EE0 3B FA cmp edi,edx
7C809EE2 0F 82 70 29 00 00 jb _IsBadReadPtr@8+6Ah (7C80C858h)
7C809EE8 83 65 FC 00 and dword ptr [ebp-4],0
-> 7C809EEC 8A 02 mov al,byte ptr [edx]
7C809EEE 8D 46 FF lea eax,[esi-1]
7C809EF1 F7 D0 not eax
7C809EF3 8B C8 mov ecx,eax
7C809EF5 23 CA and ecx,edx
7C809EF7 89 4D E4 mov dword ptr [ebp-1Ch],ecx
7C809EFA 23 C7 and eax,edi
7C809EFC 89 45 E0 mov dword ptr [ebp-20h],eax
7C809EFF 3B C8 cmp ecx,eax
7C809F01 0F 85 45 29 00 00 jne _IsBadReadPtr@8+48h (7C80C84Ch)
7C809F07 83 4D FC FF or dword ptr [ebp-4],0FFFFFFFFh
7C809F0B 33 C0 xor eax,eax
7C809F0D E8 F9 85 FF FF call __SEH_epilog (7C80250Bh)
7C809F12 C2 08 00 ret 8
7C809F15 90 nop
7C809F16 90 nop
...
I would greatly appreciate help of any kind. I'm fairly new to .NET and C#
and I'm not sure where I should investigate.
Thanks!