RE: Win32 DLL project randomly crashes after moving to VS2005



Hi Jon,

Have you found something when your program crashed with stack overflow
under the debugger?

Since your DLL project just upgraded to VS2005, is it possible that the new
VC2005 CRT libraries are incompatible with your graphic library?


Has anything changed in the way VS2005 deals with the stack?

VC2005 adds some news stuffs into the stack layout , it uses the /GS switch
(Buffer Security Check) provides a "speed bump," or cookie, between the
buffer and the return address. If an overflow writes over the return
address, it will have to overwrite the cookie put in between it and the
buffer, resulting in a new stack layout:

Function parameters
Function return address
Frame pointer
Cookie
Exception Handler frame
Locally declared variables and buffers
Callee save registers

This option is enabled by default in VC2005 project, you can try to shut
that option for a test (Project Properties | Code Generation | Buffer
Security Check --> No).


Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Reading local files in Netscape 6 and Mozilla (GM#001-NS)
    ... > The exception unknown software exception ... Exception xfd is a stack overflow, not a buffer ... Again, a stack overflow, not a buffer overflow. ...
    (NT-Bugtraq)
  • Re: Public disclosure of discovered vulnerabilities
    ... in a buffer stored on the stack. ... That's a stack overflow, because bufis a stack-allocated buffer. ... *I* didn't introduce that distinction. ... publicly known methods of exploiting stack overflows -- whereas there ...
    (sci.crypt)
  • Re: Setting Cookie
    ... When I renamed the cookie name/value for the second domain, ... Thanks again Hub and everyone for your help! ... > data has been sent to the buffer. ... > the script, ...
    (alt.php)
  • Re: C++ to read cookies created by local HTML file
    ... BOOL bReturn; ... // Create a persistent cookie. ... // buffer size needed to download the cookie data. ... I tried to retrieve the cookies which are created ...
    (microsoft.public.vc.mfc)
  • Re: C++ to read cookies created by local HTML file
    ... BOOL bReturn; ... // Create a persistent cookie. ... // buffer size needed to download the cookie data. ... I tried to retrieve the cookies which are created ...
    (microsoft.public.vc.mfc)