32-bit Linux support
Problem
The signet client compiles for i386, and it does launch successfully, however, after entering the unlock password, it crashes with an illegal instruction.
Environment
- Dell D610
- Intel Pentium M 1.60GHz (32-bit)
- it does have
mmx
extensions according to /proc/cpuinfo - and
sse
andsse2
- it does not have
sse4_1
norsse4_2
- it does have
- 1.5GB RAM
- Debian 11 (i386)
- LXDE
Details
After installing gdb, I was able to get the stacktrace. It's crashing in the _crypto_scrypt
function. We get there from SignetApplication::generateScryptKey()
, which was called from SignetApplication::generateKey
. The library function we're calling is crypto_scrypt
.
The literal instruction that is crashing is: pextrd DWORD PTR [esp+0x4],xmm0,0x1
- esp points to valid memory.
- xmm0 exists and contains 0x10 (little endian). This is a 128-bit register.
- eip = 0x462f1a
- This instruction should extract a DWORD (4-byte value) from xmm0 at offset 0x1 and write it to the r/m32. more info about the instruction
- In our instruction, this should result in [esp+0x4] = 0x0
- The
signet
executable is using 0x41b000 to 0x4e6000
Since this is an illegal instruction, and it appears that the instruction comes from the SSE4_1
extension, it seems like this is a problem with whatever compiled the scrypt library not being compatible with this CPU. It assumes that SSE4_1 instruction are valid and doesn't have a fallback.
Looking at info proc mappings
shows that the function is coming from inside the signet
executable, which means this is something that should be able to be fixed with compiler flags. This makes it Signet's problem to fix, not an issue of the platform shipping with a broken shared library.
It looks like we can use -mno-sse
to disable SSE. It may require additional flags such as -mno-sse4.1
. The gcc docs has the complete list of extended instruction sets.