Segfault with ucontext on macOS (#184, continued)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- build-system, operating-systems
Research direction
Start with Boost.Context’s fibonacci example and reproduce the macOS segfault when standard C++ headers precede boost/context/fiber.hpp. Inspect how Boost.Context’s build exports compiler definitions, then verify that clients receive _XOPEN_SOURCE and the example no longer segfaults.
Written by the indexing model from the issue text.
Description
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 <boost/context/fiber.hpp> 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.
- Dominant language
- Assembly
- Stars
- 371
- Forks
- 185
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/context
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Support for the PAC Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in boostorg/context
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
Bug v3
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
Builders
Difficulty 2/5 1-3 hours Newbie friendliness 72/100