473,385 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

stack corrupt around object or variable at close of Prog.

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
3 6224

"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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Andrew | last post by:
Last night I was reading about implementing my own stack. The example given pushes items on and off the stack at the start and end of each procedure (ie. in a std module). What's not so clear is...
4
by: Hal Vaughan | last post by:
I am writing out archive files using ZipOutputStream with the following code: aEntry is a global Array of ZipEntries llData is a LinkedList of the data corresponding to the the ZipEntry of the...
2
by: news.tkdsoftware.com | last post by:
Aside from comp.compilers, is there any other forum, newsgroup or medium where I can post questions concerning the development of a byte code compiler & virtual stack machine? --
13
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does...
20
by: Sushil | last post by:
Hi gurus I was reading FAQ "alloca cannot be written portably, and is difficult to implement on machines without a conventional stack." I understand that the standard does not mandate...
13
by: gmccallum | last post by:
General Info: A struct is stored on the stack and a class on the heap. A struct is a value type while a class is a reference type. Question: What if a struct contains a string...
16
by: sarathy | last post by:
Hi all, I need a few clarifications regarding memory allocaion in C++. I apologize for the lengthy explanation. 1. In C++, Objects are allocated in heap. What does heap refer to? Is it an area...
6
by: student1976 | last post by:
All Beginner/Intermediate level question. I understand that returning ptr to local stack vars is bad. Is returning foo_p_B from fnB() reliable all the time, so that using foo_p_A does not...
0
by: PavanGupta | last post by:
hi, i m using VC++8.0 MFC. i m facing the problem atack corrupt around the variable stCmosPortInput. i am reading some information from ini file.information is as following format. //Setting_1 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.