-
Notifications
You must be signed in to change notification settings - Fork 463
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
Call Keccak_(X4_)Dispatch with pthread_once #1549
Conversation
@zxjtan will you be continuing to work on this? |
@dstebila I have no experience writing Win32 code, but I can try my hand at making it cross-platform if there are reviewers who can check that I am writing it idiomatically. |
@zxjtan OQS already has code parts that are not optimized for Win32. In other words, it'd be beneficial to see |
@baentsch Sure, I can gate the pthread functionality and pass the CI quite soon. |
45b6cad
to
c3da910
Compare
CI still runs into |
Well, that depends on which lib is supposed to hold this symbol: It seems, glibc2.28 doesn't/isn't C11 compliant. What about using pthreads (i.e., pthread_once instead? Then linking in |
No dice, build still fails with |
I'd say so: That's what I meant with
Sorry for being imprecise. So, I'd think one option may be to lift the "pthreads-availability" test logic you correctly built in to the source code to |
9fdb552
to
b32a437
Compare
4dc6f09
to
d7f7988
Compare
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.
Code LGTM. The only slight concern I have is that this seems to add pthreads as a requirement to liboqs
(and hence, its users). Have you tested that this new code works OK if used by a downstream project, @zxjtan ?
Thinking that through, what about adding CI to liboqs
automatically validating this property with downstream projects we consider essential, @dstebila ? Or would this create a hen-and-egg situation where downstream projects' status (of not being ready for an liboqs
update) can break liboqs
CI and hence stop the whole procedure? Let me create a separate discussion for this...
I don't think it does. I think of it not as a requirement but an environment fix: if you are running on a platform with threading, and if that threading model is
Yes, I have used this code in a project and it fixes the race condition. |
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.
LGTM. Thanks for the contribution! @dstebila This is one more item to be added to the "Windows ToDo" list (as and when we start it per https://github.com/orgs/open-quantum-safe/discussions/1583.
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.
This looks good to me too! Taking a brief look at the Win32 API the fix will likely look very similar, but it seems the biggest obstacle will be finding someone with a Win32 machine to implement the fix :-)
@zxjtan Thanks again for the contribution; it turned out it causes a failure in one downstream integration: https://app.circleci.com/pipelines/github/open-quantum-safe/oqs-demos/1046/workflows/e474db0c-43e2-4628-b634-23b9f3b5d95a/jobs/5979. Does this ring a bell? At first glance this should work as |
The |
I don't think so: This doesn't change (presence of)
This configures the OpenSSL installation within I see two ways out of this:
For 1) I am out of my depth (having to ask the original contributor @igorbarshteyn for help/advice); 2) would require a Any other options? We could of course also completely discontinue support of the QUIC demo as it is based on unsupported software (OpenSSL111). The more I think about this, the more I like it. Several people have voiced willingness to help on open-quantum-safe/oqs-demos#182 but nothing has been forthcoming. And OpenSSL111 by now is EOL. Thus I think we should sunset this PQ-OpenSSL1-QUIC integration. |
Fixes #1548.
Call Keccak_(X4_)Dispatch using pthread_once to ensure setting of global function pointers is atomic and done only once.