-
Notifications
You must be signed in to change notification settings - Fork 385
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
Test failures on big endian architecture. #446
Comments
Assume fixed by #445, thanks! |
Is it possible to get safe access to a VPS with this arch to fix this issue? This looks like an endianness issue. See the errors like |
I assume it's in large part due to a lack of conditionality in the endian On Sun, Aug 21, 2016, 1:19 AM RojavaCrypto [email protected] wrote:
|
@RojavaCrypto i am not aware of any public access to any big endian systems. E.g. powerpc (32bit, big endian) or the s390x (64bit, big endian). Whilst arm64 is wide spread, and hardware has support for arm64be - nobody has a linux port for arm64be, everyone does little endian only. |
It appears I was wrong as to the involvement of the to_ and from_ endian functions as for the most part they rely on bit shift operators which should provide platform independence. I've corrected what looks to be an oversight I made there w.r.t. endianness, but doubt it has much to do with the failures seen. |
Looking at the test failures, these are the most interesting:
Notice that all of the BE tests succeed, as do some of the LE tests. Unfortunately Boolean boost macros are used in these two tests, instead of integer value macros, so we can't see detail of the failures. I've created a PR to address this issue and better factor and standardize the endianness tests. One of the three LE stream tests succeeds but it is a negative test with no value comparison - the output of its |
Based on the objectives of simplicity and full test coverage, the SHA1 and RIPEMD160 implementations have been replaced with architecture-independent implementations. Given that tests in these implementations were failing in this platform, this should also provide resolution for that part of the issue. |
A problem of invalid (overflowing) test data in the script_number implementation has been resolved by #459. The implementation has been modified to handle the full |
There are no known outstanding test failures or identified issues pertaining to endianness. Given that we do not have a BE test platform we await feedback. |
Testing with 4beb7cc i still see thousands of failures, and there are still failures in e.g. script tests... the en/decoding still doesn't appear to take into account endiannes, either the testsuite expected output (false negatives) or the code itself (true failures) Will attach test.log in a moment. |
@xnox Thanks for re-running the BE tests. The number of failures is not indicative of the number of code errors. The script_number failures all results from one test, whereby the test iterates through a large amount of reference data. We try to avoid these types of non-isolating tests but many remain. The code does (and previously did) take into account endiness. The problem is that the BE implementations are not regularly tested, and untested code is broken code. There are two ways to account for endinaness: (1) Make architecture-aware code for each supported architecture, detect the architecture at compile time and switch code paths. The previous implementation was mostly architecture independent, but had two hash functions that were not. It was clear that, at least in this case, the architecture detection was not working. Given that this technique implies the code will not be tested on our current CI system, I changed out the two hash functions for architecture independent implementations. This was successful, there are no longer failures in There was also unintended architecture dependence in one of our endian functions, which was changed to architecture independent. These Consequently all of the previous
This is causing failures in all serializable types (including different failures than before in I'm fairly certain that all of the remaining failures result from the (new) |
It turns out that the |
Over at https://launchpad.net/ubuntu/+source/libbitcoin/2.11.0-1build1 the test-suite fails on arm64, armhf, ppc64el, s390x - which is a mix of big/little endian and 32bit/64bit platforms that are all non-x86. Seems like there is some x86-ish assumption somewhere. I'll figure out how to test/integrate these. I thought there were CI things that can hook into github and build stuff on non-x86. |
@xnox The results show a test failure (not a compile failure) on three of the five little-endian (ppc64el) and bi-endian (arm64, armhf) platforms . This is a distinct issue from this compile issue, and probably not endianess-related. Without the test log we cannot resolve the issue, but I am aware of people building successfully for ARM. Again, untested means broken, and we don't currently have ARM or PPC in our test matrix. Please create a new issue for these. The (remaining) powerpc and s390x failures are big-endian-related compile failures, but given these are in version 2.x that is unsurprising. We have been applying fixes to v3.x (master) only. In fact the error that you patched is the one exposed: #if SHA1_BIG_ENDIAN
Once we have the endianess issues resolved we may decide to backport to v2.x but presently all work is in 3.x. It would be most helpful if you could provided s390x build output from the latest master. I am expecting to see only script_number failures at this point. |
I just resolved an endian bug in master (v3). Conversion of hash values to Having reviewed the entire code base at this point I do not believe there to be any remaining endian bugs, but I have no platform to test on, so will leave this open. |
@xnox Any change you could give us another test run on big endian. We made a last fix but haven't been able to validate it and are tagging the v3 release this week. Thanks! |
@xnox Thanks for this feedback. We'll give it another look. This would be simple if we had a machine of our own to test on :/ |
@xnox I augmented the logging. If you wouldn't mind, the output could be helpful and much appreciated. |
@evoskuil i have none to give out =/ i'm not sure if there are any big endian emulators / virtual machines that one can run. |
No worries, once we get this I think we'll be able to maintain it. |
Recent check-ins should reduce failures to those exposed by elliptic_curve.cpp. They appear to be an issue within secp256k1. I've opened the following issue: bitcoin-core/secp256k1#442 |
Given the comments on the referenced issue it would be a good idea to execute the full libsecp256k1 test suite on the problem platform. |
TODO: add a compiler warning due to lack of CI testing on BE architecture.
http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html |
Add CI support via Travis: syscoin/syscoin@8a4438f |
Note that the bug opened against libsecp256k1 was closed as 'spurious' given that the values passed in the independent tests are opaque. In other words, it's a test issue, which makes sense, and should be easily resolvable. |
s390x is 64bit big endian.
test.txt
The text was updated successfully, but these errors were encountered: