-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
CoreCLR runtime doesn't work on Linux kernel 4.6.x #6220
Comments
It looks like the problem is caused by the thread suspend injection on Unix. Disabling it by setting COMPlus_INTERNAL_ThreadSuspendInjection environment variable to 0 makes the issue go away. |
I have also tried to install older versions of the kernel to see when exactly the issue started to happen. The 4.6.0 was the first version with this problem. |
Is this SIGSEGV directly related with any specific system-call or kernel-userspace ABIs? If we have a short and simple example code to reenact the bug, we might be able to let the linux kernel fix the issue if this is a regression in the kernel, not a bug of coreclr. |
I have just found the culprit - it is a bug in coreclr that didn't show up on older kernels. The issue is that when we translate unix context to the windows style context in CONTEXTFromNativeContext / CONTEXTToNativeContext on AMD64, we also translate the "CS" - code segment - register. But the macro to access the register in the unix context for AMD64 is defined as follows:
After the restore:
I have also found why it didn't show up on the older kernels. When running e.g. on the kernel 3.13 that's the default kernel for Ubuntu 14.04, the FS and GS values are both zero. |
FYI: @adityamandaleeka |
A small correction - the FS and GS are still zero on the newer kernel, but the topmost 16 bits that are marked as padding in a linux header are not. It can be seen from the values I've dumped above, I just said by mistake that the issue was in clearing the FS and GS. Obviously, the new kernel uses those 16 bits for something. |
I was looking through the changes in the 4.6 kernel and noticed this commit which replaced the padding field in the sigcontext with a union of padding and SS. |
Fixed by dotnet/coreclr#6027 |
…016. Corresponds to dotnet#6611 [tfs-changeset: 1621298]
…016. Corresponds to dotnet#6611 [tfs-changeset: 1621298]
…016. Corresponds to dotnet#6611 [tfs-changeset: 1621298]
Fixes #6016. Resolves dotnet#6015. Signed-off-by: dotnet-bot <[email protected]>
Fixes #6016. Resolves #6015. Signed-off-by: dotnet-bot <[email protected]>
We get SIGSEGV in the GC when trying to allocate managed objects.
The text was updated successfully, but these errors were encountered: