sawsen11 / jrfonseca

Automatically exported from code.google.com/p/jrfonseca
0 stars 0 forks source link

DrMinGW V0.6.1/x64 does not work with TDM build of MinGW #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build a project using MinGW/TDM V4.6.1
2. Generate a fault in the program
3. DrMinGW V0.6.1/x64 will open the debug window, but no data will be present.

What is the expected output? What do you see instead?
I expect to see a debug trace of the fault location, but I see nothing.

What version of the product are you using? On what operating system?
My OS: Windows 7 64 bit

Please provide any additional information below.
I have been building with MinGW [g++ (GCC) 3.4.5 (mingw special)] for several 
years now.  DrMinGW works wonderfully with this toolchain!!

However, I recently have been working in C++, and that older version of MinGW 
does not work properly, so I wanted to upgrade to a more-recent compiler.  
Because the MinGW builds have linking problems, I used the TDM build of the 
toolchain
[g++ (tdm-1) 4.6.1]

However, when I get a fault in a program built with this toolchain, DrMinGW 
just opens up an empty window with a register dump and no other data.

Original issue reported on code.google.com by derell.l...@gmail.com on 21 Jan 2014 at 6:26

GoogleCodeExporter commented 9 years ago
This might have been fixed with 
https://github.com/jrfonseca/drmingw/commit/7fda0e38b8c4ac03b88394f8b7046a07cb55
5e37

Please try https://github.com/jrfonseca/drmingw/releases/tag/0.6.2

Original comment by Jose.R.F...@gmail.com on 30 Apr 2014 at 5:51

GoogleCodeExporter commented 9 years ago
Okay, I've installed the 64-bit version; I'll inject a bug into it and see
how it reports.  Thanks for the possible fix!
Derell

Original comment by derell.l...@gmail.com on 30 Apr 2014 at 4:55

GoogleCodeExporter commented 9 years ago
No, V0.6.2 still doesn't work...
First, I loaded it using "sudo drmingw -i", which I think is correct; I got
the popup window saying that the runtime debugger was loaded.

I took an existing Win32 application, and added a memory over-write to it:

//  global data:
static char *null_ptr = (char *) NULL ;
static char *bad_data = "to kill a pointer" ;

//  in a Windows message handler, I added:
      switch (target) {
      case IDM_DO_ANAGRAMS:
         min_word_len = read_max_chars() ;
         strcpy(null_ptr, bad_data) ;  *//  <===  force crash, write to
NULL pointer*
         PostMessage(hwndCommTask, WM_DO_COMM_TASK, (WPARAM) 0, 0) ;
         return true;

I built it using g++ (4.3.3-tdm-1 mingw32) 4.3.3
and -ggdb compile flag (I also tried just -g )

When I ran the crash code, I got the result shown in the attached file;
note that none of code in my application is shown, it's just raw binary
references...

Derell Licht

Original comment by derell.l...@gmail.com on 30 Apr 2014 at 5:26

GoogleCodeExporter commented 9 years ago
TDM V4.6.1 and 4.3.3 are no longer available in 
http://tdm-gcc.tdragon.net/download
Could you try more recent versions?

I'm afraid I don't have the time to debug an issue which could be on the 
compiler itself.

FWIW, I use compilers from http://mingw-w64.sourceforge.net

Original comment by Jose.R.F...@gmail.com on 30 Apr 2014 at 6:08

GoogleCodeExporter commented 9 years ago
Okay, I tried it with what I *thought* was TDM V4.8.1, but --version says:
g++ (GCC) 4.8.1
So maybe it is not TDM, but regular MinGW.  In any case, I got the same
result.

BTW, should I be using the x64 or x32 version of DrMinGW ???  I have a
64-bit OS, so I was using the x64 version, but I just realized that I use
the 32-bit versions of the compiler toolchains (so I can run on WinXP as
well)... I wonder if that's my problem??

In any case, I'm downloading TDM 4.8.1 now, to test this further.

Original comment by derell.l...@gmail.com on 30 Apr 2014 at 6:19

GoogleCodeExporter commented 9 years ago
> BTW, should I be using the x64 or x32 version of DrMinGW ??? 

You need to use the version that matches the executable you produce. Ie. if 
you're producing 32bit executables, you should install the 32bit DrMingw.

Original comment by Jose.R.F...@gmail.com on 30 Apr 2014 at 6:27

GoogleCodeExporter commented 9 years ago
Okay, I installed g++ (tdm-2) 4.8.1, and also installed the 32-bit version
of DrMinGW, and I still get the same result...
I'm compiling each file with:
g++ -Wall -ggdb -Wno-write-strings -Weffc++ -I../der_libs -c winagrams.cpp
-o winagrams.o
but I just don't seem to end up with symbol information that  DrMingw can
understand...

Original comment by derell.l...@gmail.com on 30 Apr 2014 at 6:28

GoogleCodeExporter commented 9 years ago
I tried the sample included with DrMingw with 32bit and 64bit version of g++ 
(tdm-2) 4.8.1 and it works fine.

If there is a problem, it must be specific to your source code and/or library...

Please try the sample included in DrMingw.  If the sample works fine, but your 
code fine, then I'll need some way of reproducing the problem here. That is, 
I'll need you to provide an example source file which shows the problem you're 
seeing.

Without it I'm afraid there's nothing more I can do.  Please reopen if the 
issue persists and you can provide some way for me to repro it.

Original comment by Jose.R.F...@gmail.com on 9 May 2014 at 2:07