Getting Exception Information in ISAPI DLL

delphi package - automated exception handling
Post Reply
mvieira
Posts: 3
Joined: Thu Jun 16, 2005 5:18 pm

Getting Exception Information in ISAPI DLL

Post by mvieira »

I have an ISAPI DLL that is giving me a headache. It crashes randomly (apparently), sometimes within hours and other times within days of a recycling or IIS restart operation. Worse yet, the exception is not sent to IIS so it doesn't know when the application crashed--it just stays there rendering the default Delphi 6 ISAPI 500 error message. I installed madExcept hoping to shet some light on the problem, but most of the time all I get is something like this:

Code: Select all

computer name     : TEST
user name         : SYSTEM
system language   : English
system up time    : 57 days 5 hours 
program up time   : 1 hour 12 minutes 
processors        : 4x Intel(R) XEON(TM) CPU 1.80GHz
display mode      : 1024x768, 16 bit
process id        : $11dc
command line      : c:\winnt\system32\inetsrv\w3wp.exe -a \\.\pipe\iisipm863f4c2f-70b6-4bd7-9099-db5ab5153ca6 -ap "TestAppPool"
executable        : w3wp.exe
current module    : \\?\c:\test\\testsrv.dll
module date/time  : madExcept version : 2.7f
exception class   : EAccessViolation
exception message : Access violation at address 022C1FA7 in module 'testsrv.dll'. Read of address 100353D5.

>> internal error in GetThreadReport

modules:
>> internal error in GetModuleReport
By the way, the AV address above is in SysGetMem, and it seems to be a memory allocation problem caused by excess of fragmentation--the DLL uses lots of string manipulation routines. I just want to find out if there's anything in particular triggering the failure.

How can I get madExcept to work in this situation? Any help is appreciated. Thanks.

MV
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

If the memory allocation is broken or fragile, then madExcept will run into problems as well. So this might very well be the case here.

Have you already tried using a replacement memory manager? E.g. try Nexus MM3 or one of the free MMs from here:

http://dennishomepage.gugs-cats.dk/memo ... llenge.htm

Borland's standard MM is known to fragment quite fast, especially in multi threaded server environments. So it would really be a good test to replace it with a better MM to see whether that fixes the problem.
mvieira
Posts: 3
Joined: Thu Jun 16, 2005 5:18 pm

Post by mvieira »

Thanks for your reply. In fact, the problem started happening while I was using Nexus MM. Since then, I disabled it and streamlined many functions, but the problem keeps happening. The only other thing I know is that the ISAPI breaks only when the number of requests exceeds a certain rate of hits per second. The biggest problem is that from that point on, all new requests will get a 500 response until I recycle the app pool manually. The ISAPI wrapper in Delphi won't let the application fail all the way to IISadmin so it could be restarted. Apparently the problem is so bad that madExcept isn't able to function either after it happens. Any other ideas?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Have you already tested for memory leaks? Although I can't really imagine that the leaks only occur in stress situations.

I see you're using madExcept 2.7f, that's rather old. Have you tried the latest beta build? http://madshi.net/madCollectionBeta.exe

Have you tried finding out what code is at address 022C1FA7? Is that inside of your ISAPI dll?
mvieira
Posts: 3
Joined: Thu Jun 16, 2005 5:18 pm

Post by mvieira »

The AV always occurs in SysGetMem, but not always at the same point. I will try the new version and see what happens. THANKS!
Post Reply