Re: (MSVCRT.DLL): 0xC0000005: Access Violation

From: Ivan Brugiolo [MSFT] (ivanbrug_at_online.microsoft.com)
Date: 03/24/04


Date: Tue, 23 Mar 2004 17:01:10 -0800

at the debugger prompt ( the `0:000>' thing below) type
in that exact string `~*kb<enter>' (without the open backquote and trailing
quote,
and interpreting <enter> as common sense suggests).
That command will display a little bit more of what is going on.
Debugger commands are very concise, and the seem random strings at first
sight.

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"H" <vth009@yahoo.com.au> wrote in message
news:83a71140.0403231615.5fef2241@posting.google.com...
> Sorry Ivan, i'm not too sure what you mean by "report output of the
> '~*kb' command". Can you please brief me on this a bit?
>
> Thanks,
> H.
> "Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> wrote in message
news:<u5KpkLIEEHA.1600@tk2msftngp13.phx.gbl>...
> > This looks an old-plain access violation on an invalid pointer.
> > If you could report the output of the `~*kb' command
> > at the time of the exception, maybe we could help.
> > From the debug spew below, the problem seems with the parm
> > passed to wcslen more than with the wcslen itself.
> >
> > -- 
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> > Use of any included script samples are subject to the terms specified at
> > http://www.microsoft.com/info/cpyright.htm
> >
> >
> > "H" <vth009@yahoo.com.au> wrote in message
> > news:83a71140.0403221738.3b964e77@posting.google.com...
> > > Hi All,
> > >
> > > Once again, thank you for your responses.
> > >
> > > Ivan, i downloaded the tool and got this list generated by the
> > > debugger below. I've got no idea what it's saying but suspect there
> > > may be something wrong with wcslen() as indicated. Will you be able to
> > > interpret these please? Thanks Ivan.
> > >
> > > Microsoft (R) Windows Debugger  Version 6.3.0011.2
> > > Copyright (c) Microsoft Corporation. All rights reserved.
> > >
> > > CommandLine: c:\documents and
> > > settings\administrator\desktop\adsibasics\debug\test.exe
> > > Symbol search path is: *** Invalid ***
> > >
> >
****************************************************************************
> > > * Symbol loading may be unreliable without a symbol search path.
> > >     *
> > > * Use .symfix to have the debugger choose a symbol path.
> > >     *
> > > * After setting your symbol path, use .reload to refresh symbol
> > > locations. *
> > >
> >
****************************************************************************
> > > Executable search path is:
> > > ModLoad: 00400000 0040e000   test.exe
> > > ModLoad: 77f40000 77ffa000   ntdll.dll
> > > Page heap: pid 0xFD4: page heap enabled with flags 0x2.
> > > ModLoad: 77e40000 77f34000   C:\WINNT\system32\kernel32.dll
> > > ModLoad: 77da0000 77e30000   C:\WINNT\system32\ADVAPI32.dll
> > > ModLoad: 77c50000 77cf4000   C:\WINNT\system32\RPCRT4.dll
> > > ModLoad: 77160000 77284000   C:\WINNT\system32\ole32.dll
> > > ModLoad: 77ba0000 77bf4000   C:\WINNT\system32\msvcrt.dll
> > > ModLoad: 77c00000 77c44000   C:\WINNT\system32\GDI32.dll
> > > ModLoad: 77d00000 77d8f000   C:\WINNT\system32\USER32.dll
> > > ModLoad: 770e0000 7715d000   C:\WINNT\system32\OLEAUT32.dll
> > > ModLoad: 76df0000 76e22000   C:\WINNT\system32\ACTIVEDS.dll
> > > ModLoad: 76dc0000 76de6000   C:\WINNT\system32\adsldpc.dll
> > > ModLoad: 71c40000 71c93000   C:\WINNT\system32\NETAPI32.dll
> > > ModLoad: 76f10000 76f3f000   C:\WINNT\system32\WLDAP32.dll
> > > ModLoad: 76b80000 76bad000   C:\WINNT\system32\credui.dll
> > > ModLoad: 77380000 77b5d000   C:\WINNT\system32\SHELL32.dll
> > > ModLoad: 77290000 772d9000   C:\WINNT\system32\SHLWAPI.dll
> > > ModLoad: 76a80000 76a98000   C:\WINNT\system32\ATL.DLL
> > > ModLoad: 10480000 104fe000   C:\WINNT\system32\MSVCP60D.dll
> > > ModLoad: 10200000 10260000   C:\WINNT\system32\MSVCRTD.dll
> > > ModLoad: 71c20000 71c31000   C:\WINNT\system32\tsappcmp.dll
> > > ModLoad: 70ad0000 70bb6000
> > > C:\WINNT\WinSxS\x86_Microsoft.Windows.Common-Contro
> > > ls_6595b64144ccf1df_6.0.100.0_x-ww_8417450B\comctl32.dll
> > > ModLoad: 76f90000 7700e000   C:\WINNT\system32\CLBCatQ.DLL
> > > ModLoad: 77010000 770d6000   C:\WINNT\system32\COMRes.dll
> > > ModLoad: 77b90000 77b98000   C:\WINNT\system32\VERSION.dll
> > > ModLoad: 712d0000 712fd000   C:\WINNT\system32\adsldp.dll
> > > ModLoad: 75da0000 75e5a000   C:\WINNT\system32\SXS.DLL
> > > ModLoad: 76f50000 76f63000   C:\WINNT\system32\SECUR32.DLL
> > > ModLoad: 71c00000 71c18000   C:\WINNT\system32\WS2_32.DLL
> > > ModLoad: 71bf0000 71bf8000   C:\WINNT\system32\WS2HELP.dll
> > > ModLoad: 71b20000 71b63000   C:\WINNT\system32\mswsock.dll
> > > ModLoad: 71ae0000 71ae8000   C:\WINNT\System32\wshtcpip.dll
> > > ModLoad: 76ed0000 76ef7000   C:\WINNT\system32\DNSAPI.dll
> > > ModLoad: 76f70000 76f77000   C:\WINNT\System32\winrnr.dll
> > > ModLoad: 76f80000 76f85000   C:\WINNT\system32\rasadhlp.dll
> > > ModLoad: 766f0000 76706000   C:\WINNT\system32\NTDSAPI.DLL
> > > ModLoad: 76c90000 76cb4000   C:\WINNT\system32\msv1_0.dll
> > > ModLoad: 71ca0000 71cf6000   C:\WINNT\system32\kerberos.dll
> > > ModLoad: 766e0000 766ec000   C:\WINNT\system32\cryptdll.dll
> > > ModLoad: 76190000 761a2000   C:\WINNT\system32\MSASN1.dll
> > > (fd4.15ac): Access violation - code c0000005 (first chance)
> > > First chance exceptions are reported before any exception handling.
> > > This exception may be expected and handled.
> > > eax=00000040 ebx=00000001 ecx=0012fb9c edx=00000001 esi=00000000
> > > edi=00000040
> > > eip=77bd4e36 esp=0012fa04 ebp=0012fa30 iopl=0         nv up ei pl nz
> > > na pe nc
> > > cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000
> > > efl=00010202
> > > *** ERROR: Symbol file could not be found.  Defaulted to export
> > > symbols for C:\W
> > > INNT\system32\msvcrt.dll -
> > > msvcrt!wcslen+0x4:
> > > 77bd4e36 668b08           mov     cx,[eax]
> > > ds:0023:00000040=????
> > > 0:000>
> > >
> > > ###############
> > >
> > > AK, thanks for going through all that trouble looking at the code. I
> > > will re-examine those issues that you've raised and do a follow up
> > > post after that.
> > >
> > > Thanks,
> > > H.
> > >
> > >
> > >
> > >
> > > "Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> wrote in
message
> >  news:<u3EY$LDEEHA.1604@TK2MSFTNGP11.phx.gbl>...
> > > > cdb.exe is one of the standard debuggers oyu can download from
> > > > http://www.microsoft.com/whdc/ddk/debugging/default.mspx
> > > > Since the package above includes the most recent gflags.exe,
> > > > I had assumed that if you had the first one (gflags.exe)
> > > > you would have had the second (cdb.exe) as well.
> > > > The debugger you will be using does not really matter.
> > > > You can use devenv.exe, if you are comfortable with it.
> > > > But, you have to keep in mind that cdb/ntsd/windbg comes with
> > > > debugger extensions designed to help diagnose
> > > > the Acccess Violation (and other breakpoints)
> > > > enforced and caused by PageHeap.
> > > >
> > > > Running the application under debugger should be
> > > > limited accurrence till the problem is understood and resolved.
> > > > I'm not aware of any software installation that requires
> > > > the applicaiton being debugged all the time.
> > > >
> > > > -- 
> > > > This posting is provided "AS IS" with no warranties, and confers no
> >  rights.
> > > > Use of any included script samples are subject to the terms
specified at
> > > > http://www.microsoft.com/info/cpyright.htm
> > > >
> > > >
> > > > "H" <vth009@yahoo.com.au> wrote in message
> > > > news:83a71140.0403211558.34467ee0@posting.google.com...
> > > > > Hi All,
> > > > >
> > > > > Thank you very much for both of your responses and help.
> > > > >
> > > > > First of all (in order as listed) to David, yes this is the actual
> > > > > problem. The applilcation compiles fine, but when run crashes with
> > > > > that error. Thank you for pointing to the article regarding 1st
and
> > > > > 2nd chance exceptions. It was useful to know.
> > > > >
> > > > > To Ivan: i haven't use C++ extensively so please bare with some of
my
> > > > > trivial questions. I followed your instruction to enable Page
heap.
> > > > > The first line (c:\Program Files\Microsoft Script Debugger>gflags
/p
> > > > > /enable test.exe /fulle) was fine. But the second instruction
> > > > > (c:\Program Files\Microsoft Script Debugger>start cdb -g -G
test.exe)
> > > > > failed with an error saying that Windows cannot find 'cdb'.
> > > > >
> > > > > Ivan, is the debugger i'm using (Program Files\Microsoft Script
> > > > > Debugger) the same as the one you are rerefering to?
> > > > >
> > > > > What does the 2nd instruction "Debugger>start cdb -g -G test.exe"
> > > > > actually do (i assumed starting the app in debugger mode)?
> > > > >
> > > > > If i run my application under the debugger all the time as you
> > > > > suggested, will this cause any problem when i deploy the
application
> > > > > to my client running in the Windows environment?
> > > > >
> > > > > Once again thank you for your help and looking forward for your
next
> > > > > response (can't wait to nail down this frustrating problem!).
> > > > >
> > > > > H.
> > > > >
> > > > >
> > > > >
> > > > > "Ivan Brugiolo [MSFT]" <ivanbrug@online.microsoft.com> wrote in
> >  message
> >  news:<O6Jue#cDEHA.3392@TK2MSFTNGP11.phx.gbl>...
> > > > > > It can be cause by a heap corruption.
> > > > > > Try enabling PageHeap on your executable, and running your
> >  application
> >  under
> > > > > > debugger all the time
> > > > > >
> > > > > > c:\debuggers>gflags /p /enable YourApp.exe /fulle
> > > > > > c:\debugger>start cdb -g -G YourApp.exe
> > > > > >
> > > > > > -- 
> > > > > > This posting is provided "AS IS" with no warranties, and confers
no
> >  rights.
> > > > > > Use of any included script samples are subject to the terms
> >  specified at
> > > > > > http://www.microsoft.com/info/cpyright.htm
> > > > > >
> > > > > >
> > > > > > "H" <vth009@yahoo.com.au> wrote in message
> > > > > > news:83a71140.0403182128.272b8656@posting.google.com...
> > > > > > > Hi All,
> > > > > > >
> > > > > > > I'm using Visual Studio 6 to develop a C/C++ application and
> >  currently
> > > > > > > receiving the following error:
> > > > > > >
> > > > > > > First-chance exception in test.exe (MSVCRT.DLL): 0xC0000005:
> >  Access
> > > > > > > Violation.
> > > > > > >
> > > > > > > I've spent weeks trying to figure out what the real problem
was
> >  but
> > > > > > > still unable to find the cause. Can someone please help me
out.
> >  Why
> > > > > > > this exception, what cause it and how to fix it?
> > > > > > >
> > > > > > > By the way, my program is an example code for extending the
Active
> > > > > > > Directory schema programmatically from msdn =>
> > > > > > >
> > > > > >
> > > >
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ad/ad/example_code_for_extending_the_schema_programmatically.asp
> > > > > > >
> > > > > > > Any help or suggestion is greatly appreciated!
> > > > > > >
> > > > > > > Thanks,
> > > > > > > H.


Relevant Pages

  • Re: (MSVCRT.DLL): 0xC0000005: Access Violation
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... > Microsoft Windows Debugger Version 6.3.0011.2 ... > * Symbol loading may be unreliable without a symbol search path. ... > First chance exceptions are reported before any exception handling. ...
    (microsoft.public.vc.language)
  • Re: WebBrowser control in Visual Studio addin
    ... exception is thrown -> Break into the debugger", ... Since these exception are not critical ones and they could be overcome, ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.vsnet.general)
  • Re: You wanted defensive writing...
    ... Couldn't you have set the debugger to break on all exceptions? ... > I've created an application that loads Caudill's TreeListView as its ... > I commented the line that called the insertion on start-up, ... > The exception caught me unaware, ...
    (microsoft.public.dotnet.csharp.general)
  • Re: You wanted defensive writing...
    ... Couldn't you have set the debugger to break on all exceptions? ... > I've created an application that loads Caudill's TreeListView as its ... > I commented the line that called the insertion on start-up, ... > The exception caught me unaware, ...
    (microsoft.public.dotnet.general)
  • Re: Problem with KITL?
    ... > Enable kernel debugger ... This OK if KdStub stumbling on its own BP. ... Exception in debugger, Addr=0x801AB864 - attempting to recover ...
    (microsoft.public.windowsce.platbuilder)