OpenHFT / OpenHFT/Java-Thread-Affinity
LinuxHelper.sched_getcpu() uses wrong syscall number: 318 (getrandom) instead of 309 (getcpu) on x86_64
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
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.
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.
Research direction
Start in LinuxHelper.sched_getcpu(), specifically the UnsatisfiedLinkError fallback that calls lib.syscall. Check the x86_64 syscall numbers against the issue description, update the fallback to use the getcpu number, and verify that the fallback invokes getcpu rather than getrandom.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100