cryptopp icon indicating copy to clipboard operation
cryptopp copied to clipboard

PowerMac and Illegal Instruction

Open noloader opened this issue 3 years ago • 1 comments

This is another new issue. Running the test suite on an old PowerMac with Debian Sid installed in a debug build:

(gdb) r v
Starting program: /home/jwalton/cryptopp/cryptest.exe v
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc64-linux-gnu/libthread_db.so.1".
...

Program received signal SIGILL, Illegal instruction.
0x00000001008fe278 in CryptoPP::CPU_ProbePower8 () at ppc_power8.cpp:70
70              word64 w1[2] = {x, x}, w2[2] = {4, 6}, w3[2];
(gdb) c
Continuing.

Program received signal SIGILL, Illegal instruction.
0x00000001008fe158 in CryptoPP::SigIllHandler () at ppc_power8.cpp:34
34          {
(gdb) c
Continuing.

Program terminated with signal SIGILL, Illegal instruction.

The first SIGILL is expected since it is our probe. The second SIGILL is not.

It looks like GCC is using POWER8 instructions without guarding them.

Related issue for this platform and compiler are GH #986 and GH #1112.

noloader avatar Mar 29 '22 23:03 noloader

This is a lot worse then I thought. GCC is using mtfprwz throughout the code where we were forced to use -mcpu=power8. mtfprwz is being used in function preamble. BLAKE2b, AES and SHA are crashing on an old PowerMac.

noloader avatar Mar 30 '22 03:03 noloader