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
5
votes
1 answer

What's the best way to deliberately crash my Windows application?

I've added a mini-core-dump feature (via __try/__except and MiniDumpWriteDump()) to the Windows build of my Qt application, so that if/when my application ever crashes, a .dmp file will be written out to disk for me to look at and debug with later…
Jeremy Friesner
  • 70,199
  • 15
  • 131
  • 234
5
votes
3 answers

Exception in WindowProc

Is it possible to catch error inside WindowProc callback? try / catch doesnt work. Looks like __try __except and also hardware exception (AV, for example) doesnt work also. Update: I figured out that indeed this is possible to throw exception in…
Demion
  • 857
  • 1
  • 14
  • 27
4
votes
1 answer

SEH setup for fibers with exception chain validation (SEHOP) active

I'm working on a native fiber/coroutine implementation – fairly standard, for each fiber, a separate stack is allocated, and to switch contexts, registers are pushed onto the source context stack and popped from the target stack. It works well, but…
dnadlinger
  • 5,883
  • 4
  • 21
  • 24
4
votes
2 answers

Structured Exception Handler (SEH) does not catch heap corruption

I'm writing small utility (VC 2010, no clr) that does one simple task (rasterizing) using 3rd party library. Later utility will be used by bigger application. Sometimes the utility crashes because of some heap corruption in 3rd party library. That…
AC.
  • 714
  • 8
  • 27
4
votes
4 answers

Stack unwinding in case of structured exceptions

This question provides more clarity on the problem described here. I did some more investigation and found that the stack unwinding is not happening in the following piece of code: class One { public: int x ; }; class Wrapper { public: …
aJ.
  • 34,624
  • 22
  • 86
  • 128
4
votes
1 answer

`LoadLibraryExW` triggers exception `0xC0000023` from `NtMapViewOfSection`

It's going to be really hard to reduce the scope of this question, but here we go. Context I'm in the context of a 32-bit ActiveX control which is loaded into a host (TstCon.exe). After unloading and reloading the control, I receive a streak of…
Quentin
  • 62,093
  • 7
  • 131
  • 191
4
votes
0 answers

How to use SEH in 64-bit assembly with MASM64?

I'm trying to learn how to use structured exception handling (SEH) in a 64-bit Windows executable compiled with MASM64. So far, let's take this simple example. My test goal is to suppress invalid operation exception in this…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
4
votes
0 answers

How to find the type_info symbol without using /export (for unit tests)

Context: We've implemented SEH/C++ exception handing in LLVM some time ago, to make our JIT'ted code compatible with native exceptions. As part of the exception handling code generation, internal information about type_info is necessary, because…
atlaste
  • 30,418
  • 3
  • 57
  • 87
4
votes
2 answers

Issue with exceptions being caught by Win32 message dispatcher

This is kinda a very low-level type question, but maybe someone here has some insight... I'm having an issue where unhandled SEH exceptions (such as Access Violations) are seemingly being caught at the Win32 message dispatch level, rather than…
Nick
  • 6,808
  • 1
  • 22
  • 34
4
votes
1 answer

Procdump -e creating dumps on non-fatal exceptions

I've always considered myself to be reasonably experienced with capturing dumps, but this one has really confused me. I have a .net process which is crashing periodically ... I don't know what it's crashing on, whether it's crashing in native or…
another_one
  • 356
  • 4
  • 13
4
votes
1 answer

C# dllimport throws SEHException when called by Process.Start

I have a 32 bit dll that I need to be called from a 64 bit .NET Core Application. My method to do this is to create a 32bit console App that basically looks like this: [DllImport("x.dll", CharSet = CharSet.Ansi, CallingConvention =…
binderbound
  • 791
  • 1
  • 7
  • 27
4
votes
0 answers

What exception handling model does the Clang x64 Windows compiler use?

I've just downloaded the 3.7.1 LLVM for Windows x64 (from here), and I was wondering if the clang++ inside this uses SEH exception handling or SJLJ, or something else? In particular, I believe SEH is the best on Windows for dealing with C++…
user62177541
  • 368
  • 3
  • 14
4
votes
3 answers

Structured exception handling with a multi-threaded server

This article gives a good overview on why structured exception handling is bad. Is there a way to get the robustness of stopping your server from crashing, while getting past the problems mentioned in the article? I have a server software that runs…
Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
4
votes
1 answer

How does this asm code setup SEH?

I grabbed some code from internet, that supposed to handle exceptions with SEH, ASSUME FS:NOTHING PUSH OFFSET Handler PUSH FS:[0] MOV FS:[0], ESP ... But the FS:[0] should be holding the address of handler instead right? So mov…
daisy
  • 22,498
  • 29
  • 129
  • 265
4
votes
1 answer

About assembler far calls and the heaven's gate, do segment calls that trigger an exception push cs and eip BEFORE the exception is thrown?

Currently i'm playing with the windows/WOW64 trick known as "the heaven's gate", which, as some of you will probably know, allows us to enter x64 mode even though in a x86 program (i was so amazed when i tested it and it worked!) But i know it is…
nts94
  • 41
  • 3
1 2
3
11 12