Auswertung von Dump-Files

vfl_freak

Premium-User
Guten Morgen,

ich suche schon seit einiger Zeit die Ursache von gelegentlichen Programmabstürzen.
Ich hatte neulich eine Funktion zum Abfangen nicht behandelter Exceptions eingebaut:
C++:
long WINAPI unhandledExceptionFilter( EXCEPTION_POINTERS* ExceptionInfo )
{
    char szDumpFile[1024];
    GetModuleFileName( nullptr, szDumpFile, sizeof szDumpFile );
    strcat_s( szDumpFile, _countof(szDumpFile), ".exp.dump" );
    HANDLE hDumpFile( CreateFile(szDumpFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL) );
    if( hDumpFile != INVALID_HANDLE_VALUE )
    {
        MINIDUMP_EXCEPTION_INFORMATION expi;
        expi.ThreadId = GetCurrentThreadId();
        expi.ClientPointers = NULL;
        expi.ExceptionPointers = ExceptionInfo;
        MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpNormal, &expi, NULL, NULL );
        CloseHandle( hDumpFile );
    }
    return EXCEPTION_CONTINUE_SEARCH;
} // unhandledExceptionFilter
Sie hat nun gestern "endlich" mal zugeschlagen und mir ein wunderschönes DUMP-File ("myApp.exe.exp.dump") erzeugt ...

Leider bin ich in dieser Beziehung noch ziemlicher Neuling und versuche seit dem vergeblich an die Infos in dieser Datei zu kommen. Leider hat mich eine Websuche auch nicht wirklich weitergebracht :-(

Wie/womit muss ich diese datei öffnen, um sie lesen zu können?
Fehlen mir da ggf. noch irgendwelche Tools?

(BTW: ich arbeite mit VS2010 unter XP-SP3)

Danke und Gruß
Klaus
 
Zuletzt bearbeitet von einem Moderator:
Moin deepthroat,

so, habe jetzt die Datei mal zu .dmp umbenannt und konnte sie dann auch im VS öffnen.
Allerdings sind die dort enthaltenen Infos so erstmal recht dürftig (siehe Anlage).

Habe dann WinDbg und die entsprechenden Symbole hier lokal installiert. Auch nach dem Öffnen der Datei mit WinDbg erschließt sich mir nicht viel mehr ...
Microsoft (R) Windows Debugger Version 6.10.0003.233 X86
Copyright (c) Microsoft Corporation. All rights reserved.


Loading Dump File [C:\GSWorkerServer.exe.exp.dmp]
User Mini Dump File: Only registers, stack and portions of memory are available

Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search path. *
* Use .symfix to have the debugger choose a symbol path. *
* After setting your symbol path, use .reload to refresh symbol locations. *
****************************************************************************
Executable search path is:
Windows XP Version 2600 (Service Pack 3) MP (2 procs) Free x86 compatible
Product: WinNt, suite: SingleUserTS
Machine Name:
Debug session time: Tue Dec 17 18:44:16.000 2013 (GMT+1)
System Uptime: not available
Process Uptime: 0 days 7:43:41.000
................................................................
.......
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(13a4.17c0): Access violation - code c0000005 (first/second chance not available)
eax=022b0000 ebx=001c5738 ecx=00000007 edx=7c91e4f4 esi=001c5710 edi=001c5768
eip=7c91e4f4 esp=02229c18 ebp=02229c28 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
Unable to load image C:\WINDOWS\system32\ntdll.dll, Win32 error 0n2
*** WARNING: Unable to verify timestamp for ntdll.dll
*** ERROR: Module load completed but symbols could not be loaded for ntdll.dll
ntdll+0xe4f4:
7c91e4f4 c3 ret

Dummerweise tritt das Problem jedoch nicht hier bei mir lokal auf, sondern nur auf einem Remoterechner, auf dem das entsprechende Programm läuft. Leider kann ich es dort auch nicht im Debugmode aufrufen :-(
Fehlen dort ggf. einfach nur die Symbole?

Oder wie kann ich sonst an Infos zu der Stelle kommen, an dem die Anwendung mit abschmirrt?
Ich hatte eigentlich gehofft, sie im dump-file zu finden ....

Danke und Gruß
Klaus
 

Anhänge

  • Minidump.jpg
    Minidump.jpg
    20,9 KB · Aufrufe: 12
Hast du denn die Symbole deiner Anwendung noch (die .pdb Datei)?

Generell, gib in das WinDbg Kommandofenster ein "!analyze -v".
 
Moin,

ich könnte die PDB neu erzeugen ....
Was könnte ich denn damit anstellen :confused:


Also mit "analyze" erhalte ich nur diese Ausgabe
Code:
0:010> !analyze -v
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

*** WARNING: Unable to verify timestamp for kernel32.dll
*** ERROR: Module load completed but symbols could not be loaded for kernel32.dll
***** OS symbols are WRONG. Please fix symbols to do analysis.

*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for user32.dll - 
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*** WARNING: Unable to verify checksum for W3NSL22E.DLL
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for W3NSL22E.DLL - 
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: kernel32!pNlsUserInfo                         ***
***                                                                   ***
*************************************************************************
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      ***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: kernel32!pNlsUserInfo                         ***
***                                                                   ***
*************************************************************************

FAULTING_IP: 
GSWorkerServer+a33c5
004a33c5 ****              ****?

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 004a33c5 (GSWorkerServer+0x000a33c5)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: fffffff9
Attempt to read from address fffffff9

DEFAULT_BUCKET_ID:  WRONG_SYMBOLS

PROCESS_NAME:  GSWorkerServer.exe

FAULTING_MODULE: 7c910000 ntdll

DEBUG_FLR_IMAGE_TIMESTAMP:  52b01ef9

ERROR_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in "0x%08lx" verweist auf Speicher in "0x%08lx". Der Vorgang  "%s" konnte nicht auf dem Speicher durchgef hrt werden.

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in "0x%08lx" verweist auf Speicher in "0x%08lx". Der Vorgang  "%s" konnte nicht auf dem Speicher durchgef hrt werden.

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  fffffff9

READ_ADDRESS:  fffffff9 

FOLLOWUP_IP: 
GSWorkerServer+a33c5
004a33c5 ****              ****?

FAULTING_THREAD:  000017c0

PRIMARY_PROBLEM_CLASS:  WRONG_SYMBOLS

BUGCHECK_STR:  APPLICATION_FAULT_WRONG_SYMBOLS

IP_ON_HEAP:  900a1951

FRAME_ONE_INVALID: 1

LAST_CONTROL_TRANSFER:  from 900a1951 to 004a33c5

STACK_TEXT:  
WARNING: Stack unwind information not available. Following frames may be wrong.
0222af2c 900a1951 0222bd2c cccccccc cccccccc GSWorkerServer+0xa33c5
0222b8ac 0049f784 0222bb98 00131a64 00000000 0x900a1951
0222bd38 0045f03c 00131a64 00000000 0222bf98 GSWorkerServer+0x9f784
0222c02c 004512d1 00000005 00000056 00000009 GSWorkerServer+0x5f03c
02235bfc 00443338 02272e58 00000046 00000000 GSWorkerServer+0x512d1
022aff70 005fc865 020eb718 90025e55 7c9265b0 GSWorkerServer+0x43338
022affa8 005fc8ef 00000018 022affec 7c80b713 GSWorkerServer+0x1fc865
022affb4 7c80b713 021133b8 7c9265b0 00000018 GSWorkerServer+0x1fc8ef
022affec 00000000 005fc88b 021133b8 00000000 kernel32+0xb713


SYMBOL_STACK_INDEX:  0

SYMBOL_NAME:  GSWorkerServer+a33c5

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: GSWorkerServer

IMAGE_NAME:  GSWorkerServer.exe

STACK_COMMAND:  ~10s; .ecxr ; kb

BUCKET_ID:  WRONG_SYMBOLS

FAILURE_BUCKET_ID:  WRONG_SYMBOLS_c0000005_GSWorkerServer.exe!base_address

Followup: MachineOwner
---------

Danke und Gruß
Klaus
 
ich könnte die PDB neu erzeugen ....
Hm, das müßte aber exakt der gleiche Code sein wie bei der Erzeugung der .exe - gleicher Compiler und Compiler-/Linkeroptionen ebenfalls. Aber selbst dann fürchte ich das es wahrscheinlich nicht funktioniert.
Was könnte ich denn damit anstellen :confused:
WinDbg würde dir dann den Callstack auflösen können und könnte anzeigen in welcher Funktion der Fehler aufgetreten ist - so als würde man "live" debuggen.
Also mit "analyze" erhalte ich nur diese Ausgabe...
Du hast den Symbolpfad noch nicht konfiguriert. Siehe http://msdn.microsoft.com/en-us/library/windows/hardware/ff538058(v=vs.85).aspx
 
Moin deepthroat,

Hm, das müßte aber exakt der gleiche Code sein wie bei der Erzeugung der .exe - gleicher Compiler und Compiler-/Linkeroptionen ebenfalls. Aber selbst dann fürchte ich das es wahrscheinlich nicht funktioniert.

WinDbg würde dir dann den Callstack auflösen können und könnte anzeigen in welcher Funktion der Fehler aufgetreten ist - so als würde man "live" debuggen.

Du hast den Symbolpfad noch nicht konfiguriert. Siehe http://msdn.microsoft.com/en-us/library/windows/hardware/ff538058(v=vs.85).aspx
Nun ja, der exakt gleiche Code wäre es zwar - zumindest DAS ist sichergestellt.

Aber das heißt dann auch, dass WinDbg parallel zur betroffenen Anwendung laufen muss, um an den entsprechenden Callstack zu kommen?
Dann würde es schwierig, da weder WinDbg noch die Symboltabellen auf dem betroffenen Remotesystem (eines unserer drei Live-Systeme) installiert sind. In wieweit das dort passieren darf, kann ich so aus dem Stand nicht sagen ....
Ein 'normales' Debggen mittels VS ist dort jedenfalls nicht möglich!

Den Link mit dem Symbolpfad muss ich nachher nochmal zu Gemüte führen - danke dafür :)

Gruß
Klaus
 
Nun ja, der exakt gleiche Code wäre es zwar - zumindest DAS ist sichergestellt.

Aber das heißt dann auch, dass WinDbg parallel zur betroffenen Anwendung laufen muss, um an den entsprechenden Callstack zu kommen?
Nein. Du brauchst die .pdb der .exe und die .dmp. Dann kann WinDbg alles auflösen. Die Anwendung muss dann nicht mehr laufen.
Dann würde es schwierig, da weder WinDbg noch die Symboltabellen auf dem betroffenen Remotesystem (eines unserer drei Live-Systeme) installiert sind. In wieweit das dort passieren darf, kann ich so aus dem Stand nicht sagen ....
Ein 'normales' Debggen mittels VS ist dort jedenfalls nicht möglich!
Man kann mit VS und WinDbg auch Remote debuggen. Siehe z.B. http://www.cprogramming.com/tutorial/visual_studio_remote_debugging.html bzw. http://www.nynaeve.net/?p=31
 
Moinsen,

Nein. Du brauchst die .pdb der .exe und die .dmp. Dann kann WinDbg alles auflösen. Die Anwendung muss dann nicht mehr laufen.
Ah, ok - das muss ich dann nachher mal testen ...

Ja, mit dem VS ist das schon klar ... allerdings erfolgen hier bei uns alle Zugriffe über Netzlaufwerke und wir haben hier nur EIN internes Remotesystem, auf das ich ein Netzlaufwerk verbinden. Die anderen beiden sind da leider außen vor ...

Mit dem WinDbg habe ich eh' noch nicht gearbeitet. Würde das reichen, wenn ich den mal von unseren Admins auf dem externen Remotesystem installieren lassen würde ?

Gruß
Klaus
 
Zurück