-
December 2nd, 2003, 08:08 AM
#16
Originally posted by CornedBee
Aside from fully agreeing with the previous posters, you can catch Windows SEH exceptions with
catch(...)
but you don't know what hit you.
is there some clearance sell on SExceptions today??? just in time for christmas??? This must make my 6th comment on it today...
install a set_se_translator(...) re-throw, after a stackwalk(...) if you like...your catch(...) becomes catch(unsigned int foo)
-
December 2nd, 2003, 08:09 AM
#17
Originally posted by CornedBee
Aside from fully agreeing with the previous posters, you can catch Windows SEH exceptions with
catch(...)
but you don't know what hit you.
And you don't know what state your process or thread is in. Did the thread have a stack overflow? Are you sure you can recover? Was there a privileged instruction? Did the thread forget to release a mutex in the stack-unwinding? etc...
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
-
December 2nd, 2003, 08:45 AM
#18
All of which brings us back to: fix the underlying problem.
Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure.
-- Sutter and Alexandrescu, C++ Coding Standards
Programs must be written for people to read, and only incidentally for machines to execute.
-- Harold Abelson and Gerald Jay Sussman
The cheapest, fastest and most reliable components of a computer system are those that aren't there.
-- Gordon Bell
-
December 2nd, 2003, 11:03 AM
#19
Yep. Oh, and stack overflows cannot be caught that way.
All the buzzt
CornedBee
-
December 2nd, 2003, 11:12 AM
#20
Originally posted by CornedBee
Yep. Oh, and stack overflows cannot be caught that way.
Incorrect.
An exception 0xc00000fd sure can be caught by "catch( ... )" or by using structured exception handling via set_se_translator...
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
-
December 2nd, 2003, 11:51 AM
#21
Right. Hmm, I was sure that I remembered something written about stack overflows immediatly and irrecoverably terminating the application.
All the buzzt
CornedBee
-
December 2nd, 2003, 11:57 AM
#22
Originally posted by CornedBee
Right. Hmm, I was sure that I remembered something written about stack overflows immediatly and irrecoverably terminating the application.
Well... if you don't catch it...
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
-
December 6th, 2003, 08:23 AM
#23
Originally posted by vicodin451
Incorrect.
An exception 0xc00000fd sure can be caught by "catch( ... )" or by using structured exception handling via set_se_translator...
Anyone catching an "exception" that results from undefined behaviour including platform-specific failures (such as a stack overflow), really needs to hit the (C++) books again.
-
December 6th, 2003, 12:12 PM
#24
Originally posted by Sef
Anyone catching an "exception" that results from undefined behaviour including platform-specific failures (such as a stack overflow), really needs to hit the (C++) books again.
The "void main()" is a typically a giveaway that though this is the non-VC++ forum, the OP is using VC++. The talk of structured exceptions is of course Windows-specific.
IIRC, Richter details an example of catching a stack overflow and recovering from it in "Programming Applications for Microsoft Windows".
At any rate, if you will follow this thread, you will see that it was not recommended that the OP do anything along the lines of catching any sort of "exception" caused by "undefined behavior". The OP was urged to correct the problem rather than hide its effects.
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|