PDA

View Full Version : Crash handler on Win32



niko
6th November 2007, 19:13
Hello,

I have an application and a customer reports it crashes from time to time. If I could get a backtrace - like the KDE Crash Handler does ist - i could probably find the bug.
(I'm not able to reproduce the crash on my machine)

How can I create such a backtrace without using a debugger?

thanks,
niko

marcel
6th November 2007, 19:59
See this: http://www.codeproject.com/debug/crash_report.asp

niko
8th November 2007, 22:20
can this be used with mingw?

I get these errors when compiling the included crashcon application:

mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `M:/Dokumente und Einstellungen/niko/Desktop/crashrpt_source/crashcon/src'
g++ -c -O2 -frtti -Wall -fno-exceptions -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQ
D_SUPPORT -DQT_NEEDS_QMAIN -I"m:\Qt\include\QtCore" -I"m:\Qt\include\QtCore" -I"m:\Qt\include\QtGui" -I"m:\Qt\include
-I"m:\Qt\include" -I"." -I"..\..\wtl75\include" -I"m:\mingw\include" -I"m:\Programme\Microsoft Platform SDK\src\mfc"
Qt\include\ActiveQt" -I"release" -I"." -I"m:\Qt\mkspecs\win32-g++" -o release\crashrpt.o ..\..\crashrpt\src\crashrpt.
In file included from ..\..\crashrpt\src\/stdafx.h:15,
from ..\..\crashrpt\src\crashrpt.cpp:11:
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:19: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:20: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:21: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:22: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:23: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:24: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:25: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:26: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:27: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:28: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:29: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:30: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:31: warning: ignoring #pragma warning
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:32: warning: ignoring #pragma warning
In file included from ..\..\crashrpt\src\/stdafx.h:15,
from ..\..\crashrpt\src\crashrpt.cpp:11:
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:35:20: atldef.h: No such file or directory
In file included from m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:50,
from ..\..\crashrpt\src\/stdafx.h:15,
from ..\..\crashrpt\src\crashrpt.cpp:11:
m:/mingw/include/tchar.h:232:1: warning: "__TEXT" redefined
In file included from m:/mingw/include/windef.h:246,
from m:/mingw/include/windows.h:48,
from m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:37,
from ..\..\crashrpt\src\/stdafx.h:15,
from ..\..\crashrpt\src\crashrpt.cpp:11:
m:/mingw/include/winnt.h:106:1: warning: this is the location of the previous definition
In file included from ..\..\crashrpt\src\/stdafx.h:15,
from ..\..\crashrpt\src\crashrpt.cpp:11:
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:57:21: crtdbg.h: No such file or directory
m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:62:22: atliface.h: No such file or directory
In file included from m:/Programme/Microsoft Platform SDK/src/mfc/atlbase.h:69,
from ..\..\crashrpt\src\/stdafx.h:15,
from ..\..\crashrpt\src\crashrpt.cpp:11:
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:41: error: expected constructor, destructor, or type conversion
"AtlDevModeW2A"
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:41: error: expected `,' or `;' before "AtlDevModeW2A"
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `WCHAR* AtlA2WHelper(WCHAR*, const CHAR*, int, UIN
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:48: error: `ATLASSERT' undeclared (first use this function)
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:48: error: (Each undeclared identifier is reported only once fo
function it appears in.)
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `CHAR* AtlW2AHelper(CHAR*, const WCHAR*, int, UINT
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:60: error: `ATLASSERT' undeclared (first use this function)
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `CHAR* T2A(TCHAR*)':
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:186: error: cannot convert `TCHAR*' to `CHAR*' in return
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `TCHAR* A2T(CHAR*)':
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:187: error: cannot convert `CHAR*' to `TCHAR*' in return
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `const CHAR* T2CA(const TCHAR*)':
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:190: error: cannot convert `const TCHAR*' to `const CHAR*' in r
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `const TCHAR* A2CT(const CHAR*)':
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:191: error: cannot convert `const CHAR*' to `const TCHAR*' in r
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `OLECHAR* A2WBSTR(const CHAR*, int)':
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:196: warning: statement has no effect
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:196: warning: statement has no effect
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:196: warning: statement has no effect
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:196: warning: statement has no effect
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:199: warning: passing NULL used for non-pointer converting 6 of
ultiByteToWideChar(UINT, DWORD, const CHAR*, int, WCHAR*, int)'
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h: In function `OLECHAR* T2BSTR(const TCHAR*)':
m:/Programme/Microsoft Platform SDK/src/mfc/atlconv.h:221: warning: statement has no effect


I installed wtl (-I"..\..\wtl75\include") and even microsoft sdk (-I"m:\Programme\Microsoft Platform SDK\src\mfc") - to get atlbase.h which was missing.

niko

niko
12th November 2007, 19:41
Finally I found something useful that works with mingw:
http://jrfonseca.planetaclix.pt/projects/gnu-win32/software/drmingw/index.html

You can also use exchndl.dll directly - without requireing to install drmingw - very nice :D