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
r274162 (SafeStack) causes cryptographic code to miscompile #31491
Comments
It sounds like the revision that regressed that was in 3.9 too, so it's not a regression and too late for 4.0. I'll change it to be a 4.0.1 blocker instead. |
Do we have a fix for this yet? |
No. Let's just disable this optimization for now. |
Can you write a patch for this? |
Yes, I'll do it. I'm having issues with libc++ tests right now, but I'll get to it later today. |
Coloring disabled in r303456. |
Merged: r303687 |
This was disabled in 2acea27 as a work-around for Issue #31491. I've reduced the test case from that bug and confirmed that it is now fixed. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D120866
Extended Description
CloudABI is a runtime environment based on a subset of POSIX that allows for strong sandboxing. CloudABI uses Clang as its C/C++ compiler with LLVM's SafeStack enabled by default.
One of the lead developers of Bitcoin, Wladimir van der Laan, is currently working on getting Bitcoin Core ported over to CloudABI:
https://laanwj.github.io/2017/03/02/porting-bitcoin-core-to-cloudabi.html
In the process, he discovered that some of Bitcoin's unit tests tend to fail when SafeStack is enabled. He observed this when using LLVM/Clang 4.0-rc2:
NuxiNL/cloudabi-ports#30
I've done some bisecting and discovered it's caused by SVN r274162:
270000 ok
272500 ok
273750 ok
274062 ok
274140 ok
274160 ok
274161 ok
274162 bad
274163 bad
274165 bad
274170 bad
274179 bad
274218 bad
274375 bad
275000 bad
280000 bad
296985 bad
Attached you can find a source file of a reduced test case that should build both on CloudABI and non-CloudABI. When built with SafeStack enabled and -O2 or higher set, it will call abort(). When built without SafeStack or when using lower optimisation levels, it will print "O.K." and terminate successfully.
I will add this as a blocker for 4.0.
The text was updated successfully, but these errors were encountered: