What information can I get from a gkc Haskell process dump on Windows?

One user of my application on the command line reported what appears to be an endless loop. They helped dump the process (via the task manager) while it was in this state and sent it to me.

I'm not sure how to get useful information from this dump. My normal technique windbg -z the-dump-file.dmp -y releases\v5.0.0 -i releases\v5.0.0

doesn't give me a lot of information that I know how to interpret. Are there any special tools I can use?

Moving forward - are there build options I should add, or other things I should do for my release process to make posthumous debugging like this more fruitful?

Here is an example of the stacks I see. Not a lot of useful information, especially for those used to debug C / C ++ code in WinDbg. :-)

   0  Id: 112dc.cc18 Suspend: 1 Teb: 00000000`00341000 Unfrozen
*** ERROR: Module load completed but symbols could not be loaded for gbc.exe
 # Child-SP          RetAddr           Call Site
00 00000000`01b7d8d0 00000000`01049f71 gbc+0xc5676e
01 00000000`01b7d930 00000000`0104b5b4 gbc+0xc49f71
02 00000000`01b7d9a0 00000000`0104c644 gbc+0xc4b5b4
03 00000000`01b7da60 00000000`0104c1fa gbc+0xc4c644
04 00000000`01b7dab0 00000000`0042545b gbc+0xc4c1fa
05 00000000`01b7db30 00000000`011c40a0 gbc+0x2545b
06 00000000`01b7db38 00000000`0535bee1 gbc+0xdc40a0
07 00000000`01b7db40 00000000`010ffd80 0x535bee1
08 00000000`01b7db48 00000000`0535bee1 gbc+0xcffd80
09 00000000`01b7db50 00007ffb`3581fb01 0x535bee1
0a 00000000`01b7db58 00007ffb`3581b850 imm32!?MSCTF_NULL_THUNK_DATA_DLB+0x2e9
0b 00000000`01b7db60 00000000`00000010 imm32!CtfImmGetCompatibleKeyboardLayout
0c 00000000`01b7db68 00000000`00000000 0x10

   1  Id: 112dc.d324 Suspend: 1 Teb: 00000000`00349000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 00000000`05c2fc48 00007ffb`36441563 ntdll!ZwWaitForWorkViaWorkerFactory+0x14
01 00000000`05c2fc50 00007ffb`34172774 ntdll!TppWorkerThread+0x293
02 00000000`05c2ff60 00007ffb`36470d61 kernel32!BaseThreadInitThunk+0x14
03 00000000`05c2ff90 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   2  Id: 112dc.11b48 Suspend: 1 Teb: 00000000`0034b000 Unfrozen
 # Child-SP          RetAddr           Call Site
00 00000000`0642dd38 00007ffb`32f2988f ntdll!ZwWaitForSingleObject+0x14
01 00000000`0642dd40 00000000`00ffca15 KERNELBASE!WaitForSingleObjectEx+0x9f
02 00000000`0642dde0 00000000`00000000 gbc+0xbfca15

      

+3


source to share


1 answer


Some resources that might be helpful. (If there are more modern ones, I'd like to see them myself.)

Several important nuggets:

Run-time flag +RTS -?

Tells you which run-time flags add information for debugging. They start with +RTS -D

. For example, it +RTS -DS

includes multiple runtime assertions and health checks.



The strange names you see are encoded in z-coded encoding. This is defined at https://ghc.haskell.org/trac/ghc/browser/ghc/compiler/cmm/CLabel.hs .

If you can recompile the code with debug symbols and discard them and reproduce the error, you can set breakpoints (or press Ctrl-C) inside the debugger and back. You can examine the memory using a type command print/a 0x006eb0c0

(although you seem to be using 64-bit pointers). You can see the assembly language instruction that crashed with disassemble

.

You need to use the compile flag -ddump-stg

to see what the variable names mean, because this is the last conversion phase before building the program, and the variable names you see in the debugger match those here.

You can program the code with Debug.Trace

.

+2


source







All Articles