-
Notifications
You must be signed in to change notification settings - Fork 846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sched_setaffinity failure #968
Comments
Thanks Eric. WSL currently does not fully support |
Thank you @ericeil for reporting the issue with repro steps. I don’t see any sched_setaffinity calls, only sched_getaffinity calls (succeeding). What exactly is System.Diagnostics.Process.set_ProcessorAffinityCore(IntPtr value) trying to do? |
The Linux implementation of |
Thanks for the sources! I have fixed it to match Ubuntu behavior more closely now and the test is passing. However I came across something interesting. When sched_setaffinity actually gets called, the mask passed down isnt just set for the first processor, but for the 1st and 33rd. The mask passed down starts with: 0x00000001`00000001 (000100000000000000000000000000000001 in binary) It is right at the edge of int32 and int64 and it looks like a possible bug to me on the C# side, since we are setting 1 here. Prior sched_getaffinity call returns 1...Am I missing something here? Looking at the code, I am slightly suspicious of this piece of code, whether it does what we think it does: if ((bits & static_cast<intptr_t>(1u << cpu)) != 0) It might be interesting to see the assembly generated for the bitshift here. If operator << behaves more like a rotation (and 1u is 32bit...), then that 1 on 33rd position would make sense. |
On rs_preview build 14905:
Replace Program.cs with the following:
On "real" Linux, this runs to completion. On Windows, I get a failure:
ProcessorAffinityCore
is callingsched_setaffinity
, which apparently fails.The text was updated successfully, but these errors were encountered: