correction of the heap

S

ssylee

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?
 
I

Ian Collins

ssylee said:
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?

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.
 
L

Leandro Melo

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?

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).
 
S

ssylee

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).

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.
 
S

ssylee

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.

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.
 
G

gw7rib

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.
 
R

Rolf Magnus

"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.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top