Solved

Debugging. Access Violation.

Posted on 1998-08-11
12
502 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 6

Expert Comment

by:snoegler
Comment Utility
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
Comment Utility
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
Comment Utility
This is not directly caused by the first-chance exception. There is a bug in your program.
0
 

Author Comment

by:TylerRick
Comment Utility
OK. I wish I could find and squash that bug.
0
 

Author Comment

by:TylerRick
Comment Utility
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
Comment Utility
Adjusted points to 60
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 60
Unix / Linux grid computing 5 125
deburging in oracle form 12 76
FizzBuzz challenge 9 71
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

11 Experts available now in Live!

Get 1:1 Help Now