k***@gmail.com
2007-04-25 09:51:27 UTC
Hello,
I get the following error when I run a program in debug mode:
Run-Time Check Failure #2 - Stack around the variable 'szRuleLeft' was
corrupted.
The original author of code apparently used VC 6, and I understand
this issue appeared only in later versions, and it's relevant only for
debugging, not release executables. However, the general explanation
in all the threads i found is that the possible cause is a array
getting written over its bounds etc; But i manually verified that this
is not the case, as the length of the string being assigned to the
variable (through strcpy) is always much smaller than the allocated
size of the variable.
I found on one thread (message ID #***@tkmsftngp12) someone
from MS suggesting that one can disable the warning by
#pragma optimize("y", off)
but, as was reported in that very thread, this simply doesn't work.
Could anyone please enlighten me on other possible causes for this
error message, or at least a way to disable it? I would not like to
declare the variable as static (which does fix the issue, but is not
the right thing to do).
Sorry for not providing a minimal code; the function is fairly complex
and minimal versions don't produce the error. But i'm sure the
variable concerned never goes out of bounds.
Cheers,
Upali
I get the following error when I run a program in debug mode:
Run-Time Check Failure #2 - Stack around the variable 'szRuleLeft' was
corrupted.
The original author of code apparently used VC 6, and I understand
this issue appeared only in later versions, and it's relevant only for
debugging, not release executables. However, the general explanation
in all the threads i found is that the possible cause is a array
getting written over its bounds etc; But i manually verified that this
is not the case, as the length of the string being assigned to the
variable (through strcpy) is always much smaller than the allocated
size of the variable.
I found on one thread (message ID #***@tkmsftngp12) someone
from MS suggesting that one can disable the warning by
#pragma optimize("y", off)
but, as was reported in that very thread, this simply doesn't work.
Could anyone please enlighten me on other possible causes for this
error message, or at least a way to disable it? I would not like to
declare the variable as static (which does fix the issue, but is not
the right thing to do).
Sorry for not providing a minimal code; the function is fairly complex
and minimal versions don't produce the error. But i'm sure the
variable concerned never goes out of bounds.
Cheers,
Upali