Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

_SCL_SECURE_OUT_OF_RANGE and SetUnhandledExceptionFilter

177 views
Skip to first unread message

gas...@hotmail.com

unread,
Feb 23, 2009, 12:05:59 PM2/23/09
to
Dear all,

we use in our programs a custom exception filter where a minidump is
produced in case of a serious error. This is quite handy during in
house testing where crashes can be analysed.

However we noticed that with vstudio 2008 dumps weren't produced.
Investigating the matter (and googling), it seems that the crt
disables this facility:
_SCL_SECURE_OUT_OF_RANGE -> _invalid_parameter -> _invoke_watson where
a 'SetUnhandledExceptionFilter(NULL)' is made, disabling any client
defined exception filter.

This is quite unhandy. There seems no way to enable it, except
compiling the crt yourself and adjusting the source code. You can add
an invalid parameter handler, but its arguments have only use in
writing some useless log statements. The dump is the essential part,
since there one can do a stack trace.

Do i miss something here and perhaps is there a way to dump? Or should
I simulate a local dump in the 'invalid parameter handler'. It is
horse trick, probably working but a lot of effort for something basic.

Wkr,
me


Jochen Kalmbach [MVP]

unread,
Feb 23, 2009, 1:18:17 PM2/23/09
to
Hi gast128!

> _SCL_SECURE_OUT_OF_RANGE -> _invalid_parameter -> _invoke_watson where
> a 'SetUnhandledExceptionFilter(NULL)' is made, disabling any client
> defined exception filter.

This "feature"is by design ;(

For more info see:
http://blog.kalmbach-software.de/2008/04/02/unhandled-exceptions-in-vc8-and-above-for-x86-and-x64/
http://blog.kalmbachnet.de/?postid=75
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=4c9e4bf1-43e7-4ad5-9610-c09ff294bf18
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101337

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

gas...@hotmail.com

unread,
Feb 24, 2009, 3:54:32 AM2/24/09
to
> This "feature"is by design ;(
>
> For more info see:http://blog.kalmbach-software.de/2008/04/02/unhandled-exceptions-in-v...http://blog.kalmbachnet.de/?postid=75http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedb...https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx...

Thx.

Your trick is to intercept a possible 'SetUnhandledExceptionFilter
(NULL)'. I will think about that (note that I believe that ms also
released a sdk in which one could hook api calls)

Cholo Lennon

unread,
Feb 25, 2009, 8:58:09 PM2/25/09
to

You're right, Microsoft Detours (http://research.microsoft.com/en-us/projects/detours/)

--
Cholo Lennon
Bs.As.
ARG


0 new messages