Illegal instruction crash in libsodium on Raspberry Pi Armv8 #1362
Replies: 4 comments
-
Just wanted to confirm, now I have a raspberry Pi in front of me, that the build of libsodium provided in the nuget package; i.e. built with:
Results in a binary that assumes ARM AES is available, even though it is not. GDB confirms crash occurs in |
Beta Was this translation helpful? Give feedback.
-
From what I can tell, if |
Beta Was this translation helpful? Give feedback.
-
For any .NET consumers finding this, you can check for AES Cpu flag availability with |
Beta Was this translation helpful? Give feedback.
-
Should be fixed now, including in |
Beta Was this translation helpful? Give feedback.
-
Hi, me again, afraid I found a different illegal instruction crash, this time on linux-arm64, only on a Raspberry Pi ARMv8.
The libsodium binary is from the nuget package, so was built with:
Currently trying to determine exact crash location, it happens much later in our code than the prior problem on x64, but suspect it's in the ChaChaPoly implementation, or possibly in the AES path if AES support is being incorrectly detected as "supported".
The failing device has the following CPU profile:
As you can see, clearly no aes flag.
The binary works fine on an ARM64 device with the following profile:
From what I can determine from the libsodium source, the build provided does AES detection at runtime against the CPU flags; we call
crypto_aead_aes256gcm_is_available
before using AESGCM, falling back to ChaChaPoly. My guess is either that it's continuing down the AES path becausecrypto_aead_aes256gcm_is_available
is returning true unexpectedly, or there's some issue with ChaChaPoly on that CPU.Any thoughts @jedisct1?
Beta Was this translation helpful? Give feedback.
All reactions