-
Notifications
You must be signed in to change notification settings - Fork 586
Libsnark get_evaluation_domain works on macOS #1419
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
| #include <libff/common/double.hpp> | ||
| #include <libff/common/utils.hpp> | ||
|
|
||
| #include <execinfo.h> |
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.
unneeded
|
|
Before this change on macOS systems, libsnark would crash on get_root_of_unity and exception handlers would not work. The hypothesis is that using exceptions for control flow in get_evaluation_domain triggers some sort of UB (probably because this runs statically before the main function). On Linux, the UB happens to work properly, but on OSX it doesn't. As such, I rewrote all the control-flow related exception handling in get_evaluation_domain to use an error bool pointer. I'll open a PR against libsnark directly when the review for this PR finishes.
52fc59f to
5b8b806
Compare
|
There are ways to avoid initializing those fields on exit paths, but the code is already there, and it's the FieldTs that are expensive anyway. I'm fine with it. Thank you for not letting uninitialized data escape. |
|
Dredging this back up as it's relevant again for me.
Yup, that's the problem. It's preventing two things in a different project:
It seems no pull requests are getting merged into libsnark, so will have to fork and apply this to my branch. |
Before this change on macOS systems, libsnark would crash on
get_root_of_unity and exception handlers would not work. The
hypothesis is that using exceptions for control flow in
get_evaluation_domain triggers some sort of UB (probably because this
runs statically before the main function). On Linux, the UB happens to
work properly, but on OSX it doesn't. As such, I rewrote all the
control-flow related exception handling in get_evaluation_domain to use
an error bool pointer.
I'll open a PR against libsnark directly when the review for this PR
finishes.
On macOS the Coda build succeeds only after these changes are made (as
we use libsnark at compile time). CI will tell us that the build still
works on Linux.