dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]an EXE program dumping core while disassembling


From: Rhys Weatherley
Subject: Re: [DotGNU]an EXE program dumping core while disassembling
Date: Thu, 08 Aug 2002 08:56:57 +1000

C H Gowri Kumar wrote:
> 
> hi ryhs,
> Thanx rhys.
> I wonder how u could find and fix the bugs so fast.
> (U seem to remember each and every line of code and what it is supposed to
> do)

Not every line.  But I do have the general structure of it
in my head.  Most bugs are merely a matter of isolation.
In this case, I did this:

1. Noticed that a NULL signature pointer was causing the crash.
2. Discovered that the NULL signature was being extracted from
   "origMember".
3. Did a "print /x *origMember" in gdb, which dumped that
   structure in hex.
4. Looking at the "token" field (0x0A000001) told me that it
   was MemberRef token #1 (0x0A000000 == IL_META_TOKEN_MEMBER_REF
   from il_meta.h).
5. I went looking at "Load_MemberRef" to see if there was
   some path through that code that may result in the signature
   ending up as NULL during the load process.  Which is where
   I found the bug.

If that hadn't worked, I would have tried to isolate how a
MemberRef changes between load time and dump time.  There might
have been something else modifying the structure after loading.

Moving from step 4 to 5 came from the map in my head, which
told me the most likely place that a MemberRef would be created.
But everything else was pretty ordinary bug-hunting.

Most crash bugs are like the above.  Follow the chain of events
backwards to figure out what caused the bogus value to appear.

Cheers,

Rhys.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]