Use in a DLL

delphi package - automated exception handling
Post Reply
mj
Posts: 13
Joined: Wed Sep 15, 2004 8:00 pm

Use in a DLL

Post by mj »

Is it safe to use madExcept in a DLL? It is made in Delphi 7, and is used in an app written in VC++. All exceptions are trapped in the Delphi functions that the C++ app calls (see previous question!). The thing is, the app, and email server, has taken to "just disappearing". I sent the DrWatson dumps to the author, and he has come back saying:
(It seems to be sending it to a WndProc address at 0140a874, in the 1st &
3rd cases, nothing was there, in the second case, by chance, the Sophos
OSDP.DLL had loaded itself into that memory area)

No one else has ever reported this problem to us!

I can't think how you could cause that problem, but I can't see how it
could happen because of my app for you, but not for anyone else.

Either there's something which is trying to hook one of my app windows
and is getting it wrong (or unloading itself prematurely), or something
else is creating a hidden window with the wrong WndProc address being
registered, or something bizarre is happening.
He then suggested using a spy app to monitor the messages his windows are getting, and in doing that I noticed the madExcept window and wondered if there might be something happening? Of course the problem only happens randomly, about every three days or so, and isn't leaving any traces other than the DrWatson traces. It is also definitely not happening in my DLL, though it is still loaded at the time.

If you have any thoughts on this, whether it might be madExcept, and what I might do to modify the behaviour (or things I probably forgot to enable as I usually just use madExcept in apps), I'd love to hear your thoughts.

Matthew
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I don't see any reason why you couldn't use madExcept in a normal DLL.

madExcept does create a hidden window, but usually there's no problem with it. madExcept does not hook other windows.

One test you can do is: Compile that DLL without madExcept and see whether the exception is gone then. Of course that's a bit problematic, because how long do you have to wait until you're sure that the problem is really gone? A full week maybe? That's a time consuming test.

Alternatively I'd suggest to replace Sophos with a different AV product to see whether that's the guilty one.
mj
Posts: 13
Joined: Wed Sep 15, 2004 8:00 pm

Post by mj »

Thanks - that you've not heard of anything similar makes me happy. As you say, how to test is the key. Hmm. I'll leave it as-is for now, and see if more info comes to light. Thanks for your thoughts.

(Sophos is loaded by the app BTW to scan files it is processing, so it isn't quite as inappropriate as it seems).

Matthew
Post Reply