Re: Compilation using MinGW/GCC

135 views
Skip to first unread message

Derek Bruening

unread,
Feb 26, 2012, 12:46:36 PM2/26/12
to dynamor...@googlegroups.com, drmemor...@googlegroups.com
+ drmemory-users

On Sun, Feb 26, 2012 at 4:11 AM, MortenMacFly <mac...@gmx.net> wrote:
In fact, the actual issue is, that with the official release v1.4.5-2
of DrMemory I can see memory leaks in MinGW compiled applications just
fine, but not the lines of code where they occur...

MinGW debug info support (for DWARF2, not stabs, so build -ggdb if using older gcc) is in the Dr. Memory code base and we plan to put out a new release soon.  Until then you could build from sources, or try this release candidate:


so I was hoping
compiling it using MinGW makes this work.

Note that compiling with MinGW would not have affected Dr. Memory's ability to parse MinGW debug info.
 
And sorry for being in the wrong group - turns out that went from
here:
http://dynamorio.org/drmemory.html
...clicking on "Discussion List" to this list which was wrong as I see
now.

I see.  DrMemory is now more clearly split from DynamoRIO.

BTW, if there are any artists out there who want to design a logo for either DynamoRIO or Dr. Memory to spruce up the web sites, and potentially appear on a t-shirt to be handed out at our CGO tutorial, please send suggestions.

- Derek

Derek Bruening

unread,
Feb 28, 2012, 10:24:20 AM2/28/12
to drmemor...@googlegroups.com
-dynamorio +drmemory

On Tue, Feb 28, 2012 at 2:24 AM, MortenMacFly <mac...@gmx.net> wrote:
I see a "little more" now, but still not a pointer to where
the leak occurred, using this little demo file:

int main(int argc, char **argv)
{
 int* i = new int;
 *i = 42;
 return 0;
}

Please read the Dr. Memory documentation on MinGW:

"Since these static libraries contain frame pointer optimizations, we recommend passing the "-no_callstack_use_top_fp" runtime option to Dr. Memory."

% /c/mingw/bin/g++ -o leak.exe -static-libgcc -static-libstdc++  -ggdb leak.c
% ~/drmemory/releases/DrMemory-Windows-1.4.6-1/bin/drmemory.exe -no_callstack_use_top_fp -batch -- ./leak.exe
=>
~~Dr.M~~ Error #2: LEAK 4 direct bytes 0x00031a50-0x00031a54 + 0 indirect bytes
~~Dr.M~~ # 0 operator new()
~~Dr.M~~ # 1 main                         [C:\src\dr\test/leak.c:3]

- Derek

MortenMacFly

unread,
Mar 3, 2012, 10:42:41 AM3/3/12
to drmemor...@googlegroups.com
> "Since these static libraries contain frame pointer optimizations, we recommend passing the "-no_callstack_use_top_fp" runtime option to Dr. Memory."
I'm afraid I am one of these idiots never reading docs... Sorry for that. ;-)

However - thank you a lot for that more than helpful hint!
Reply all
Reply to author
Forward
0 new messages