What is a "unhandled OS exception"

delphi package - automated exception handling
Post Reply
vam6
Posts: 8
Joined: Fri Nov 23, 2012 1:10 am

What is a "unhandled OS exception"

Post by vam6 »

I'm using Mad Except v4.0.8.1

My application is a DLL. it's run inside of a third-party host application.

Occasionally users send in Mad Except reports with
exception class: Exception
exception message: Unhandled OS exception

What is a Unhandled OS exception?


Three separate applications are listed in the report below.
- Poise.dll is my application
- reaper.exe is the third-party host application.
- OP-X PRO-II.vst3 is another DLL application, renamed to .vst3

Which application would have triggered the "unhandled OS exception" error?

Relevant report details:

Code: Select all

computer name      : PREDATOR
registered owner   : TigerDirect 116
operating system   : Windows 8 x64 build 9200
system language    : English
process id         : $57e4
executable         : reaper.exe
current module     : Poise.dll             
compiled with      : Delphi XE2
madExcept version  : 4.0.8.1
exception number   : 1
exception class    : Exception
exception message  : Unhandled OS exception.

main thread ($71a0):
1a561c32 OP-X PRO-II.vst3
7ffca7d3 USER32.dll        DispatchMessageW
7ffca744 KERNEL32.DLL      BaseThreadInitThunk
7ffca975 ntdll.dll         RtlUserThreadStart

Build Details:
Application Name: Poise
Module: Poise.dll
Module File Version: 1.1.50.77
Host: reaper.exe
Host File Version: 5.1.0.0
Platform: Win64
CPU: x64




Full report

Code: Select all

computer name      : PREDATOR
date/time          : 2015-12-22, 00:30:00, 871ms
user name          : OWNER
registered owner   : TigerDirect 116
operating system   : Windows 8 x64 build 9200
system language    : English
system up time     : 4 days 6 hours
program up time    : 34 minutes 39 seconds
processors         : 8x Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
physical memory    : 5934/12225 MB (free/total)
free disk space    : (C:) 169.78 GB
display mode       : 1920x1080, 32 bit
process id         : $57e4
allocated memory   : 713.28 MB
largest free block : 131025.99 GB
executable         : reaper.exe
current module     : Poise.dll
module date/time   : 2015-01-13 08:51
version            : 1.1.50.77
compiled with      : Delphi XE2
madExcept version  : 4.0.8.1
contact name       : XXX XXXX
contact email      : XXXXX@gmail.com
callstack crc      : $0dcce6e5, $38d1c898, $38d1c898
exception number   : 1
exception class    : Exception
exception message  : Unhandled OS exception.

main thread ($71a0):
1a561c32 OP-X PRO-II.vst3
7ffca7d3 USER32.dll        DispatchMessageW
7ffca744 KERNEL32.DLL      BaseThreadInitThunk
7ffca975 ntdll.dll         RtlUserThreadStart

Build Details:
Application Name: Poise
Module: Poise.dll
Module File Version: 1.1.50.77
Host: reaper.exe
Host File Version: 5.1.0.0
Platform: Win64
CPU: x64

Thanks in advance for your help!
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: What is a "unhandled OS exception"

Post by madshi »

I suppose your DLL is calling "madExcept.InstallUnhandledExceptionFilter"? If you do that, madExcept calls the win32 API "SetUnhandledExceptionFilter()" to be notified about unhandled exceptions in the process. See here:

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

And "Unhandled OS exception" is what you get then. I'm not sure if this is something you want to do inside of a plugin DLL. I'm not saying you shouldn't do that, I'm not sure myself if you should or not. It seems to be crash inside of the EXE, though, so if you hadn't called "InstallUnhandledExceptionFilter", the EXE would have had to deal with the exception. It's impossible for me to know/say what would have happened then.
vam6
Posts: 8
Joined: Fri Nov 23, 2012 1:10 am

Re: What is a "unhandled OS exception"

Post by vam6 »

Thanks for the answer Madshi. That explains a few things.

Code: Select all

I suppose your DLL is calling "madExcept.InstallUnhandledExceptionFilter"?
It is. I'll stop doing so immediately.

In most circumstances, my plugin DLL will be running in the same process as the host application and other third-party DLLs. I don't want to catch errors that are generated in the host or other DLLs. It makes my code look bad and increases my support load.

Is there a way to catch unhandled exceptions generated by my DLL but not other third party code?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: What is a "unhandled OS exception"

Post by madshi »

You'll need to put a "try..except HandleException end" block around every entry point, as explained at the top of this page:

http://help.madshi.net/HowToUseMadExcept.htm
vam6
Posts: 8
Joined: Fri Nov 23, 2012 1:10 am

Re: What is a "unhandled OS exception"

Post by vam6 »

Thanks for the quick support Madshi. :)
Post Reply