App crashes but no exceptions are loggged - isolated case

delphi package - automated exception handling
Post Reply
santiago
Posts: 73
Joined: Thu May 05, 2016 6:01 pm

App crashes but no exceptions are loggged - isolated case

Post by santiago »

Hello madschi!

Happy new year!!

We have one customer who has run into the following problem often. It is not reproducible, but there can be days where it does not ocurr at all, on other days it happen a couple of times or even more than 10 times.
What is happening is that our app is crashing but no exception is being logged - so we are kind of clueless as to what the cause of the problem could be.

We have been using madExcept for several months now and this is so far the only case where this is happening. One of my colleagues did a postmortem debug session with WinDbg after such a crash occurred on the customers machine and looking at the callstack it seems that there madExcept did intercept the exception but ended up in an endless loop?

Here is a screenshot of the callstack
Image

This is a screenshot of the windows event viewer
Image

Here is a link to the WinDbg dump file if it be of any use to you.
https://www.dropbox.com/s/6qbbb0wesvmhy ... 0.dmp?dl=0

Please let us know if there is anything useful/helpful you can gain from this.

Have you had similar cases in the past, where an unhandeled exception occurs but is somehow not logged?

Thank you!
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: App crashes but no exceptions are loggged - isolated cas

Post by madshi »

Hello,

and sorry for the late reply!

Hmmmm... This looks pretty bad. It seems madExcept wants to analyze the exception, but some internal data lookup crashes. My best guess right now is that either some memory was overwritten with random data (e.g. by a buffer overrun, or by writing to an already freed memory block), or that a random memory block was accidently freed which shouldn't have been freed.

Have you tried activating the "instantly crash on buffer overrun" feature in madExcept to check for buffer overruns etc?
santiago
Posts: 73
Joined: Thu May 05, 2016 6:01 pm

Re: App crashes but no exceptions are loggged - isolated cas

Post by santiago »

Thanks for the info!

Could this happen if the process runs out of memory?

We will look into the crash on buffer overrun switch.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: App crashes but no exceptions are loggged - isolated cas

Post by madshi »

Running out of memory usually produces a proper EOutOfMemory exception, but not memory corruption. I don't think that's a likely explanation.

Please note that the "instantly crash" feature currently only works in 32bit, and it consumes a lot of extra RAM. So if we've bad luck, it might not work for your process if it allocates a lot.
santiago
Posts: 73
Joined: Thu May 05, 2016 6:01 pm

Re: App crashes but no exceptions are loggged - isolated cas

Post by santiago »

madschi,

I guess it is not possible to enable the 'Instantly Crash on Buffer overrun' feature at runtime.
I tried:
MESettings.CrashOnOverrun := True;
MESettings.CrashOnUnderrun := True;

But those properties are read-only.

So they have to be set at compile time, correct? Unless I missed some other way to activate them at runtime.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: App crashes but no exceptions are loggged - isolated cas

Post by madshi »

Yes, they need to be set at compile time. The whole memory manager needs to be replaced, which is hard to do at runtime because at the time madExcept is initialized, some allocations may already have been made in system units.
Post Reply