I'm developing on C++, using visual studio 6.0 with service pack 5.
I have a memory corruption while debugging. Some of the variables I'm
using are suddenly set to zero while progressing along the code.
The specific location of the memory corruption depends on the names I
give my local variables, on putting some of the codes in curly
brackets - {}, and on having the watch window open.
I already cleaned and re-built my project.
Can anyone help??
thanks
Noa Garnett 5 3653
> I'm developing on C++, using visual studio 6.0 with service pack 5. I have a memory corruption while debugging. Some of the variables I'm using are suddenly set to zero while progressing along the code. The specific location of the memory corruption depends on the names I give my local variables, on putting some of the codes in curly brackets - {}, and on having the watch window open. I already cleaned and re-built my project. Can anyone help??
Two suggestions:
1. Single step through your application
2. Use something like boundschecker
Niels Dybdahl
"Niels Dybdahl" <nd*@fjern.detteesko-graphics.com> skrev i en meddelelse
news:41*********************@dtext02.news.tele.dk. .. I'm developing on C++, using visual studio 6.0 with service pack 5. I have a memory corruption while debugging. Some of the variables I'm using are suddenly set to zero while progressing along the code. The specific location of the memory corruption depends on the names I give my local variables, on putting some of the codes in curly brackets - {}, and on having the watch window open. I already cleaned and re-built my project. Can anyone help??
Two suggestions: 1. Single step through your application 2. Use something like boundschecker
Niels Dybdahl
3. Ask in a Microsoft newsgroup
4. Set a data breakpoint on the variable
/Peter
"Noa Garnett" <no********@hotmail.com> wrote in message
news:7e**************************@posting.google.c om... I'm developing on C++, using visual studio 6.0 with service pack 5. I have a memory corruption while debugging. Some of the variables I'm using are suddenly set to zero while progressing along the code. The specific location of the memory corruption depends on the names I give my local variables, on putting some of the codes in curly brackets - {}, and on having the watch window open. I already cleaned and re-built my project. Can anyone help??
thanks Noa Garnett
It may not actually be memory corruption (although, not seeing the code, it
certainly *could* be). It may be that your debugger is simply confused.
In VC++6, I've seen the debugger get confused as to which variable it's
actually looking at when there are multiple variables with the same name.
But, I've also had actual behavior problems (not just debugger issues) when
using VC++6 and having multiple instaces of variables with the same name.
Check for any local variables that are declared twice, or that have the same
name as a member (or global) variable. If you're using the same named
variable twice, try declaring it just once at the top of the function, or
else renaming each instance (such as i1, i2, and i3 instead of just i for
them all). This includes loop variables! If you've got a local variable
named the same as a class member or global, try renaming it to something
else.
-Howard
"Noa Garnett" <no********@hotmail.com> wrote in message
news:7e**************************@posting.google.c om... "Howard" <al*****@hotmail.com> wrote in message
news:<Sm*********************@bgtnsc05-news.ops.worldnet.att.net>... "Noa Garnett" <no********@hotmail.com> wrote in message news:7e**************************@posting.google.c om... I'm developing on C++, using visual studio 6.0 with service pack 5. I have a memory corruption while debugging. Some of the variables I'm using are suddenly set to zero while progressing along the code. The specific location of the memory corruption depends on the names I give my local variables, on putting some of the codes in curly brackets - {}, and on having the watch window open. I already cleaned and re-built my project. Can anyone help??
thanks Noa Garnett
It may not actually be memory corruption (although, not seeing the code,
it certainly *could* be). It may be that your debugger is simply confused.
In VC++6, I've seen the debugger get confused as to which variable it's actually looking at when there are multiple variables with the same
name. But, I've also had actual behavior problems (not just debugger issues)
when using VC++6 and having multiple instaces of variables with the same
name. Check for any local variables that are declared twice, or that have the
same name as a member (or global) variable. If you're using the same named variable twice, try declaring it just once at the top of the function,
or else renaming each instance (such as i1, i2, and i3 instead of just i
for them all). This includes loop variables! If you've got a local
variable named the same as a class member or global, try renaming it to something else.
-Howard
1. thanks. 2. but the application indeed crashes later, in a way consistent with the memory corruption I see in the debug watch. 3. I have many multiple variables with the same name. Does the phenomenon you describe occur only while watching variables on debugger, or can it cause problems while working on release mode, too?
It happens in my release builds, too, (but only with my apps built with
VC++, as far as I can tell). When I changed my local variables' names to be
unique (with respect to each other, and to global variables, and to member
variables), the problems went away. (It's fine to have local variables in
one function the same as local variables in another function, though, since
they're in different scopes.)
-Howard
"Noa Garnett" <no********@hotmail.com> wrote in message
news:7e**************************@posting.google.c om... "Howard" <al*****@hotmail.com> wrote in message
news:<Sm*********************@bgtnsc05-news.ops.worldnet.att.net>... "Noa Garnett" <no********@hotmail.com> wrote in message news:7e**************************@posting.google.c om... I'm developing on C++, using visual studio 6.0 with service pack 5. I have a memory corruption while debugging. Some of the variables I'm using are suddenly set to zero while progressing along the code. The specific location of the memory corruption depends on the names I give my local variables, on putting some of the codes in curly brackets - {}, and on having the watch window open. I already cleaned and re-built my project. Can anyone help??
thanks Noa Garnett
It may not actually be memory corruption (although, not seeing the code,
it certainly *could* be). It may be that your debugger is simply confused.
In VC++6, I've seen the debugger get confused as to which variable it's actually looking at when there are multiple variables with the same
name. But, I've also had actual behavior problems (not just debugger issues)
when using VC++6 and having multiple instaces of variables with the same
name. Check for any local variables that are declared twice, or that have the
same name as a member (or global) variable. If you're using the same named variable twice, try declaring it just once at the top of the function,
or else renaming each instance (such as i1, i2, and i3 instead of just i
for them all). This includes loop variables! If you've got a local
variable named the same as a class member or global, try renaming it to something else.
-Howard
1. thanks. 2. but the application indeed crashes later, in a way consistent with the memory corruption I see in the debug watch. 3. I have many multiple variables with the same name. Does the phenomenon you describe occur only while watching variables on debugger, or can it cause problems while working on release mode, too?
Other thoughts: if your'e seeing memory corruption, look especially for
code that writes beyond the end of an array, or use of pointers that have
not been properly initialized before their first use, or where the objects
they point to have been deleted. Such errors can cause problems in
completely separate parts of your code, and are most often the culprits for
*strange* behavior.
-Howard This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Pete |
last post by:
I've run into an interesting memory problem. I think I'm running out of
heap space, but I'm not sure....
I'm creating two new arrays like such....
pImage = new UBYTE ;
pImageTemp = new...
|
by: Gavin Kreuiter |
last post by:
I am looking for some advice on how to debug a program when the
debugger "print" command actually clears the corruption. This is not
the usual non-initialised memory problem, because the program...
|
by: eyh5 |
last post by:
Hi,
My C code (running on Soalris Unix) has some "segmentation fault"
that I wish to use purify to do it. I poked around the web, and found
some information about adding some lines in a Makefile...
|
by: ranjeet.gupta |
last post by:
Dear All
Is the Root Cause of the Memory corruption is the Memory leak, ??
suppose If in the code there is Memory leak, Do this may lead to the
Memory Corruption while executing the program ?
...
|
by: Peter Schmitz |
last post by:
Hi,
I'm currently developing an application that includes an implementation of
the well-known Boyer- Moore algorithm. For this, I use the implementation of
Thierry Lecrq from...
|
by: depkefamily |
last post by:
I have a large C++ program using multiple vendors DLLs which is giving
me a major
headache. Under release mode I get exceptions thrown from what looks
like a dereferenced
corrupt pointer. The...
|
by: Harsha |
last post by:
Hi All,
There is some memory corruption in my application.
It is due to the fact that it is multithreaded.
Is this due to some missing mutex locking?
Is there any way to find where it is...
|
by: =?Utf-8?B?UHVjY2E=?= |
last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3
forms. I want allow users to move forward and backward with the forms and
retain the data users have entered. I thought...
|
by: Why Tea |
last post by:
typedef struct some_struct
{
int i;
short k,
int m;
char s;
} some_struct_t;
Assuming 16 bit or 32-bit alignment, can I assume that
s always gets 4 or 8 bytes of allocation due to padding
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |