invalid page fault 
Author Message
 invalid page fault

Hi Newsgroup,
 When execute my program I get an "invalid page fault
error".  i.e:  MyProgram caused an invalid page fault
error in MFC42D.dll.  I'm a newbie, and don't understand
exactly what causes this.  When I choose to debug, the
error in the debug window points to a stringName in a file
(that I didn't create myself, the program did) that when I
hold the cursor over this variable name, it shows the
address to my company.  The address to my company is in
one of my .cpp files.  However, I don't see anything
wrong, as It worked fine before I added new code to
something that doesn't even pertain to the address.
If anyone could guide me in the right direction, I would
appreciate it. Thank You much.
Angel


Wed, 26 May 2004 01:16:07 GMT  
 invalid page fault


Fri, 19 Jun 1992 00:00:00 GMT  
 invalid page fault
I'm using VC60,  windows '98 second edition.  

//////// this is what comes up when I click the Retry
Button on the error //////
DISCFLO5 caused an invalid page fault in
module MFC42D.DLL at 017f:5f42b55f.
Registers:
EAX=fffffff5 CS=017f EIP=5f42b55f EFLGS=00010297
EBX=00640000 SS=0187 ESP=0074fb7c EBP=0074fb8c
ECX=00000000 DS=0187 ESI=81774068 FS=69b7
EDX=004e7714 ES=0187 EDI=00000000 GS=0000
Bytes at CS:EIP:
83 38 00 7d 10 8b 4d fc e8 fd ba 04 00 3b 05 04
Stack dump:
00000000 81774068 00640000 004e7714 0074fc48 0044ff60
0074fc2c 00000000 81774068 00640000 ffff7a64 8bb46c47
16b71247 6c47ffff 3da68be6 004cb2d0
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////

//////// this is the popup that comes up when I
choose "debug" ///////////////

Unhandled exception in Discfl5.exe (MFC42D.DLL):  
0xC0000005:Access Violation.

///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////

///////  arrow points to this in the call stack
window:  ////////
   CString::operator=(const CString & {"1817 John
Towers"}) line 325 + 8 bytes

///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////

/////////  arrow to this in the code:  
(Strcore.cpp)  .cpp file that I didn't create
myselft  //////////

      const CString& CString::operator=(const CString&
stringSrc)
{
 if (m_pchData != stringSrc.m_pchData)
 {
  if ((GetData()->nRefs < 0 && GetData() != _afxDataNil) ||
   stringSrc.GetData()->nRefs < 0)   //////// arrow points
to this.  when mouse is over 'stringSrc' it shows it
as 'stringScr = "1817 John Towers"'  /////////
  {
   // actual copy necessary since one of the strings is
locked
   AssignCopy(stringSrc.GetData()->nDataLength,
stringSrc.m_pchData);
  }
  else
  {
   // can just copy references around
   Release();
   ASSERT(stringSrc.GetData() != _afxDataNil);
   m_pchData = stringSrc.m_pchData;
   InterlockedIncrement(&GetData()->nRefs);
  }
 }
 return *this;

Quote:
}

///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////

////////  In the locals tab:  //////////

- this 0x004e7714 {""}
- m_pchData 0x00000001 ""
  CXX0030: Error: expression cannot be evaluated
- stringSrc {"1817 John Towers"}
- m_pchData 0x00d82c2c "1817 John Towers"
  49 '1'
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////

//////// my actual code  (chrtinfo.cpp)  //////////

if(pDC->IsPrinting())
 {

  pDC->SelectObject(&m_CurveLabelPageFont);
  sizeText = pDC->GetTextExtent("0", 1);

  // Address lines  
  s = "1817 John Towers Ave.";
  y = y2 + sizeText.cy * 2;
  pDC->TextOut(x2,y,s);
  s = "El Cajon, California 92020";
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////

Quote:
>-----Original Message-----
>Hi Newsgroup,
> When execute my program I get an "invalid page fault
>error".  i.e:  MyProgram caused an invalid page fault
>error in MFC42D.dll.  I'm a newbie, and don't understand
>exactly what causes this.  When I choose to debug, the
>error in the debug window points to a stringName in a
file
>(that I didn't create myself, the program did) that when
I
>hold the cursor over this variable name, it shows the
>address to my company.  The address to my company is in
>one of my .cpp files.  However, I don't see anything
>wrong, as It worked fine before I added new code to
>something that doesn't even pertain to the address.
>If anyone could guide me in the right direction, I would
>appreciate it. Thank You much.
>Angel
>.



Wed, 26 May 2004 02:12:52 GMT  
 invalid page fault
Learning C++ means learning a *lot* about the inner workings
of memory management and debugging crashes. You'll see a lot
more of these before you're done.

I'll give you a few pointers:

- this 0x004e7714 {""}
- m_pchData 0x00000001 ""
  CXX0030: Error: expression cannot be evaluated
- stringSrc {"1817 John Towers"}
- m_pchData 0x00d82c2c "1817 John Towers"
  49 '1'

The information above, from the locals window, is probably the crucial
clue. It looks like the stringSrc variable is fine and valid, but
the 'this' (i.e.; the object whose member function is being assigned to)

is garbage. The message saying that m_pchData has a value of 1 (that's
bad for a pointer) and saying "CXX0030: Error: expression cannot be
evaluated" is the clue.

From your code it looks like it is the variable 's', from this line of
code:

  // Address lines
  s = "1817 John Towers Ave.";

but there isn't enough code to figure out why 's' would be invalid.

Purify, BoundsChecker and other commercial products devoted to
finding bugs like this (and much worse) exist because these bugs are a
huge problem with C++. You'll have to learn how to track these bugs down

and use these tools.

For a start, download and learn to use pageheap, and learn how to
diagnose
these crashes.

Quote:

> I'm using VC60,  windows '98 second edition.

> //////// this is what comes up when I click the Retry
> Button on the error //////
> DISCFLO5 caused an invalid page fault in
> module MFC42D.DLL at 017f:5f42b55f.
> Registers:
> EAX=fffffff5 CS=017f EIP=5f42b55f EFLGS=00010297
> EBX=00640000 SS=0187 ESP=0074fb7c EBP=0074fb8c
> ECX=00000000 DS=0187 ESI=81774068 FS=69b7
> EDX=004e7714 ES=0187 EDI=00000000 GS=0000
> Bytes at CS:EIP:
> 83 38 00 7d 10 8b 4d fc e8 fd ba 04 00 3b 05 04
> Stack dump:
> 00000000 81774068 00640000 004e7714 0074fc48 0044ff60
> 0074fc2c 00000000 81774068 00640000 ffff7a64 8bb46c47
> 16b71247 6c47ffff 3da68be6 004cb2d0
> ///////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////

> //////// this is the popup that comes up when I
> choose "debug" ///////////////

> Unhandled exception in Discfl5.exe (MFC42D.DLL):
> 0xC0000005:Access Violation.

> ///////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////

> ///////  arrow points to this in the call stack
> window:  ////////
>    CString::operator=(const CString & {"1817 John
> Towers"}) line 325 + 8 bytes

> ///////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////

> /////////  arrow to this in the code:
> (Strcore.cpp)  .cpp file that I didn't create
> myselft  //////////

>       const CString& CString::operator=(const CString&
> stringSrc)
> {
>  if (m_pchData != stringSrc.m_pchData)
>  {
>   if ((GetData()->nRefs < 0 && GetData() != _afxDataNil) ||
>    stringSrc.GetData()->nRefs < 0)   //////// arrow points
> to this.  when mouse is over 'stringSrc' it shows it
> as 'stringScr = "1817 John Towers"'  /////////
>   {
>    // actual copy necessary since one of the strings is
> locked
>    AssignCopy(stringSrc.GetData()->nDataLength,
> stringSrc.m_pchData);
>   }
>   else
>   {
>    // can just copy references around
>    Release();
>    ASSERT(stringSrc.GetData() != _afxDataNil);
>    m_pchData = stringSrc.m_pchData;
>    InterlockedIncrement(&GetData()->nRefs);
>   }
>  }
>  return *this;
> }

> ///////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////

> ////////  In the locals tab:  //////////

> - this 0x004e7714 {""}
> - m_pchData 0x00000001 ""
>   CXX0030: Error: expression cannot be evaluated
> - stringSrc {"1817 John Towers"}
> - m_pchData 0x00d82c2c "1817 John Towers"
>   49 '1'
> ///////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////

> //////// my actual code  (chrtinfo.cpp)  //////////

> if(pDC->IsPrinting())
>  {

>   pDC->SelectObject(&m_CurveLabelPageFont);
>   sizeText = pDC->GetTextExtent("0", 1);

>   // Address lines
>   s = "1817 John Towers Ave.";
>   y = y2 + sizeText.cy * 2;
>   pDC->TextOut(x2,y,s);
>   s = "El Cajon, California 92020";
> ///////////////////////////////////////////////////////////
> ///////////////////////////////////////////////////////////
> /////////////////////////////////////////////////////

> >-----Original Message-----
> >Hi Newsgroup,
> > When execute my program I get an "invalid page fault
> >error".  i.e:  MyProgram caused an invalid page fault
> >error in MFC42D.dll.  I'm a newbie, and don't understand
> >exactly what causes this.  When I choose to debug, the
> >error in the debug window points to a stringName in a
> file
> >(that I didn't create myself, the program did) that when
> I
> >hold the cursor over this variable name, it shows the
> >address to my company.  The address to my company is in
> >one of my .cpp files.  However, I don't see anything
> >wrong, as It worked fine before I added new code to
> >something that doesn't even pertain to the address.
> >If anyone could guide me in the right direction, I would
> >appreciate it. Thank You much.
> >Angel
> >.



Wed, 26 May 2004 15:06:45 GMT  
 invalid page fault


Fri, 19 Jun 1992 00:00:00 GMT  
 invalid page fault
Hello,

This error message can occur by various causes. I suggest while you are
debugging the code, press Alt+7 to open call stack. In call stack, you can
find what code of yours causes the error.

Hope this helps.

Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:
>>Content-Class: urn:content-classes:message

>>X-Tomcat-NG: microsoft.public.vc.de{*filter*}

>>Hi Newsgroup,
>> When execute my program I get an "invalid page fault
>>error".  i.e:  MyProgram caused an invalid page fault
>>error in MFC42D.dll.  I'm a newbie, and don't understand
>>exactly what causes this.  When I choose to debug, the
>>error in the debug window points to a stringName in a file
>>(that I didn't create myself, the program did) that when I
>>hold the cursor over this variable name, it shows the
>>address to my company.  The address to my company is in
>>one of my .cpp files.  However, I don't see anything
>>wrong, as It worked fine before I added new code to
>>something that doesn't even pertain to the address.
>>If anyone could guide me in the right direction, I would
>>appreciate it. Thank You much.
>>Angel



Sat, 29 May 2004 18:01:53 GMT  
 invalid page fault
Thanks to both Max and Bruce for the reply.  I couldn't
seem to find an error in my code so I went to the updates
page on the microsoft home page and found out that there
is a patch to Visual Studio 6.0, so I decided to cross my
fingers and after the 3 hours of downloading and
installing, I ran my program once again and WahLa!!! It
works!!! Yeah!!!
Quote:
>-----Original Message-----
>Hello,

>This error message can occur by various causes. I suggest
while you are
>debugging the code, press Alt+7 to open call stack. In

call stack, you can
Quote:
>find what code of yours causes the error.

>Hope this helps.

>Regards,
>Max
>==========================
>This posting is provided "AS IS" with no warranties, and
confers no rights.

>--------------------
>>>Content-Class: urn:content-classes:message

>>>X-Tomcat-NG: microsoft.public.vc.de{*filter*}

>>>Hi Newsgroup,
>>> When execute my program I get an "invalid page fault
>>>error".  i.e:  MyProgram caused an invalid page fault
>>>error in MFC42D.dll.  I'm a newbie, and don't
understand
>>>exactly what causes this.  When I choose to debug, the
>>>error in the debug window points to a stringName in a
file
>>>(that I didn't create myself, the program did) that
when I
>>>hold the cursor over this variable name, it shows the
>>>address to my company.  The address to my company is in
>>>one of my .cpp files.  However, I don't see anything
>>>wrong, as It worked fine before I added new code to
>>>something that doesn't even pertain to the address.
>>>If anyone could guide me in the right direction, I
would
>>>appreciate it. Thank You much.
>>>Angel

>.



Tue, 01 Jun 2004 02:16:45 GMT  
 invalid page fault
Hhmmm.

The good news is, your problem went away.

The bad news is, you don't know whether it is fixed or just hidden.
Different versions of compilers generate different object code for
the same source, and this can change the behavior if you have a
bug in your code (undefined behavior can change rather easily).

Then again, proving that a particular problem is a compiler problem,
rather than a bug in your code, *is* a tricky thing.

I hope it was fixed, but now you'll never know for sure.

Quote:

> Thanks to both Max and Bruce for the reply.  I couldn't
> seem to find an error in my code so I went to the updates
> page on the microsoft home page and found out that there
> is a patch to Visual Studio 6.0, so I decided to cross my
> fingers and after the 3 hours of downloading and
> installing, I ran my program once again and WahLa!!! It
> works!!! Yeah!!!
> >-----Original Message-----
> >Hello,

> >This error message can occur by various causes. I suggest
> while you are
> >debugging the code, press Alt+7 to open call stack. In
> call stack, you can
> >find what code of yours causes the error.

> >Hope this helps.

> >Regards,
> >Max
> >==========================
> >This posting is provided "AS IS" with no warranties, and
> confers no rights.

> >--------------------
> >>>Content-Class: urn:content-classes:message

> >>>X-Tomcat-NG: microsoft.public.vc.de{*filter*}

> >>>Hi Newsgroup,
> >>> When execute my program I get an "invalid page fault
> >>>error".  i.e:  MyProgram caused an invalid page fault
> >>>error in MFC42D.dll.  I'm a newbie, and don't
> understand
> >>>exactly what causes this.  When I choose to debug, the
> >>>error in the debug window points to a stringName in a
> file
> >>>(that I didn't create myself, the program did) that
> when I
> >>>hold the cursor over this variable name, it shows the
> >>>address to my company.  The address to my company is in
> >>>one of my .cpp files.  However, I don't see anything
> >>>wrong, as It worked fine before I added new code to
> >>>something that doesn't even pertain to the address.
> >>>If anyone could guide me in the right direction, I
> would
> >>>appreciate it. Thank You much.
> >>>Angel

> >.



Tue, 01 Jun 2004 11:02:54 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Invalid page fault in Windows98

2. Invalid Page Fault?

3. Invalid page faults when accessing large arrays

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

5. Invalid Page fault in module MSJT3032.DLL

6. Invalid page fault

7. Invalid page fault

8. Invalid Page Fault in Release mode with ML compiler option

9. invalid page fault ...

10. MSDEV caused an invalid page fault in Module SSSCC.DLL After Install SP2

11. invalid page fault when I exit my program

12. Help - receiving invalid page fault in kernel32.dll

 

 
Powered by phpBB® Forum Software