By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,963 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,963 IT Pros & Developers. It's quick & easy.

stack corrupt around object or variable at close of Prog.

P: n/a
Hi,
I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
Compliance is tighter. I get the
error message before the program finished that

stack corrupt around "obj". - this being an object from
a statement like obj[i] = new Class;

Does anyone have a clue?

Regards,
Jeffrey Baker
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Jeffrey Baker" <tb******@earthlink.net> wrote in message
news:52******************@newsread3.news.atl.earth link.net...
Hi,
I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
Compliance is tighter. I get the
error message before the program finished that

stack corrupt around "obj". - this being an object from
a statement like obj[i] = new Class;

Does anyone have a clue?


You'd need to ask on a microsoft newsgroup or check their documentation if
you want to know what their error message means precisely.

But it sounds like you've trashed memory somewhere. One line of code isn't
likely to help us determine where that might have occurred, however. Have
you tried debugging the program and watching how your arrays and pointers
are used? Some likely culprits for memory corruption are using an
uninitialized or deleted pointer, or writing beyond the bounds of an array.

-Howard
Jul 23 '05 #2

P: n/a

"Howard" <al*****@hotmail.com> wrote in message
news:tf**********************@bgtnsc05-news.ops.worldnet.att.net...

"Jeffrey Baker" <tb******@earthlink.net> wrote in message
news:52******************@newsread3.news.atl.earth link.net...
Hi,
I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
Compliance is tighter. I get the
error message before the program finished that

stack corrupt around "obj". - this being an object from
a statement like obj[i] = new Class;

Does anyone have a clue?

You'd need to ask on a microsoft newsgroup or check their documentation if
you want to know what their error message means precisely.

But it sounds like you've trashed memory somewhere. One line of code
isn't likely to help us determine where that might have occurred, however.
Have you tried debugging the program and watching how your arrays and
pointers are used?

I did try a debug and found a argument to come up with the answer. Looks
like this:
an =obj[i]->get( y,in[j], start[j]);

Message is : Run-Time Check Failure #2 - Stack around the variable 'start'
was corrupted.

Jeff
Some likely culprits for memory corruption are using an uninitialized or deleted pointer, or writing beyond the bounds of an
array.

-Howard

Jul 23 '05 #3

P: n/a
Hello,

I found my io file had to many items. Ran ok with a smaller file. It went
over the compilers default limits to start.

Regards,
Jeff

"Howard" <al*****@hotmail.com> wrote in message
news:tf**********************@bgtnsc05-news.ops.worldnet.att.net...

"Jeffrey Baker" <tb******@earthlink.net> wrote in message
news:52******************@newsread3.news.atl.earth link.net...
Hi,
I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
Compliance is tighter. I get the
error message before the program finished that

stack corrupt around "obj". - this being an object from
a statement like obj[i] = new Class;

Does anyone have a clue?


You'd need to ask on a microsoft newsgroup or check their documentation if
you want to know what their error message means precisely.

But it sounds like you've trashed memory somewhere. One line of code
isn't likely to help us determine where that might have occurred, however.
Have you tried debugging the program and watching how your arrays and
pointers are used? Some likely culprits for memory corruption are using
an uninitialized or deleted pointer, or writing beyond the bounds of an
array.

-Howard

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.