Hi,
I ran into a problem that I never had before. I invoked a routine in my
program where it said "Stack around the variable "a" was corrupted"
Since I never had this before, don't know how to solve this error!!!
Is it a bug for .NET 2002? did not seem to go away with .NET 2003... What
happened?
Thanks
Jack

Re: stack around the variable corrupted by Tom

Tom
Sun May 08 15:26:32 CDT 2005

Check the MSDN documentation for the term "Buffer Overrun".

"Jacky Luk" <jl@knight.com> wrote in message news:OU5$el8UFHA.544@TK2MSFTNGP15.phx.gbl...
> Hi,
> I ran into a problem that I never had before. I invoked a routine in my
> program where it said "Stack around the variable "a" was corrupted"
> Since I never had this before, don't know how to solve this error!!!
> Is it a bug for .NET 2002? did not seem to go away with .NET 2003... What
> happened?
> Thanks
> Jack
>
>



Re: stack around the variable corrupted by Guido

Guido
Sun May 08 19:01:49 CDT 2005

> I ran into a problem that I never had before. I invoked a routine in my
> program where it said "Stack around the variable "a" was corrupted"
> Since I never had this before, don't know how to solve this error!!!
> Is it a bug for .NET 2002? did not seem to go away with .NET 2003... What
> happened?

Rather than a bug in .net 2002 / 2003, it's the opposite: A bug in your
code, which has escaped undetected before, but is now detected by the CLR.
Can you post the code of the offending function?

--
Guido Stercken-Sorrenti
MVP - Visual Developer / Visual C++



Re: stack around the variable corrupted by Stoyan

Stoyan
Mon May 09 03:20:22 CDT 2005

If by CLR you mean the CompiLeR then you're, of course, right :)

Cheers,
Stoyan

"Guido Stercken-Sorrenti [MVP VC++]" <mspbn@stercken-sorrenti.com> wrote in
message news:OrjnEpCVFHA.3636@TK2MSFTNGP14.phx.gbl...
>> I ran into a problem that I never had before. I invoked a routine in my
>> program where it said "Stack around the variable "a" was corrupted"
>> Since I never had this before, don't know how to solve this error!!!
>> Is it a bug for .NET 2002? did not seem to go away with .NET 2003... What
>> happened?
>
> Rather than a bug in .net 2002 / 2003, it's the opposite: A bug in your
> code, which has escaped undetected before, but is now detected by the CLR.
> Can you post the code of the offending function?
>
> --
> Guido Stercken-Sorrenti
> MVP - Visual Developer / Visual C++
>



Re: stack around the variable corrupted by Severian

Severian
Mon May 09 14:37:00 CDT 2005

On Mon, 9 May 2005 02:01:49 +0200, "Guido Stercken-Sorrenti [MVP
VC++]" <mspbn@stercken-sorrenti.com> wrote:

>> I ran into a problem that I never had before. I invoked a routine in my
>> program where it said "Stack around the variable "a" was corrupted"
>> Since I never had this before, don't know how to solve this error!!!
>> Is it a bug for .NET 2002? did not seem to go away with .NET 2003... What
>> happened?
>
>Rather than a bug in .net 2002 / 2003, it's the opposite: A bug in your
>code, which has escaped undetected before, but is now detected by the CLR.
>Can you post the code of the offending function?

Changing default packing can cause some Windows APIs to generate this
error as well. (GetTextMetricsW will write past the end of the
TEXTMETRICSW structure with some value(s) of /ZpN).

--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real, but please post replies on the newsgroup.

Re: stack around the variable corrupted by Tim

Tim
Tue May 10 01:42:51 CDT 2005

"Stoyan Damov" <stoyan.maps.damov@gmail.com> wrote:
>
>If by CLR you mean the CompiLeR then you're, of course, right :)

No. CLR means "Common Language Runtime". It's the runtime part of .NET .
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: stack around the variable corrupted by Stoyan

Stoyan
Tue May 10 01:49:03 CDT 2005

Heh :)

I know what CLR means, but here's what Guido said earlier:

"...Rather than a bug in .net 2002 / 2003, it's the opposite: A bug in your
code, which has escaped undetected before, but is now detected by the
CLR..."

I know that the CLR doesn't put security cookies in the code, it is the
compiler (given the appropriate switches) which puts them.
So again, if by the CLR Guido meant the CompiLeR he was right, if he refered
to the Common Language Runtime, he was wrong.

Cheers,
Stoyan

"Tim Roberts" <timr@probo.com> wrote in message
news:0ul081t7pi5pj2p7gr81qgftomp7uhj7rs@4ax.com...
> "Stoyan Damov" <stoyan.maps.damov@gmail.com> wrote:
>>
>>If by CLR you mean the CompiLeR then you're, of course, right :)
>
> No. CLR means "Common Language Runtime". It's the runtime part of .NET .
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc



Re: stack around the variable corrupted by Tim

Tim
Wed May 11 22:13:09 CDT 2005

"Stoyan Damov" <stoyan.maps.damov@gmail.com> wrote:
>
>I know what CLR means, but here's what Guido said earlier:
>
>"...Rather than a bug in .net 2002 / 2003, it's the opposite: A bug in your
>code, which has escaped undetected before, but is now detected by the
>CLR..."
>
>I know that the CLR doesn't put security cookies in the code, it is the
>compiler (given the appropriate switches) which puts them.

Maybe. With .NET, the distinction is not so obvious. It is not
necessarily trivial to determine which IL instructions convert to x86
instructions, and which ones end up in the CLR.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc