Simon Josefsson simon@josefsson.org writes:
(However, the 'gcm' self test crashed on PPC.)
Here is a backtrace.
espresso:~/nettle-2.2/testsuite jas$ gdb ./gcm-test GNU gdb 6.3.50-20050815 (Apple version gdb-696) (Sat Oct 20 18:20:28 GMT 2007) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-darwin"... warning: --arch option not supported in this gdb. Reading symbols for shared libraries .. done
(gdb) b main Breakpoint 1 at 0x3ddc: file testutils.c, line 149. (gdb) r Starting program: /Users/jas/nettle-2.2/testsuite/gcm-test Reading symbols for shared libraries . done
Breakpoint 1, main (argc=1, argv=0xbffffb34) at testutils.c:149 149 if (argc > 1) (gdb) c Continuing.
Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000000 0x00000000 in ?? () (gdb) bt #0 0x00000000 in ?? () Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 #1 0x000049f0 in test_aead (aead=Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 0x80f0, key_length=16, key=0x3000f0 "", auth_length=0, authtext=0x300100 "", length=0, cleartext=0x300110 "", ciphertext=0x300120 "", iv_length=12, iv=0x300130 "", digest=0x300140 "X����~0a6\035W��EZ") at testutils.c:384 Cannot access memory at address 0x0 #2 0x000029ec in test_main () at gcm-test.c:14 Cannot access memory at address 0x0 Cannot access memory at address 0x0 Cannot access memory at address 0x0 #3 0x00003e30 in main (argc=1, argv=0xbffffb34) at testutils.c:161 (gdb)
What is fishy is that nettle_gcm_aes128 doesn't seem to have been initialized properly:
espresso:~/nettle-2.2/testsuite jas$ gdb ./gcm-test GNU gdb 6.3.50-20050815 (Apple version gdb-696) (Sat Oct 20 18:20:28 GMT 2007) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-darwin"... warning: --arch option not supported in this gdb. Reading symbols for shared libraries .. done
(gdb) p nettle_gcm_aes128 $1 = { name = 0x0, context_size = 0, block_size = 0, key_size = 0, set_key = 0, set_iv = 0, update = 0, encrypt = 0, decrypt = 0, digest = 0 } (gdb)
Even stranger is that it is defined properly in other tests:
espresso:~/nettle-2.2/testsuite jas$ gdb ./blowfish-test GNU gdb 6.3.50-20050815 (Apple version gdb-696) (Sat Oct 20 18:20:28 GMT 2007) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-darwin"... warning: --arch option not supported in this gdb. Reading symbols for shared libraries .. done
(gdb) p nettle_gcm_aes128 $1 = { name = 0xfabc "gcm-aes128", context_size = 4404, block_size = 16, key_size = 16, set_key = 0xc308 <nettle_gcm_aes_set_key>, set_iv = 0xc37c <nettle_gcm_aes_set_iv>, update = 0xc3d4 <nettle_gcm_aes_update>, encrypt = 0xc42c <nettle_gcm_aes_encrypt>, decrypt = 0xc4a8 <nettle_gcm_aes_decrypt>, digest = 0xc524 <nettle_gcm_aes_digest> } (gdb)
Possibly something could be broken on this machine.
/Simon