boostorg / boostorg/context

Segfault with ucontext on macOS (#184, continued)

未关闭
#238 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Assembly
星标
370
派生
186
平均合并
24 天 6 小时
30 天内合并 PR
1

描述

Although #213, accepted in #184, did apparently fix part of the problem, Boost.Context's own example programs still segfault due to the `_XOPEN_SOURCE` issue described in that pull request: if a Boost.Context client includes (for example) a standard C++ header before a Boost.Context one, `_XOPEN_SOURCE` is not defined when the `ucontext` struct is defined, resulting in its definition having fewer fields than when `_XOPEN_SOURCE` is defined, as Boost.Context expects it to be. Thus the segfault.

For example, I fixed the *fibonacci* example's segfault by moving `#include ` above the inclusions of the stdlib headers.

Seems like the best workaround at this point is to export `-D_XOPEN_SOURCE` to clients from Boost.Context's build.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。