-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-31904: fix signalmodule issue in VxWorks #12670
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
Conversation
The type of sig_atomic_t is 'unsigned char' in VxWorks, so it can't be assigned to -1, so I set the type of fd in struct 'wakeup' to 'int' for VxWorks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fd
member is clearly meant to be a file descriptor, which is of type int
(as specified by POSIX). So the old code is unconditionally wrong: you should use int
on all systems, not just VxWorks. This happened to work because sig_atomic_t
is int
on almost all systems.
@@ -0,0 +1 @@ | |||
fix VxWorks signalmodule issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather frame this as a general bug-fix and not a VxWorks-specific issue.
Now that you're correctly using |
Thanks for your comment, now the fd is not atomic, do you mean I also still use _Py_atomic_load() or _Py_atomic_store() to read/write it ? Thanks very much |
Please open a separated issue for this change. |
Yes, I think so. You'll find many uses of these functions in |
The easiest way to fix VxWorks but not impact other operating systems if to modify your PR as, pseudo-code:
|
The existing code is unconditionally wrong: it's a file descriptor, which is of type |
I already asked "Please open a separated issue for this change." but nobody did that. |
I know but that doesn't imply that the existing code is correct. It only means that nobody cares enough to open an issue. |
In case of doubt, I'm ok to leave the code unchanged: that's the safest option. That's the principle of https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence To remove the fence, someone must first investigate why it's there. This issue is about VxWorks. I disagre that adding VxWorks support would change the code on other platforms. |
Let's continue the work on PR #23391. |
The type of sig_atomic_t is 'unsigned char' in VxWorks, so it can't be assigned to -1, so in the signalmodule.c. I set the data type of fd in struct 'wakeup' to 'int' for VxWorks.
More and full support on modules for VxWorks will continuously be added by the coming PRs.
VxWorks is a product developed and owned by Wind River. For VxWorks introduction or more details, go to https://www.windriver.com/products/vxworks/
Wind River will have a dedicated engineering team to contribute to the support as maintainers.
We already have a working buildbot worker internally, but has not bound to master. We will check the process for the buildbot, then add it.
https://bugs.python.org/issue31904