🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.memory
Article #8

Re: What *is* a General Protection Fault

#8
From: Eric Kenslow
Date: Tue, 26 Sep 1995 10:49
37 lines
2072 bytes
stidev@news.gate.net (Solution Technology) wrote:

>David Preece (dmpreece@tcp.co.uk) wrote:
>: ..I was always under the impression that a GPF was Windoze's way
>: of stopping one application from writing over anothers' memory.
>: Am I right?

>: And if so, why is this happening:
>:   
>:   I am allocating a very complex dialog box on the heap. When compiled
>:   with Visual C++ in debug mode, it executes fine. When compiled in 
>:   release mode (with the compiler and linker options otherwise identical)
>:   this dialog box GPF's.

>That usually indicates uninitialized pointers or data.
>The debugger frequently supplies a zero initial value while
>non-debug running uses the previous contents of memory.

Actually, this is not the case.  The debugger uses 0xC0 (or somesuch),
while the debug and non-debug, while not in the debugger, does no
initialization.

GPFs have many causes, not all fatal.  A thorough discussion would be
far beyond the scope of this group (and my hardware knowledge :]), but
one cause I can think of for the original poster's problem is simply
an optimization bug in the compiler.  Try doing a retail build with no
optimizations.  If that works, keep adding optimizations one at a time
and doing full builds until the problem comes back.  Then avoid that
optimization in the future.  That's the best I can do without sample
code.

>Ken Walter


/* Eric Kenslow - kenslowe@sparky.oit.osshe.edu
 * Oregon Institute of Technology, Klamath Falls, OR
 */
Technical Details
Message-ID: <448lo4$r7d@osshe.edu>
Path: arc1-ca.pugleaf.net!osshe.edu!news
References: <446uh6$ieu@zeus.tcp.co.uk> <4470k6$147l@navajo.gate.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!osshe.edu!news
From: kenslowe@sparky.oit.osshe.edu (Eric Kenslow)
Newsgroups: comp.os.ms-windows.programmer.memory,comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++
Subject: Re: What *is* a General Protection Fault
Date: Tue, 26 Sep 1995 10:49:13 GMT
Organization: Oregon State System of Higher Education
Message-ID: <448lo4$r7d@osshe.edu>
References: <446uh6$ieu@zeus.tcp.co.uk> <4470k6$147l@navajo.gate.net>
Reply-To: kenslowe@sparky.oit.osshe.edu
NNTP-Posting-Host: ppp-06.oit.osshe.edu
X-Newsreader: Forte Free Agent 1.0.82