在vintage/context/test_swap.cpp中的raw_thread函数打印浮点数时,会segmentation fault
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- operating-systems
Research direction
Start in vintage/context/test_swap.cpp at raw_thread and the ctx_swapcontext calls. Reproduce the crash when printf formats the float, then compare the custom context swap with the POSIX ucontext behavior and inspect the FPU environment handling noted in the issue. Done means the floating-point print returns without a segmentation fault.
Written by the indexing model from the issue text.
Description
可如下复现:
int raw_thread(voidp) {
float pi = 3.14;
printf("remote: hello %s\n", (char)p);
ctx_swapcontext(&cc, &mc);
printf("remote: back again\n");
ctx_swapcontext(&cc, &mc);
printf("remote: return, %f\n", pi);
return 1024;
}
切换为posix ucontext系列函数不会core。
从glibc源码看,都使用的FNSTENV保存FPU的环境信息;
gdb 查看,core在printf中:
movaps %xmm0, 0x50(%rsp)
- Dominant language
- Python
- Stars
- 43
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 skywind3000/collection
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
All issues in skywind3000/collection
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Maintainers usually reply within 1 day
-
Memory leak: the shared `validation_aborted_error` keeps every traceback it is raised throughPossibly taken @Fire162 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
graphql-python/graphql-core#287 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
roman-corgi/ctc-dip#160 ·
Maintainers usually reply within 1 day
-
type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
render_findings.py reads and writes in the host's default encoding, so findings.html breaks on a cp1252 Windows hostPossibly taken @Aaqibhafeezkhan claimed this today. Openbug good first issue mentored python size: XS up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dheerajjha/mcp-migrate#366 · 1 comment ·
Maintainers usually reply within 1 day