• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 522
  • Last Modified:

Debugging. Access Violation.

I keep getting this error in the Debug window:
   First-chance exception in FileNameCorrector.exe (MFC40D.DLL): 0xC0000005: Access Violation.

Can you give me more information on this? What is the cause of this? How do I track it down and fix it? How do I debug this?

I'd give more details, but I don't know where to start. It doesn't even seem to always happen at the same spot.

When it has the error, it breaks and goes into the debugger mode. But it doesn't stop in any of my functions. It stops in some assembly code which makes no sense to me.

I'm using Visual C++ 4.0.
0
TylerRick
Asked:
TylerRick
  • 6
  • 2
  • 2
  • +1
1 Solution
 
chensuCommented:
You may usually ignore it. See the following KB article.

First and Second Chance Exception Handling
http://support.microsoft.com/support/kb/articles/q105/6/75.asp
0
 
TylerRickAuthor Commented:
I couldn't ignore it. When I try to resume the debugger (With Debug-Go) it simply stops and shows the same message again. I can't get past the point where it stops.

What's worse, when I execute it without the debugger, it will crash at the same spot, giving this dialog box message:
 This program has performed an illegal operation and will be shut down.
0
 
PriyeshCommented:
Friend,
        I don't know what it will be like in VC 4.0 i am using VC5.0.. Please see if u can use "call stack " or view the stack in any debug options.. see near watch etc..  when u'r program breaks and enters debug mode.. Call stack traces down the path through which u came to the particular access violation point..  and in VC 5, when u double click on  a particular function shown in call stack window, it goes to the source file.. I love debugging.. and if u are so desperate that u can't find it out, please mail me the source and description abt the problem.. we  shall give it a try..
        Regards..
     
     
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
snoeglerCommented:
After the exception, you can view the 'call stack' (which is located in the 'View' menu),
it should show you the order of function calls leading to the exception. Usually it looks
a bit like this:

CMS951Dlg::OnSetCursor(CWnd * 0x0072f8a0 {CMS951Dlg hWnd=0x0000024c}, unsigned int 0x00000001, unsigned int 0x00000200) line 590
CWnd::OnWndMsg(unsigned int 0x00000020, unsigned int 0x0000024c, long 0x02000001, long * 0x0072f51c) line 1754 + 39 bytes
CWnd::WindowProc(unsigned int 0x00000020, unsigned int 0x0000024c, long 0x02000001) line 1617 + 30 bytes
AfxCallWndProc(CWnd * 0x0072f8a0 {CMS951Dlg hWnd=0x0000024c}, HWND__ * 0x0000024c, unsigned int 0x00000020, unsigned int 0x0000024c, long 0x02000001) line 209 + 26 bytes
AfxWndProc(HWND__ * 0x0000024c, unsigned int 0x00000020, unsigned int 0x0000024c, long 0x02000001) line 362 + 25 bytes
KERNEL32! bff73663()
KERNEL32! bff92894()
00008632()
058f64c9()

Search from the topmost line to the bottom of the stack until you find a function with
a readable name - like 'CWnd::OnSetCursor' or something like that. That should give
you a good hint what happened.
0
 
TylerRickAuthor Commented:
Here's my call stack:
00006469()
MFC40D! 5f825bff()
MFC40D! 5f844dae()
MFC40D! 5f8450a9()
CFileNameCorrectorDoc::AssertValid() line 73
MFC40D! 5f825d9c()
MFC40D! 5f8461e2()
MFC40D! 5f8469ae()
MFC40D! 5f825d9c()
MFC40D! 5f85bece()
MFC40D! 5f825d9c()
MFC40D! 5f83ac55()
MFC40D! 5f825d9c()
MFC40D! 5f83a3df()
MFC40D! 5f8399f4()
MFC40D! 5f83a792()
MFC40D! 5f833a9f()
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x8158fc7e, int 1) line 33 + 21 bytes
WinMainCRTStartup() line 330 + 57 bytes
KERNEL32! bff88f75()
KERNEL32! bff88e23()
KERNEL32! bff8783f()
00000004()

As you can see, most of it is MFC code. The 1st readable function is CFileNameCorrectorDoc::AssertValid(), and it doesn't tell me any thing useful.

0
 
TylerRickAuthor Commented:
Priyesh,

You love debugging? That's cool. I find it really annoying, mainly because I never know how to solve it. Actually, I enjoy stepping through my code, but when it's some thing vage like this, where I can't even see any code, it bugs me.

>if u are so desperate that u can't find it out, please mail me
>the source and description abt the problem.. we  shall give it >a try..
That sounds like a good idea. Let's try it. What's your e-mail address?
0
 
snoeglerCommented:
Sorry priyesh i didn't see your answer - i think my browser didn't show up the updated
page :)
0
 
PriyeshCommented:
TylerRick,
          CFileNameCorrectorDoc is u'r class..U have put the AssertValid()... please see around that..As u point out.. i too expected to see some meaningful funcion names,,, but disappointed.. it's ok.. Please mail me if u can with the source..
         my mail id is.. priyesh@mindless.com.

Snoegler.. It's ok.. seems we both were giving the answer simultaneously... :)))
           
0
 
chensuCommented:
This is not directly caused by the first-chance exception. There is a bug in your program.
0
 
TylerRickAuthor Commented:
OK. I wish I could find and squash that bug.
0
 
TylerRickAuthor Commented:
Priyesh,

I got your e-mails and responded to them, but I don't think they got to you. I got messages like this:

The original message was received at Thu, 13 Aug 1998 13:19:52 -0400 (EDT)
from lmtp03.globecomm.net [206.253.129.139]

**
This is an automatic message to inform you that your email was not
forwarded through iName's server.

The iName email address that you tried to send mail to may not be active.
Reasons for the failed delivery attempt could include:

1. The iName customer has selected a new personalized iName email address
   rendering their old iName email address inactive.

2. The iName customer may have signed up for one of iName's free offers
   and then not validated their forwarding address.

3  The address may simply be typed incorrectly.  Please check that you
   typed the email address correctly.

0
 
TylerRickAuthor Commented:
Adjusted points to 60
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now