Unhandled exception when using w32 fiber API
Original Reporter info from Mantis: Andrey Paramonov
-
Reporter name: Andrey Paramonov
Original Reporter info from Mantis: Andrey Paramonov
- Reporter name: Andrey Paramonov
Description:
I'm trying to implement coroutine class using w32 fiber API (see http://msdn.microsoft.com/en-us/library/ms682661.aspx). In the attached minimal example worker fiber is created. GetNext procedure is called from caller (outer) fiber and switches execution flow into worker (inner) fiber, while Yield is called from the worker fiber and switched back into caller fiber. An exception is thrown inside worker fiber which should be always caught by try-except statement (program should output "Gotcha"). However, exception is unhandled.
Steps to reproduce:
fpc fiberdemo.lpr
Free Pascal Compiler version 2.6.2 [2013/02/12] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling fiberdemo.lpr
Linking fiberdemo.exe
87 lines compiled, 0.1 sec , 61104 bytes code, 13180 bytes data
fiberdemo.exe
exception at 00401888:
Test.
Additional information:
Code compiles and runs on Delphi just fine:
fiberdemo.exe
Gotcha
Mantis conversion info:
- Mantis ID: 25312
- OS: MS Windows 7
- OS Build: 7
- Build: 2013/02/12
- Platform: w32
- Version: 2.6.2
- Monitored by: » Andrey Paramonov (Andrey Paramonov), » Vincent (Vincent Snijders), » Cyrax (Cyrax), » parcel (Do-wan Kim)