Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

correction of the heap

0 views
Skip to first unread message

ssylee

unread,
Jan 20, 2009, 3:14:40 PM1/20/09
to
I'm writing a piece of c++ test code. Everything before exiting the
program works well, except upon exiting the program, I got the
following error:

Windows has triggered a breakpoint in matx_migrate.exe.

This may be due to a corruption of the heap, and indicates a bug in
matx_migrate.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information

What typically would make me see such an error? Memory leak?

Victor Bazarov

unread,
Jan 20, 2009, 3:20:54 PM1/20/09
to

Double deletion of a pointer... Buffer overrun... Random uninitialised
pointer dereferenced...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

ssylee

unread,
Jan 20, 2009, 3:21:11 PM1/20/09
to

Ian Collins

unread,
Jan 20, 2009, 3:23:28 PM1/20/09
to

It could be any number of things, a couple of common causes of heap
corruption are writing though a pointer that has been freed and writing
past the end of a bloc.

Review your code and use whatever bounds checker your tools support.

--
Ian Collins

Leandro Melo

unread,
Jan 20, 2009, 3:25:03 PM1/20/09
to

If your program is not complex and doesn't have several modules
involved, I'd guess that you're trying to delete an object twice (the
second time being when the destructor is automatically invoked).

--
Leandro T. C. Melo.

ssylee

unread,
Jan 20, 2009, 4:55:24 PM1/20/09
to

I'm still not sure what's happening with my code. I tried to debug it
by commenting out blocks of the code, and then uncommenting one
section at a time while I run each debug trial. I have noticed that
one of the functions that I have implemented may have been making the
difference between whether that error shows up or not. Would be
appreciated for suggestions if that leads closer to anywhere. Thanks.

ssylee

unread,
Jan 20, 2009, 5:17:56 PM1/20/09
to

This is going to be my last post on the topic. Apparently, there was a
buffer overrun. After I made some minor changes to an object
instantiation, that problem is gone.

gw7...@aol.com

unread,
Jan 21, 2009, 12:06:59 PM1/21/09
to
On 20 Jan, 22:17, ssylee <staniga...@gmail.com> wrote:
> This is going to be my last post on the topic. Apparently, there was a
> buffer overrun. After I made some minor changes to an object
> instantiation, that problem is gone.

"Apparently"?? I'd recommend having a look though the code as it was,
and as it is now, to check that there was a problem before and that it
is now fixed. For one thing, this will make sure that the problem has
indeed gone, and is not simply lurking there ready to find a new way
of showing itself, and also, you may think of other bits of the
program which also need checking.

Hope this helps.
Paul.

Rolf Magnus

unread,
Jan 29, 2009, 1:04:19 AM1/29/09
to
gw7...@aol.com wrote:

As a general rule of thumb: A bug isn't fixed as long as you don't know
exactly why it's fixed.

Pete Becker

unread,
Jan 29, 2009, 8:01:46 AM1/29/09
to

Another way to put it is bugs that go away by themselves come back by
themselves.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

0 new messages