diagnose a page fault/access violation 
Author Message
 diagnose a page fault/access violation

Here's the deal.

I have a Visual Basic 5.0 application. It runs without complaint in the
VB IDE. However, when I run the executable outside of the IDE, or when I
install in on another system and run it, I get a page fault in
KERNEL32.DLL. Windows gives me its cryptic info,

AUTOLAS-PROD caused an invalid page fault in
module KERNEL32.DLL at 0177:bff7a115.

Registers:
EAX=007c132c CS=0177 EIP=bff7a115 EFLGS=00010202
EBX=00f7f9f4 SS=017f ESP=009cec98 EBP=009cecd8
ECX=00100000 DS=017f ESI=007c132c FS=3907
EDX=007be748 ES=017f EDI=007be6c8 GS=0000

After some experimentation with the de{*filter*} in Visual C++ 5.0 it looks
like I'm getting an "Access Violation Exception", again in KERNEL32.DLL.
It looks like in both VB and VC++ the IDE itself is handling the access
violation, but when it occurs in the "real world" there is nobody to
take care of it.

My initial thought was that I need to see the call stack to determine
where in my code things are going wrong. This, however, eluded me. I can
set breakpoints in VC++ at the last statement of my code and not get the
exception. It looks like the exception occurs in the "clean-up" that a
VB application goes through when exiting. Therefore I have given up a
bit on the utility of a call stack.

My understanding of an "Access Violation" is that it indicates that some
piece of memory is being free'd twice, or that some pice of memory is
being access after being free'd. My next thought is that perhaps I can
determine which memory location is causing the upset and then trace it
back to some variable/object in my VB application. Does this seem like a
reasonable path?

I have tried using windbg and doing a normal debug session. However I
have not had much luck. Windbg does not seem to notice that an access
violation is occurring, though I have set the access violation in
the "Exceptions" property page to both "Notify" and "Enabled".
Furterhmore, I have been unble to track down the debug info for
KERNEL32.DLL. Lastly, windbg claims that the checksums bewtween the VB
runtime environment (MSVBVM50.DLL) and the the debug symbols
(MSVBVM50.DBG), though they are both from VB 5.0 Service Pack 3.

What should I be doing?

At the moment, I'm thinking that I'm going to have to use windbg and run
a kernel debugging session. Does this seem like the right approach? I
still have no idea where I can get my hands on the debug info for
KERNEL32.DLL.

The documentation for windbg indicates that both the host and target
machines need to have the same versions of the system DLL's. Getting 2
Win9x systems with the exact same versions of system DLL's seems like a
difficult thing, short of reinstalling Windows entirely on both system.
Thoughts?

regards,

miguel



Fri, 26 Oct 2001 03:00:00 GMT  
 diagnose a page fault/access violation
I also saw such a situation.

The exception was throw when I started the program with ctrl-f5 (just run
the program).
The exception didn't occur when I started the program with f5 (start to
debug).

In my case the fault was that I wrote behind allocated memory.

Miguel De Avila heeft geschreven in bericht ...

Quote:
>Here's the deal.

>I have a Visual Basic 5.0 application. It runs without complaint in the
>VB IDE. However, when I run the executable outside of the IDE, or when I
>install in on another system and run it, I get a page fault in
>KERNEL32.DLL. Windows gives me its cryptic info,

>AUTOLAS-PROD caused an invalid page fault in
>module KERNEL32.DLL at 0177:bff7a115.

>Registers:
>EAX=007c132c CS=0177 EIP=bff7a115 EFLGS=00010202
>EBX=00f7f9f4 SS=017f ESP=009cec98 EBP=009cecd8
>ECX=00100000 DS=017f ESI=007c132c FS=3907
>EDX=007be748 ES=017f EDI=007be6c8 GS=0000

>After some experimentation with the de{*filter*} in Visual C++ 5.0 it looks
>like I'm getting an "Access Violation Exception", again in KERNEL32.DLL.
>It looks like in both VB and VC++ the IDE itself is handling the access
>violation, but when it occurs in the "real world" there is nobody to
>take care of it.

>My initial thought was that I need to see the call stack to determine
>where in my code things are going wrong. This, however, eluded me. I can
>set breakpoints in VC++ at the last statement of my code and not get the
>exception. It looks like the exception occurs in the "clean-up" that a
>VB application goes through when exiting. Therefore I have given up a
>bit on the utility of a call stack.

>My understanding of an "Access Violation" is that it indicates that some
>piece of memory is being free'd twice, or that some pice of memory is
>being access after being free'd. My next thought is that perhaps I can
>determine which memory location is causing the upset and then trace it
>back to some variable/object in my VB application. Does this seem like a
>reasonable path?

>I have tried using windbg and doing a normal debug session. However I
>have not had much luck. Windbg does not seem to notice that an access
>violation is occurring, though I have set the access violation in
>the "Exceptions" property page to both "Notify" and "Enabled".
>Furterhmore, I have been unble to track down the debug info for
>KERNEL32.DLL. Lastly, windbg claims that the checksums bewtween the VB
>runtime environment (MSVBVM50.DLL) and the the debug symbols
>(MSVBVM50.DBG), though they are both from VB 5.0 Service Pack 3.

>What should I be doing?

>At the moment, I'm thinking that I'm going to have to use windbg and run
>a kernel debugging session. Does this seem like the right approach? I
>still have no idea where I can get my hands on the debug info for
>KERNEL32.DLL.

>The documentation for windbg indicates that both the host and target
>machines need to have the same versions of the system DLL's. Getting 2
>Win9x systems with the exact same versions of system DLL's seems like a
>difficult thing, short of reinstalling Windows entirely on both system.
>Thoughts?

>regards,

>miguel



Sat, 27 Oct 2001 03:00:00 GMT  
 diagnose a page fault/access violation
I was going to try to give you a nice long helpful answer.  Then I saw
how many news groups this was posted to.
--
Dan Evens
(Standard disclaimers etc. No spam please.)



Sun, 28 Oct 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Invalid page faults when accessing large arrays

2. Access passwords through MFC Application and page faults

3. "Access violation" accessing a DLL

4. URGENT: Access Violation when accessing the POOM IAppointment

5. Invalid page fault in Windows98

6. Q: How do I count page faults when running a programme

7. Invalid Page Fault?

8. PAGE FAULT

9. inline-virtual memory-page fault

10. Page Fault (Borland C++ 4.52)

11. caused an invalid page fault in module ...

12. Page faults and interrupt handlers

 

 
Powered by phpBB® Forum Software