OpenHFT / OpenHFT/Java-Thread-Affinity

LinuxHelper.sched_getcpu() uses wrong syscall number: 318 (getrandom) instead of 309 (getcpu) on x86_64

未关闭 适合新手
#203 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
1.9k
派生
367
PR 合并指标
30 天内没有已合并 PR

描述

In LinuxHelper.sched_getcpu(), the fallback path calls lib.syscall(318, cpu, node, null) intending to invoke getcpu. However, on x86_64 Linux:

__NR_getcpu = 309
__NR_getrandom = 318
So the code is actually invoking getrandom(2) with incorrect arguments rather than getcpu(2).

Location: net.openhft.affinity.impl.LinuxHelper, method sched_getcpu(), in the UnsatisfiedLinkError catch block.

贡献指南

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

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 LinuxHelper.sched_getcpu() 开始,具体检查调用 lib.syscall 的 UnsatisfiedLinkError 回退逻辑。根据 issue 描述检查 x86_64 的 syscall 编号,更新回退逻辑以使用 getcpu 编号,并验证回退逻辑调用的是 getcpu 而不是 getrandom。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
operating-systems
Issue 类型
缺陷
难度
1/5
预计耗时
1 小时以内
活跃度
冷清
描述清晰度
描述清楚
新手友好度
68/100

把新 issue 发到你的邮箱

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