-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TestPacketDataStream fails on ARM64 #3845
Comments
Added reference to missing make check mentioned in #3846; should be enabled once this is fixed. |
As I see it, the test is back in place... |
It's not, tests are not run for the ARM64 build. |
In addition to arm64 (aka aarch64), I see the same failure with s390x and ppc64le. Only x86_64 passes as far as I can tell. |
Presumably this class relies on something like the size of an integer being exactly x bytes or something like this 🤔 |
All of the arches which fail have unsigned char, so that's it I think. Either use a different type, cast it, or -fsigned-char should be added to the build system. |
I fail to see why this would be a problem other than perhaps causing compiler warnings. But to my understanding signed and unsigned char should be of the exact same byte size 🤔 |
The function used in the test behaves differently depending on whether the variable is signed: Lines 140 to 192 in 73d8a4d
Lines 40 to 50 in 73d8a4d
Line 34 in 73d8a4d
|
How does Line 143 in 73d8a4d
really check for the type of the variable passed? I would have interpreted as if it was merely checking whether the first bit is set, which afaik indicates a negative number, if the respective type is signed and has no special meaning for unsigned types 🤔 At least that's what I believe the first part does. What the second part with the inverted bits is trying to accomplish, I don't quite get 👀 |
If you want to avoid having to mess with the existing logic, you can build with |
We can use |
I still fail to see how the issue can be in the variable's type. We're only testing its binary layout (the set bits) and afaik that doesn't change between signed and unsigned types 👀 |
In the meantime, would be possible to republish the last working version for aarch64 (for the docker image). |
From #5943 (comment):
|
I do not know much C++, but in C the following test.c illustrates the behavior: #include <stdio.h>
int
main(){
char c = -2;
printf("%hhx\n", c);
// promoting a datatype retains sign
printf("%hx\n", c);
printf("%x\n", c);
return 0;
} x86_64 $ gcc -o test test.c aarch64 $ gcc -o test test.c x86_64 $ gcc -fsigned-char -o test test.c aarch64 $ gcc -fsigned-char -o test test.c To be more clear, this is happening in PacketDataStream.h: PacketDataStream &operator<<(const quint64 value) {
PacketDataStream &operator>>(quint64 &i) { looking at the test, we see the following: PacketDataStream out(buff, 1);
char val = -2;
out << val; On x86_64, signed char is converted quint64, which includes the conversion from signed to unsigned. |
@boletus-edulis thanks for the illustration! I think that finally cleared things up for me. Especially in addition with the chat I had with @davidebeatrici about this this morning, where I/we realized that even though Lines 143 to 144 in 73d8a4d
Combined with the fact that the conversion from signed to unsigned makes the difference that it makes (in particular whether we convert the signed value to |
TODO: Make use of https://github.com/Krzmbrzl/cmake-compiler-flags to set the compiler flags to ensure signed chars on all platforms. |
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
This eradicates some platform differences Fixes mumble-voip#3845
[[PGP Signed Part:No public key for 3DECC105F5DD2382 created at 2024-10-28T20:22:22+0100 using RSA]] TestPacketDataStream failed to pass for aarch64 under 1.4.287 as described in <mumble-voip/mumble#3845>. The new release fixes that. The new version changes some bundled dependencies. Some of them are only kept during the build for the sake of generating the text shown for third-party licenses under the "About" dialog. * gnu/packages/telephony.scm (mumble): Update to 1.5.634. [source]: Update 3rd party dirs kept during build. [arguments]: Update build options for bundled dependencies. [inputs]: Depend on OpenSSL 3 and N. Lohmann's JSON lib. [license]: Update licenses for bundled dependencies. Change-Id: I39498ffa143e4416b06a6aa1a31fd46cd0ba2e3b Signed-off-by: Ludovic Courtès <[email protected]>
mumble/src/tests/TestPacketDataStream/TestPacketDataStream.cpp
Line 124 in bafcf47
Once this is fixed as per #3846 the travis build make check should be enabled.
The text was updated successfully, but these errors were encountered: