Questions tagged [seh]

Microsoft Structured Exception Handling (SEH) is the native exception handling mechanism for Windows.

Microsoft Structured Exception Handling (SEH) is the native exception handling mechanism for Windows.

177 questions
52
votes
5 answers

What should I know about Structured Exceptions (SEH) in C++?

What important points about Structured Exceptions should every C++ developer know?
Andrew T
  • 5,549
  • 7
  • 43
  • 55
22
votes
2 answers

Visual C++ Unmanaged Code: Use /EHa or /EHsc for C++ exceptions?

If I'm creating a new project in unmanaged C++, Visual Studio 2008 or greater, which exception handling model do I want to go with? I understand that /EHa option results in less efficient code, and also catches SEH exceptions, right? So I have been…
Fauxcuss
  • 474
  • 2
  • 6
  • 13
16
votes
4 answers

How do I convert a Win32 exception code to a string?

I'm reluctantly having to deal with Win32 structured exceptions again. I'm trying to generate a string describing an exception. Most of it is straightforward, but I'm stuck on something basic: how can I convert an exception code (the result of…
Alan Stokes
  • 18,815
  • 3
  • 45
  • 64
16
votes
1 answer

SEHException not caught by Try/Catch

In a background thread, my application regularly examines a network folder (UNC Path) for application updates. It reads out the assembly version of the file, like so: Try newVers =…
Andreas
  • 1,751
  • 2
  • 14
  • 25
13
votes
2 answers

Enable Safe Exception Handling in C++ Builder

For Windows 8 application certification, there are (among other) these requirements: 3.2 Your app must be compiled using the /SafeSEH flag to ensure safe exceptions handling 3.3 Your app must be compiled using the /NXCOMPAT flag to prevent data…
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
12
votes
3 answers

Structured Exception Handler and Delphi

I am trying to set SEH without using try except (This is for my own personal knowledge to get a better idea on how SEH works) The following code doesn't work type TSeh = packed record OldSeh:DWORD; NewSeh:DWORD; end; procedure…
opc0de
  • 11,557
  • 14
  • 94
  • 187
10
votes
2 answers

SEH Equivalent in Linux or How do I handle OS Signals (like SIGSERV) and yet keep continuing

I am currently working on a Unit Testing framework where users can create Test Cases and register with the framework. I would also like to ensure that if any of the User Test Code causes a Crash, it should not Crash the entire framework but should…
Abhijit
  • 62,056
  • 18
  • 131
  • 204
9
votes
3 answers

Programmatic data breakpoint in Visual Studio 2010

I've been trying to use programmatic data breakpoints, à la the CBreakpoint example, by using SetThreadContext to set the debug register directly. Most references that I can find indicate the Visual Studio will still break whenever it encounters a…
John Calsbeek
  • 35,947
  • 7
  • 94
  • 101
8
votes
1 answer

LLVM MCJIT / SEH Exception handling

Lately, I've been attempting to get SEH exception handling to work in LLVM (3.8.1) together with MCJIT. So far without any luck. From what I understand from the website ( http://llvm.org/docs/ExceptionHandling.html ), this is pretty much how this…
atlaste
  • 30,418
  • 3
  • 57
  • 87
8
votes
1 answer

Is __finally supposed to run after EXCEPTION_CONTINUE_SEARCH?

In the following code, the function foo calls itself recursively once. The inner call causes an access violation to be raised. The outer call catches the exception. #include #include void foo(int cont) { __try { …
avakar
  • 32,009
  • 9
  • 68
  • 103
8
votes
1 answer

How to handle V8 engine crash when process runs out of memory

Both node console and Qt5's V8-based QJSEngine can be crashed by the following code: a = []; for (;;) { a.push("hello"); } node's output before crash: FATAL ERROR: JS Allocation failed - process out of memory QJSEngine's output before crash: # #…
kol
  • 27,881
  • 12
  • 83
  • 120
7
votes
1 answer

Reverse-engineering SEH: Why doesn't my IDENTICAL assembler code work like the original?

I'm trying to reverse-engineer the Visual C++ 2008 SEH handler named __CxxFrameHandler3 to provide an implementation which can delegate the result to (the older version of) __CxxFrameHandler in msvcrt.dll. (This page and this page have great details…
user541686
  • 205,094
  • 128
  • 528
  • 886
7
votes
3 answers

intermixing c++ exception handling and SEH (windows)

I have a function in which I call getaddrinfo() to get an sockaddr* which targets memory is allocated by the system. As many may know, you need to call freeaddrinfo() to free the memory allocated by getaddrinfo(). Now, in my function, there are a…
Juarrow
  • 2,232
  • 5
  • 42
  • 61
7
votes
2 answers

What are the consequences of mixing exception handling models in Visual Studio 2010?

I have third-party static library built with Enable C++ Exceptions set to No (/EH flag not specified). What are the consequences to calling into it from code built with C++ exceptions enabled (/EHa)? If a Structured Exception is thrown from within…
Scott
  • 766
  • 7
  • 20
7
votes
2 answers

How to generate stack trace from SEH exception

I am catching an exception using Win32 SEH: try { // illegal operation that causes access violation } __except( seh_filter_func(GetExceptionInformation()) ) { // abort } where the filter function looks like: int…
M.M
  • 138,810
  • 21
  • 208
  • 365
1
2 3
11 12