473,408 Members | 1,976 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,408 software developers and data experts.

c++ debugging

bob
hi,

I have a question I should know the answer to.

I've delivered a working set of c++ libraries/dlls that have been
fully tested and validated. Now my problem is that somebody else has
been furiously fixing memory leaks and what not in another DLL that is
used by my own. I suddenly find myself in the situation where MY dll's
are now crashing out and I'm fairly sure, that the fixes in the other
DLL have hosed my stuff. I'm thinking its trampling on memory or
corrupting the heap.

I would like to determine if this is the case. Though I'm not sure how
to go about it. All of a sudden, all my pointers are pointing to
invalid data/memory and I'm getting crashest with even the SIMPLEST of
tests.

Can anybody tell me whats the best way to go about determining if
memory is been corrupted. I feel bad asking this as I should really
know the answer! :( Ideally I'd like to know precisely the point in
time that somebody writes to MY memory or corrupts it. I've put
breakpoints in dtors to see if anybody is explitly deleting my objects
but thats come up blank.
I'm working in a MS environment, but thats not realy important here.

thanks again for any input or tips.

G

Oct 5 '07 #1
6 1541
bo*@blah.com wrote:
I have a question I should know the answer to.

I've delivered a working set of c++ libraries/dlls that have been
By the time they are DLLs, most of the traces of their being "C++"
have disappeared, haven't they?
fully tested and validated. Now my problem is that somebody else has
been furiously fixing memory leaks and what not in another DLL that is
used by my own. I suddenly find myself in the situation where MY dll's
are now crashing out and I'm fairly sure, that the fixes in the other
DLL have hosed my stuff. I'm thinking its trampling on memory or
corrupting the heap.
So far no relevance to this newsgroup's main topic...
I would like to determine if this is the case. Though I'm not sure how
to go about it. All of a sudden, all my pointers are pointing to
invalid data/memory and I'm getting crashest with even the SIMPLEST of
tests.
OK, I noticed the word "pointers". Doesn't make it on topic yet...
Can anybody tell me whats the best way to go about determining if
memory is been corrupted.
Some kind of tool should help you. Tools are OS-specific, most often.
You can probably find a good memory manager with some debugging
capabilities, but then the entire application has to use it. Again,
not enough specificity to be posted in comp.lang.c++...
I feel bad asking this as I should really
know the answer! :( Ideally I'd like to know precisely the point in
time that somebody writes to MY memory or corrupts it. I've put
breakpoints in dtors to see if anybody is explitly deleting my objects
but thats come up blank.
<shrug Debugging is not defined in the language...
I'm working in a MS environment, but thats not realy important here.
Yes, it is! You bet your sweet ... it is! Post to the newsgroup
that deals with programming "MS environment" and ask about memory
debugging tools.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 5 '07 #2
On 2007-10-05 04:25:57 -0400, "bo*@blah.com" <Gr**********@gmail.comsaid:
hi,

I have a question I should know the answer to.

I've delivered a working set of c++ libraries/dlls that have been
fully tested and validated. Now my problem is that somebody else has
been furiously fixing memory leaks and what not in another DLL that is
used by my own. I suddenly find myself in the situation where MY dll's
are now crashing out and I'm fairly sure, that the fixes in the other
DLL have hosed my stuff. I'm thinking its trampling on memory or
corrupting the heap.

I would like to determine if this is the case. Though I'm not sure how
to go about it. All of a sudden, all my pointers are pointing to
invalid data/memory and I'm getting crashest with even the SIMPLEST of
tests.

Can anybody tell me whats the best way to go about determining if
memory is been corrupted. I feel bad asking this as I should really
know the answer! :( Ideally I'd like to know precisely the point in
time that somebody writes to MY memory or corrupts it. I've put
breakpoints in dtors to see if anybody is explitly deleting my objects
but thats come up blank.
I'm working in a MS environment, but thats not realy important here.

thanks again for any input or tips.

G
Since you're using MS stuff, my comment below may not be relevant.
However, I'll say it hoping that someone may know its equivalence in
the MS world.

In gdb --- a debugger for C++ that I use on the UNIX platform --- there
is such a thing called a *watchpoint* , where you ask the debugger to
examine the value of some expression at every step of execution and to
break the program whenever this value changes.

So, you can set a watchpoint on one of your data-structure. If
anything changes it, the program will break immediately. However, if
it does break inside the other fellow's non-debugging DLL, then you may
just see assembly codes.

But in any case, at least you'll be 100% if it were indeed that other
DLL that was trashing your data structure. You will also be able to
see how your data structure is being changed by the DLL too. It's just
that you may not be able to see the code that is changing it, unless
you can read assembly code.

--

-kira

Oct 5 '07 #3
On Oct 5, 10:25 am, "b...@blah.com" <GrahamJWa...@gmail.comwrote:
hi,

I have a question I should know the answer to.

I've delivered a working set of c++ libraries/dlls that have been
fully tested and validated. Now my problem is that somebody else has
been furiously fixing memory leaks and what not in another DLL that is
used by my own. I suddenly find myself in the situation where MY dll's
are now crashing out and I'm fairly sure, that the fixes in the other
DLL have hosed my stuff. I'm thinking its trampling on memory or
corrupting the heap.

I would like to determine if this is the case. Though I'm not sure how
to go about it. All of a sudden, all my pointers are pointing to
invalid data/memory and I'm getting crashest with even the SIMPLEST of
tests.

Can anybody tell me whats the best way to go about determining if
memory is been corrupted. I feel bad asking this as I should really
know the answer! :( Ideally I'd like to know precisely the point in
time that somebody writes to MY memory or corrupts it. I've put
breakpoints in dtors to see if anybody is explitly deleting my objects
but thats come up blank.

I'm working in a MS environment, but thats not realy important here.

thanks again for any input or tips.

G
Hi,

Victor has already said that before, but you should really post this
to a Windows development group.
That said, a simple question for you: How does your module interact
with the 3rd party DLLs? Do you dynamically load them in run-time,
using LoadLibrary, or do you compile against .lib files and load
the DLLs in load-time? The solution may be as simple as compiling
your DLL against the up-to-date .lib stub of the 3rd party DLLs.

Roni

Oct 5 '07 #4
On Oct 5, 10:25 am, "b...@blah.com" <GrahamJWa...@gmail.comwrote:
hi,

I have a question I should know the answer to.

I've delivered a working set of c++ libraries/dlls that have been
fully tested and validated. Now my problem is that somebody else has
been furiously fixing memory leaks and what not in another DLL that is
used by my own. I suddenly find myself in the situation where MY dll's
are now crashing out and I'm fairly sure, that the fixes in the other
DLL have hosed my stuff. I'm thinking its trampling on memory or
corrupting the heap.

I would like to determine if this is the case. Though I'm not sure how
to go about it. All of a sudden, all my pointers are pointing to
invalid data/memory and I'm getting crashest with even the SIMPLEST of
tests.

Can anybody tell me whats the best way to go about determining if
memory is been corrupted. I feel bad asking this as I should really
know the answer! :( Ideally I'd like to know precisely the point in
time that somebody writes to MY memory or corrupts it. I've put
breakpoints in dtors to see if anybody is explitly deleting my objects
but thats come up blank.

I'm working in a MS environment, but thats not realy important here.

thanks again for any input or tips.

G

Hi,

Victor has already said that before, but you should really post this
to a Windows development group.
That said, a simple question for you: How does your module interact
with the 3rd party DLLs? Do you dynamically load them in run-time,
using LoadLibrary, or do you compile against .lib files and load
the DLLs in load-time? The solution may be as simple as compiling
your DLL against the up-to-date .lib stub of the 3rd party DLLs.

Roni

Oct 5 '07 #5
On Oct 5, 4:25 am, "b...@blah.com" <GrahamJWa...@gmail.comwrote:
[snip]
I've delivered a working set of c++ libraries/dlls that have been
fully tested and validated. Now my problem is that somebody else has
been furiously fixing memory leaks and what not in another DLL that is
used by my own. I suddenly find myself in the situation where MY dll's
are now crashing out and I'm fairly sure, that the fixes in the other
DLL have hosed my stuff. I'm thinking its trampling on memory or
corrupting the heap.
Just a thought, noting that it is off topic for this news group.
Can you get two systems running, one with the new DLL and one
with the old? Then you could follow operation line-by-line till
you see a difference between them.
Socks

Oct 5 '07 #6
On Oct 5, 8:19 pm, Kira Yamato <kira...@earthlink.netwrote:
On 2007-10-05 04:25:57 -0400, "b...@blah.com" <GrahamJWa...@gmail.comsaid:
I have a question I should know the answer to.
I've delivered a working set of c++ libraries/dlls that have been
fully tested and validated. Now my problem is that somebody else has
been furiously fixing memory leaks and what not in another DLL that is
used by my own. I suddenly find myself in the situation where MY dll's
are now crashing out and I'm fairly sure, that the fixes in the other
DLL have hosed my stuff. I'm thinking its trampling on memory or
corrupting the heap.
I would like to determine if this is the case. Though I'm not sure how
to go about it. All of a sudden, all my pointers are pointing to
invalid data/memory and I'm getting crashest with even the SIMPLEST of
tests.
Can anybody tell me whats the best way to go about determining if
memory is been corrupted. I feel bad asking this as I should really
know the answer! :( Ideally I'd like to know precisely the point in
time that somebody writes to MY memory or corrupts it. I've put
breakpoints in dtors to see if anybody is explitly deleting my objects
but thats come up blank.
I'm working in a MS environment, but thats not realy important here.
Since you're using MS stuff, my comment below may not be relevant.
However, I'll say it hoping that someone may know its equivalence in
the MS world.
In gdb --- a debugger for C++ that I use on the UNIX platform --- there
is such a thing called a *watchpoint* , where you ask the debugger to
examine the value of some expression at every step of execution and to
break the program whenever this value changes.
So, you can set a watchpoint on one of your data-structure. If
anything changes it, the program will break immediately. However, if
it does break inside the other fellow's non-debugging DLL, then you may
just see assembly codes.
There are much more efficient tools for this sort of problem.
Under Linux, we use valgrind, and under Solaris (and Windows
too, I think, although I don't work on that end), Purify. Of
course, Purify isn't free, but it's a lot less expensive that he
is.
But in any case, at least you'll be 100% if it were indeed that other
DLL that was trashing your data structure.
No you won't. Suppose, for example, you pass a function in the
DLL a bad pointer.

In fact, what I suspect is that his code uses pointers after the
other DLL has declared them invalid. Which used to work because
the other DLL leaked the memory behind the pointer. But it's
really a question of contract between the DLL's; who is
responsible for what, and what are the lifetimes of the objects
passed between the two subsystems.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Oct 5 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
2
by: Andy Fish | last post by:
Hi, Using VS.NET 2003, when I use 'F5' to start debugging my web app, it obviously attaches the IDE to IIS for server debugging. However, it also seems to put IE into some kind of debugging mode...
2
by: Alex Clark | last post by:
Hi All, My system: WinXP Pro, VS.NET 2003, SQL Server Personal Edition. I'm having problems with my old favourite demon, SQL Debugging from within VS.NET. I have to say I've found this...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
6
by: KevinGPO | last post by:
I am currently developing a website in ASP (VBScript) using MS Visual C#.NET IDE. I just create a new "ASP.NET Web Application" and point to my local webserver (IIS) of my website address. Then I...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
5
by: =?Utf-8?B?Z2FkeWE=?= | last post by:
I can't get to debug on my local IIS using VStudio.net 2005 Prof. I can on the development server. I get the msg 'the server does not support debugging for asp.net...' I have done the following...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
4
by: =?Utf-8?B?TWlrZSBHYWxl?= | last post by:
VS 2008 initially didn't debug classic ASP. SP1 fixes this in some ways. You can debug if you select the debug option to "Start Without Debugging, then either attach the debugger manually or...
0
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
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
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...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.