dbghelp: Workaround for crash in debugger while parsing dwarf2 attr op 75 (resend - attachment fixed)

Paul Chitescu paulc at voip.null.ro
Wed Sep 20 12:20:55 CDT 2006


Changelog: Workaround for a crash that occurs in debugger while parsing dwarf2 
information - dwarf2_compute_location Unhandled attr op: 75

This avoids the debugger crashing forever in a loop but it's not a clean 
solution. Correct would be to handle attribute 75.

The workaround assumes addresses in the first 64K of memory are invalid.  
If a debug info block seems to be at such a low address a FIXME is emitted
instead of crashing. Crashing is bad as it usually results in an endless 
loop - winedbg is invoked to debug the crashed winedbg...

I know the solution is not perfect but at least the debugger survives and 
displays useful information. Probably some information is lost but it 
doesn't seem essential as the backtraces are readable.


Paul Chitescu

P.S. Attachment got broken somewhere during resend...
-------------- next part --------------
--- ./dlls/dbghelp/dwarf.c.orig	2006-08-08 21:33:34.000000000 +0300
+++ ./dlls/dbghelp/dwarf.c	2006-09-13 01:51:35.000000000 +0300
@@ -1063,6 +1063,13 @@
         long offset;
         int in_reg;
 
+        /* FIXME: this is just a workaround to avoid crashing */
+        if (loc.uvalue < 0x10000)
+        {
+            FIXME("Invalid block location %p at %s\n",
+                loc.block, dwarf2_debug_ctx(subpgm->ctx));
+            return;
+        }
         offset = dwarf2_compute_location(subpgm->ctx, loc.block, &in_reg);
 	TRACE("found parameter %s/%ld (reg=%d) at %s\n",
               name.string, offset, in_reg, dwarf2_debug_ctx(subpgm->ctx));


More information about the wine-patches mailing list