Questions tagged [dr-memory]

Dr. Memory is a memory monitoring tool for identifying memory-related programming errors

The tool primarily supports Windows. Linux support is not as robust because online symbolization is not yet supported.

Dr. Memory comes in two flavours: "Light" only searches for unaddressable accesses like OOB or use-after-frees, and it adds moderate execution slowdown. "Full" also searches for uninitialized reads and memory leaks, but it adds a large slowdown.

Site: http://drmemory.org/

48 questions
6
votes
1 answer

C++ std::vector gives uninitialized read error using drmemory

I'm using stl containers in my project and I discovered a weird error that I can't explain. Let's consider the following code: #include #include int main(int argc, char** argv) { std::vector vec; vec.resize(5,…
Cactusjoe
  • 73
  • 5
5
votes
0 answers

What's the Dr. Memory's equivalent of the valgrind's "track origins"?

In valgrind I turn on --track-origins to find out where does the uninitialized value comes from. On Windows I'm using Dr. Memory, because valgrind isn't ported yet as far as I know. It reports uninitialized reads, but looking at the manual I don't…
Calmarius
  • 18,570
  • 18
  • 110
  • 157
5
votes
1 answer

Dr Memory and the mysterious uninitialized read

The code below doesn't do anything interesting, but the mystery is why would Dr Memory think there's an unitialized read? Any ideas? #include int main(int argc, const char* argv[]) { int aa[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; …
Jeff M
  • 2,492
  • 3
  • 22
  • 38
5
votes
0 answers

The function async leaks memory on Windows

In an application of mine, I introduced a memory leak when I began to use std::async. After examining the problem with the tool Dr. memory, I found out that std::async leaks memory very often. I made a quick test that reproduces the…
lauw
  • 1,301
  • 2
  • 10
  • 10
4
votes
1 answer

I'm getting a memory leak but I can't figure out why

I can't tell if there's something really obvious that I'm missing, but I'm writing a small game and I got some memory leaks using DrMemory. I couldn't figure out what was wrong exactly, so I wrote a simpler file that kinda modeled what my game was…
Allen Yao
  • 61
  • 5
3
votes
1 answer

Dr Memory will not run with SDL ttf (2.0.10)

Upon adding SDL_ttf (2.0.10), DrMemory refuses to work anymore. The console went from printing out the messages to outputting nothing and sending the following to stdout: ~~Dr.M~~ WARNING: unable to locate results file: can't open…
Water
  • 3,245
  • 3
  • 28
  • 58
2
votes
1 answer

How do I compile the source code for ADB (Android Debug Bridge)?

I'm trying to run a memory error detector (like Valgrind's Memcheck or Drmemory) on the ADB software. However, I'm having trouble figuring it how to build/compile the source code. I'm using linux…
bbqsasuke
  • 21
  • 1
  • 3
2
votes
1 answer

Error using Dr. Memory with Visual Studio project: libraries needed by the application are missing

I have a Visual Studio 2017 project which uses the Allegro 5 library. I installed Dr. Memory using the latest .msi installer and followed these instructions to set up my project to work with Dr. Memory. However, when I try to run Dr. Memory, I see a…
user3726962
  • 333
  • 1
  • 4
  • 17
1
vote
0 answers

Why is there memory leaks with SDL2 (2.0.14) dll?

I am using SDL2 version 2.0.14. This is the current stable version. I noticed that any program I write with SDL2 has memory leaks. For example #define SDL_MAIN_HANDLED #include int main() { SDL_Init(SDL_INIT_VIDEO); SDL_Window*…
Imtiaz Kabir
  • 119
  • 4
  • 8
1
vote
1 answer

Dr. Memory unaddressable access and possible leak and still-reachable allocation from simple hello world

Basic hello world program using MinGW and gcc with no additional flags. I'm confused why I'm getting the errors 'unaddressable access', 'possible leak', and '4134 byte(s) of still-reachable allocation'. Target: x86_64-w64-mingw32 using gcc version…
26F
  • 13
  • 7
1
vote
1 answer

Why is Dr Memory reporting freed memory errors when I haven't freed any memory?

The following code #include #include #include struct Type { std::string a; }; int main() { std::vector data; data.resize(sizeof(Type)); Type* a = new (&data[0]) Type({"something"}); …
NeomerArcana
  • 1,978
  • 3
  • 23
  • 50
1
vote
2 answers

Am I accessing already freed memory, or is DrMemory reporting incorrectly in this case?

I have the following program: #include struct Comp1 { float x; std::vector vec; }; int main() { std::vector data; data.resize(sizeof(Comp1)); Comp1* ptr1 = new (&data[0]) Comp1({.3f,{3,4,2,1}}); …
NeomerArcana
  • 1,978
  • 3
  • 23
  • 50
1
vote
0 answers

When looping through a folder in C using dirent.h (in windows) and checking the .exe file with dr.memory i get UNINITIALIZED READ error

I wrote a program in C that prints all of the files in a folder using dirent.h (in windows) and it is working fine, but when I check the .exe file with dr.memory I get lots of UNINITIALIZED READ errors. All dr.memory results:…
ItayMiz
  • 669
  • 1
  • 7
  • 14
1
vote
1 answer

A tool to detect misuses of the POSIX pthreads API but not Helgrind

For some reason I can't use Helgrind to detect misuses of the POSIX pthreads API (for example, unlocking a non-locked mutex, deallocation of memory that contains a locked mutex and so on). I tried to find another tool but actually failed. As I found…
WildWind03
  • 301
  • 3
  • 14
1
vote
0 answers

Dr Memory crash in Visual Studio with "WARNING: application exited with abnormal code 0xc0000409"

I made a Node class and tried to implement a simple tree structure using C++. I tested the code, visual studio was able to compile and output the expected results. However, when I tried Dr Memory to check memory leak, Dr Memory always crash at…
Vince
  • 11
  • 1
1
2 3 4