c++ - Debugging memory corruption on MinGW -


i'm having trouble memory corruption in rather large project control scientific hardware (ca. 6000 lines), , i'm not sure best way/tool solve problem. project uses qt 4.8, , it's built qtcreator , mingw. program works more or less, i'm having stability issues. random crashes, on occasions, when change source code little bit, program crash @ same position (one has worked previously). position has picked time looks this:

 char stages2[1024];  sprintf(stages2, "m-511.dd.load\nnostage"); 

the second line gives segmentation fault (sigsegv) when run in gdb - tells me have kind of problem program's memory, because i'm these 2 lines correct. also, "crash site" changes depending on exact source code; i've seen crashes in windows dlls qt using.

i've looked few options find cause of problem, i've run difficulties:

  • i've downloaded duma, can't compile on mingw - i've had change include command in order make library, 1 of test programs failing. (any hints or links binaries, anyone?)
  • i've tried application verifier, when run it stops @ same position, 3rd party dll i'm using leaking handle. i'm reasonably sure not cause of problems, can't continue debugging process because gdb goes same position (it gets stuck there when i'm using application verifier).
  • finally, i've run program dr. memory, crashes before reaching main window, without giving me useful outputs (the thing i'm seeing qt apparently wasting memory).

i'd grateful advice on what's promising method rid of error.

compile optimization , -wall (and perhaps other warning flags), check all warnings make sure nothing fishy going on.

use tools valgrind check memory management snafus.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -