Solved

Debugging. Access Violation.

Posted on 1998-08-11
12
504 Views
Last Modified: 2013-11-20
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
Comment
Question by:TylerRick
  • 6
  • 2
  • 2
  • +1
12 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1320605
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
 

Author Comment

by:TylerRick
ID: 1320606
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
 
LVL 9

Accepted Solution

by:
Priyesh earned 60 total points
ID: 1320607
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
 
LVL 6

Expert Comment

by:snoegler
ID: 1320608
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
 

Author Comment

by:TylerRick
ID: 1320609
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
 

Author Comment

by:TylerRick
ID: 1320610
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

by:snoegler
ID: 1320611
Sorry priyesh i didn't see your answer - i think my browser didn't show up the updated
page :)
0
 
LVL 9

Expert Comment

by:Priyesh
ID: 1320612
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
 
LVL 23

Expert Comment

by:chensu
ID: 1320613
This is not directly caused by the first-chance exception. There is a bug in your program.
0
 

Author Comment

by:TylerRick
ID: 1320614
OK. I wish I could find and squash that bug.
0
 

Author Comment

by:TylerRick
ID: 1320615
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
 

Author Comment

by:TylerRick
ID: 1320616
Adjusted points to 60
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 85
iSeries FTP Exit Program 8 122
sumDigits challenge 9 120
VBA "SendKeys" Syntax for Multiple Keystrokes 7 103
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now