Fibers and cygtls

David McFarland corngood@gmail.com
Wed Dec 22 15:46:01 GMT 2021


David McFarland <corngood@gmail.com> writes:

> This seems to match what I'm seeing. The boost unit tests fail with
> ucontext, seemingly because the exception handlers are wrong after
> switching contexts. They pass using fcontext, but only if I apply the
> TLS patches I shared here:
>
> https://cygwin.com/pipermail/cygwin-developers/2020-September/011970.html

ucontext appears to have the opposite problem as the other fiber
implementations (boost fcontext, windows fibers).  The TIB StackBase and
StackLimit are never changed, so cygtls is still accessible, but windows
stuff (including exception handling on x64?) is broken.

It's possible it could be fixed by storing cygtls in windows TLS, and
setting StackBase/Limit in setcontext.


More information about the Cygwin-developers mailing list