-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fix VDF prover failures on Windows #216
Conversation
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 memory leak is in a test, so not a big deal probably.
It might deceive a future reader of the code though
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.
technically it should be delete[] ba.data;
, but I was also under the impression that we had a function to free a ByteArray
object. mostly just to ensure we use the correct heap in case this is exported over a DLL boundary.
A minor issue though.
The root issue is that labs() was being used instead of llabs(). labs() is undefined (on windows only apparently) if the value tested is too large. This was causing the Pullmark reducer to misbehave and reduction not to happen correctly in rare cases. That resulted in too large values and sometimes buffer overflows causing heap corruption in some cases. In the process fixed some other things the compiler was not happy about but doesn't really affect the behavior.