Enable Win32 SEH by default
Original Reporter info from Mantis: Andrey Paramonov
-
Reporter name: Andrey Paramonov
Original Reporter info from Mantis: Andrey Paramonov
- Reporter name: Andrey Paramonov
Description:
FreePascal 3.0 introduces reworked exception machinery on Windows x86-64 (using SEH), which fixes numerous bugs:
0024012: Enable Win64 SEH by default so exceptions in DLLs can properly be caught.
http://bugs.freepascal.org/view.php?id=24012
Similar problems existed on Windows x86, and similar patch is available for this platform:
0025363: win32 per thread SEH implementation.
http://bugs.freepascal.org/view.php?id=25363
However, the latter patch is only available under non-default FPC compiler option. The commit message is:
+ SEH support for Win32. Enable by cycling with OPT=-dTEST_WIN32_SEH.
Although basic things work (no regressions in test suite, also with TEST_OPT=-O2), there are some secondary issues/TODOs:
- Exception frame around PASCALMAIN is not properly removed in DLLs
- No stack traces yet
- Stack overallocated in finalizer procedures, their entry/exit code needs cleanup
- Signals unit is probably completely broken.
It is proposed that remaining issues are investigated and fixed/discarded, so Windows on x86 could benefit from SEH exceptions being on by default.
Mantis conversion info:
- Mantis ID: 28756
- OS: Windows
- Platform: x86
- Version: 3.0.0
- Fixed in version: 3.2.0
- Monitored by: » @marcoonthegit (Marco van de Voort), » Cyrax (Cyrax), » AntonK (Anton Kavalenka)
- Target version: 3.2.0