Which thread threw the exception?

delphi package - automated exception handling
Post Reply
preston
Posts: 2
Joined: Tue Aug 23, 2005 6:29 pm

Which thread threw the exception?

Post by preston »

First I want to say that MadExcept rocks. Definately worth the licensing fees.

I've got a statck trace that contains multiple threads. How do I know which thread threw the exception?
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Re: Which thread threw the exception?

Post by madshi »

preston wrote:First I want to say that MadExcept rocks. Definately worth the licensing fees.
Thanks... :D
preston wrote:I've got a statck trace that contains multiple threads. How do I know which thread threw the exception?
The crashing thread is always listed first in the bug report.
preston
Posts: 2
Joined: Tue Aug 23, 2005 6:29 pm

Post by preston »

In this case then does it mean MadExcept threw the exception?

madExcept version : 2.7g
exception class : EAccessViolation
exception message : Access violation at address 462B462B. Read of address 462B462B.

thread $bf8:
462b462b ???
7c91920e ntdll.dll LdrShutdownThread
004055c1 hallmark.exe System EndThread
0045208f hallmark.exe Classes ThreadProc
0040556c hallmark.exe System ThreadWrapper
0042f7a7 hallmark.exe madExcept ThreadExceptFrame
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Nope. You'll see "madExcept.ThreadExceptFrame" in most if not all threads. It's just a wrapper with a try..except block in it, which makes sure that madExcept gets a hold of all exceptions in the thread.

The thread during shutdown of the thread jumped to code location "462b462b". At this code location there was no code, though. The location was not even allocated. Thus the exception.

The big question is: Why did the thread try to jump to that code location? That's very hard to say. I'd guess that the thread's stack was overwritten with wild data somewhere. Might be one of the typical "buffer overflow" stories. Does that thread have big local variables? Check out whether you're writing over the bounds somewhere.
Post Reply