openwall / john

John the Ripper jumbo - advanced offline password cracker, which supports hundreds of hash and cipher types, and runs on many operating systems, CPUs, GPUs, and even some FPGAs
https://www.openwall.com/john/
Other
10.32k stars 2.1k forks source link

Multiple "runtime error: store to misaligned address" messages with -fsanitize=undefined #1225

Closed frank-dittrich closed 9 years ago

frank-dittrich commented 9 years ago

...and similar messages. Should we care about these messages? Any idea how to find out which of these could cause performance penalties on x86 or trouble on other archs?

$ /usr/local/bin/gcc --version
gcc (GCC) 5.1.0
$ $ uname -srvio
Linux 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:37 UTC 2015 x86_64 GNU/Linux
$ export LC_ALL=C
$ make -s distclean
$ CC="/usr/local/bin/gcc -fsanitize=undefined" ./configure --disable-openmp > /dev/null
$ make -s clean && make -s -j 8
/usr/bin/ar: creating aes.a

Make process completed.
$ ../run/john --test=0|LC_ALL=C grep -v PASS
dynamic_fmt.c:1115:6: runtime error: load of misaligned address 0x7f8c7b069012 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x7f8c7b069012: note: pointer points here
 00 00  34 30 30 30 30 30 31 61  44 4e 4e 6f 6a 59 47 53  63 37 70 53 7a 63 64 78  4b 78 68 62 71 76
              ^ 
dynamic_fmt.c:2950:24: runtime error: load of misaligned address 0x7f8c7b069019 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x7f8c7b069019: note: pointer points here
 30 31 61  44 4e 4e 6f 6a 59 47 53  63 37 70 53 7a 63 64 78  4b 78 68 62 71 76 4c 74  45 65 34 64 65
              ^ 
dynamic_fmt.c:5485:27: runtime error: store to misaligned address 0x0000024ef55b for type 'short unsigned int', which requires 2 byte alignment
0x0000024ef55b: note: pointer points here
 61  53 58 42 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00
              ^ 
cryptsha256_fmt_plug.c:771:12: runtime error: store to misaligned address 0x7fff4c4590fe for type 'ARCH_WORD_32', which requires 4 byte alignment
0x7fff4c4590fe: note: pointer points here
 1d d0 a3 45 70 c1  92 55 0e c8 90 78 e7 9f  0d 72 a1 42 af 3d 27 41  79 f4 e2 d5 76 c6 07 c1  90 c9
             ^ 
cryptsha512_fmt_plug.c:754:12: runtime error: store to misaligned address 0x7fff4c459f1e for type 'ARCH_WORD_64', which requires 8 byte alignment
0x7fff4c459f1e: note: pointer points here
 cc f0 54 c0 8e be  62 97 00 e5 99 26 f9 cd  f8 96 37 a1 5c f8 8a 19  36 5b 6f d4 74 d6 3e 50  3e 01
             ^ 
encfs_fmt_plug.c:161:124: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:161:144: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:161:96: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:161:77: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:163:38: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:163:58: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:179:62: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:180:63: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:180:83: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:181:56: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:181:76: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:133:49: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:133:29: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:140:39: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:142:39: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:146:28: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:226:2: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:227:54: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:182:63: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:182:83: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:175:39: runtime error: member access within misaligned address 0x0000024e25e4 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x0000024e25e4: note: pointer points here
  58 dd cf 78 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
androidfde_fmt_plug.c:256:29: runtime error: member access within misaligned address 0x0000024fdd54 for type 'struct custom_salt', which requires 8 byte alignment
0x0000024fdd54: note: pointer points here
  00 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
androidfde_fmt_plug.c:277:44: runtime error: member access within misaligned address 0x0000024fdd54 for type 'struct custom_salt', which requires 8 byte alignment
0x0000024fdd54: note: pointer points here
  00 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
androidfde_fmt_plug.c:219:35: runtime error: member access within misaligned address 0x0000024fdd54 for type 'struct custom_salt', which requires 8 byte alignment
0x0000024fdd54: note: pointer points here
  00 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
androidfde_fmt_plug.c:227:35: runtime error: member access within misaligned address 0x0000024fdd54 for type 'struct custom_salt', which requires 8 byte alignment
0x0000024fdd54: note: pointer points here
  00 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
HDAA_fmt_plug.c:445:29: runtime error: member access within misaligned address 0x0000024fde14 for type 'struct reqinfo_t', which requires 8 byte alignment
0x0000024fde14: note: pointer points here
  d8 e3 cf 78 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
HDAA_fmt_plug.c:447:15: runtime error: member access within misaligned address 0x0000024fde14 for type 'struct reqinfo_t', which requires 8 byte alignment
0x0000024fde14: note: pointer points here
  d8 e3 cf 78 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
HDAA_fmt_plug.c:482:21: runtime error: member access within misaligned address 0x0000024fde14 for type 'struct reqinfo_t', which requires 8 byte alignment
0x0000024fde14: note: pointer points here
  d8 e3 cf 78 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
HDAA_fmt_plug.c:484:15: runtime error: member access within misaligned address 0x0000024fde14 for type 'struct reqinfo_t', which requires 8 byte alignment
0x0000024fde14: note: pointer points here
  d8 e3 cf 78 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
dynamic_fmt.c:2228:4: runtime error: load of misaligned address 0x0000024ff344 for type 'long unsigned int', which requires 8 byte alignment
0x0000024ff344: note: pointer points here
  58 dc cf 78 d6 9a 06 7b  8c 7f 00 00 8c 7f 00 00  00 00 00 00 00 00 00 00  21 00 00 00 00 00 00 00
              ^ 
dynamic_fmt.c:1110:9: runtime error: load of misaligned address 0x0000024ff344 for type 'unsigned char *', which requires 8 byte alignment
0x0000024ff344: note: pointer points here
  58 dc cf 78 d6 9a 06 7b  8c 7f 00 00 8c 7f 00 00  00 00 00 00 00 00 00 00  21 00 00 00 00 00 00 00
              ^ 
unicode.c:725:28: runtime error: store to misaligned address 0x00000250dfe5 for type 'unsigned int', which requires 4 byte alignment
0x00000250dfe5: note: pointer points here
 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00
             ^ 
unicode.c:726:28: runtime error: store to misaligned address 0x00000250dfe9 for type 'unsigned int', which requires 4 byte alignment
0x00000250dfe9: note: pointer points here
 e0 b6 de  1a 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^ 
unicode.c:727:28: runtime error: store to misaligned address 0x00000250dfed for type 'unsigned int', which requires 4 byte alignment
0x00000250dfed: note: pointer points here
 35 92 1a 09 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00
             ^ 
unicode.c:728:28: runtime error: store to misaligned address 0x00000250dff1 for type 'unsigned int', which requires 4 byte alignment
0x00000250dff1: note: pointer points here
 e3 b7 5f  c1 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^ 
unicode.c:414:11: runtime error: store to misaligned address 0x000002abec31 for type 'UTF16', which requires 2 byte alignment
0x000002abec31: note: pointer points here
 dc 38 df  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^ 
unicode.c:421:8: runtime error: store to misaligned address 0x000002abec47 for type 'UTF16', which requires 2 byte alignment
0x000002abec47: note: pointer points here
 69 00 6e 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00
             ^ 
oracle11_fmt_plug.c:346:5: runtime error: load of misaligned address 0x000002ac5062 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000002ac5062: note: pointer points here
 00 00  90 36 03 f2 c5 2e d1 b4  d6 42 00 00 00 00 00 00  90 36 03 f2 c5 2e d1 b4  d6 42 00 00 00 00
              ^ 
oracle11_fmt_plug.c:349:5: runtime error: load of misaligned address 0x000002ac5066 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000002ac5066: note: pointer points here
 03 f2 c5 2e d1 b4  d6 42 00 00 00 00 00 00  90 36 03 f2 c5 2e d1 b4  d6 42 00 00 00 00 00 00  00 00
             ^ 
oracle11_fmt_plug.c:355:5: runtime error: load of misaligned address 0x000002ac5061 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000002ac5061: note: pointer points here
 5c 4d da  97 63 fc f0 d5 4d a6 67  d4 e6 00 00 00 00 00 00  97 63 fc f0 d5 4d a6 67  d4 e6 00 00 00
              ^ 
oracle11_fmt_plug.c:358:5: runtime error: load of misaligned address 0x000002ac5065 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000002ac5065: note: pointer points here
 63 fc f0 d5 4d a6 67  d4 e6 00 00 00 00 00 00  97 63 fc f0 d5 4d a6 67  d4 e6 00 00 00 00 00 00  00
             ^ 
sapB_fmt_plug.c:456:36: runtime error: store to misaligned address 0x7fff4c45c7d9 for type 'unsigned int', which requires 4 byte alignment
0x7fff4c45c7d9: note: pointer points here
 49 00 51  00 16 7e 00 00 00 00 00  60 39 ed 00 00 00 00 00  10 00 00 00 00 00 00 00  01 30 9d 00 00
              ^ 
sapG_fmt_plug.c:463:33: runtime error: load of misaligned address 0x0000027a4639 for type 'const ARCH_WORD_32', which requires 4 byte alignment
0x0000027a4639: note: pointer points here
 38 39 30  00 58 00 49 43 00 32 33  30 00 2d 2d 2d 00 72 64  00 37 38 39 30 31 32 33  34 35 36 37 38
              ^ 
sapG_fmt_plug.c:556:59: runtime error: load of misaligned address 0x0000009d3662 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x0000009d3662: note: pointer points here
 1c 2f  33 8f e6 e5 f8 9b ae dd  16 f2 4b 8d 2c e1 d4 dc  b0 cb df 9d d4 70 6d 17  f9 4d 42 3f 9b 1b
              ^ 
sapH_fmt_plug.c:303:15: runtime error: store to misaligned address 0x7fff4c45c417 for type 'uint32_t', which requires 4 byte alignment
0x7fff4c45c417: note: pointer points here
 42 42 42 42 1d  16 88 6f 62 84 8b 6c 44  32 c3 d6 0d f5 1d 68 cf  e6 83 22 80 00 00 00 00  00 00 00
             ^ 
sapH_fmt_plug.c:375:15: runtime error: store to misaligned address 0x7fff4c45c646 for type 'uint32_t', which requires 4 byte alignment
0x7fff4c45c646: note: pointer points here
 6f 62 6f 6f b2 6d  27 89 5b 9c bc e8 7b 13  2e 36 11 d7 f2 af 03 77  81 46 39 42 5b 2c 77 27  e0 bc
             ^ 
sapH_fmt_plug.c:448:15: runtime error: store to misaligned address 0x7fff4c45c646 for type 'ARCH_WORD_64', which requires 8 byte alignment
0x7fff4c45c646: note: pointer points here
 6f 62 6f 6f 35 01  f7 03 40 88 d4 ef 9c 89  cb 2a 37 28 60 50 db ea  7a 98 27 e4 5a 3c 23 af  e7 65
             ^ 
sapH_fmt_plug.c:520:15: runtime error: store to misaligned address 0x7fff4c45c6d7 for type 'ARCH_WORD_64', which requires 8 byte alignment
0x7fff4c45c6d7: note: pointer points here
 47 47 47 47 bd  7f 6f c5 90 03 68 2f 47  f9 16 e0 70 54 80 2d c8  51 82 6e 42 e3 1c ef f8  be 51 f5
             ^ 
uaf_encode.c:537:13: runtime error: member access within misaligned address 0x0000024ffe44 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x0000024ffe44: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:554:30: runtime error: member access within misaligned address 0x0000024ffe44 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x0000024ffe44: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:554:20: runtime error: member access within misaligned address 0x0000024ffe44 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x0000024ffe44: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:559:13: runtime error: member access within misaligned address 0x0000024ffe44 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x0000024ffe44: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:563:10: runtime error: member access within misaligned address 0x0000024ffe44 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x0000024ffe44: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
vtp_fmt_plug.c:334:15: runtime error: member access within misaligned address 0x0000027c2904 for type 'struct custom_salt', which requires 8 byte alignment
0x0000027c2904: note: pointer points here
  c8 e3 cf 78 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:335:57: runtime error: member access within misaligned address 0x0000027c2904 for type 'struct custom_salt', which requires 8 byte alignment
0x0000027c2904: note: pointer points here
  c8 e3 cf 78 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:336:22: runtime error: member access within misaligned address 0x0000027c2904 for type 'struct custom_salt', which requires 8 byte alignment
0x0000027c2904: note: pointer points here
  c8 e3 cf 78 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:340:54: runtime error: member access within misaligned address 0x0000027c2904 for type 'struct custom_salt', which requires 8 byte alignment
0x0000027c2904: note: pointer points here
  c8 e3 cf 78 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:341:21: runtime error: member access within misaligned address 0x0000027c2904 for type 'struct custom_salt', which requires 8 byte alignment
0x0000027c2904: note: pointer points here
  c8 e3 cf 78 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
XSHA512_fmt_plug.c:211:29: runtime error: load of misaligned address 0x0000015a02a4 for type 'const ARCH_WORD_64', which requires 8 byte alignment
0x0000015a02a4: note: pointer points here
  30 58 38 30 5f 49 53 5f  4e 4f 54 5f 45 4f 57 80  41 41 41 41 41 41 41 41  41 41 41 41 41 41 41 41
              ^ 
magnumripper commented 9 years ago

Should we care about these messages?

Not if ARCH_ALLOWS_UNALIGNED (eg. x86). But if you'd use that option on a Sparc and still see these messages, we do have a problem.

Is there a way to turn this off for a section of code? Then we could do something like this

#if ARCH_ALLOWS_UNALIGNED
#some pragma turn-checks-off
(...unaligned code...)
#some pragma turn-checks-on-again
#else
(...aligned code...)
#endif

Any idea how to find out which of these could cause performance penalties on x86 or trouble on other archs?

We often do it on purpose (when allowed), for speed. So there's definitely no performance penalty in those cases. But a Sparc would segfault if running that code.

magnumripper commented 9 years ago

On a side note, ARCH_ALLOWS_UNALIGNED is not supposed to be set for systems that allows unaligned but do so with a significant performance hit. This was established by Solar some time ago after Jim had added a test in autoconf that merely detected if unaligned would work at all. This is fixed in autoconf since - ARCH_ALLOWS_UNALIGNED is only set to 1 in x86 and VAX arch.h's.

frank-dittrich commented 9 years ago

I just changed the definition of ARCH_ALLOWS_UNALIGNED in x86-64.h from 1 to 0, rebuilt john

$ make -s distclean ; CC="gcc -fsanitize=undefined" ./configure --disable-openmp && make -s clean && make -s -j 8

Now, all remaining error messages about alignment problems should be genuine bugs which cause trouble on most non-x86 architectures.

Apparently, none of the messages of my first test disappeared, while messages in MD5_std.c which I got for a core john build disappeared after redefining ARCH_ALLOWS_UNALIGNED in x86-64.h.

Who has access to a system which doesn't allow unaligned access and can verify if there are problems?

$ ./john --test=0 > /dev/null
config.c:73:13: runtime error: member access within misaligned address 0x000002ef1d46 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d46: note: pointer points here
 78 00 59 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00
             ^ 
config.c:74:13: runtime error: member access within misaligned address 0x000002ef1d46 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d46: note: pointer points here
 78 00 59 00 50 b0  df 02 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00
             ^ 
config.c:75:14: runtime error: member access within misaligned address 0x000002ef1d46 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d46: note: pointer points here
 78 00 59 00 50 b0  df 02 00 00 00 00 40 1d  ef 02 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00
             ^ 
config.c:62:9: runtime error: member access within misaligned address 0x000002ef1d46 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d46: note: pointer points here
 78 00 59 00 50 b0  df 02 00 00 00 00 40 1d  ef 02 00 00 00 00 44 1d  ef 02 00 00 00 00 00 00  00 00
             ^ 
config.c:67:7: runtime error: member access within misaligned address 0x000002ef1d46 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d46: note: pointer points here
 78 00 59 00 50 b0  df 02 00 00 00 00 40 1d  ef 02 00 00 00 00 44 1d  ef 02 00 00 00 00 00 00  00 00
             ^ 
config.c:331:6: runtime error: member access within misaligned address 0x000002ef1d76 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d76: note: pointer points here
 00 00 00 00 5e 1d  ef 02 00 00 00 00 00 1d  ef 02 00 00 00 00 04 1d  ef 02 00 00 00 00 00 00  b0 1c
             ^ 
config.c:338:26: runtime error: member access within misaligned address 0x000002ef1d76 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d76: note: pointer points here
 00 00 00 00 5e 1d  ef 02 00 00 00 00 00 1d  ef 02 00 00 00 00 04 1d  ef 02 00 00 00 00 00 00  b0 1c
             ^ 
bench.c:277:3: runtime error: null pointer passed as argument 1, which is declared to never be null
dynamic_fmt.c:2958:24: runtime error: load of misaligned address 0x7f8208180019 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x7f8208180019: note: pointer points here
 30 31 61  44 4e 4e 6f 6a 59 47 53  63 37 70 53 7a 63 64 78  4b 78 68 62 71 76 4c 74  45 65 34 64 65
              ^ 
bench.c:277:3: runtime error: null pointer passed as argument 2, which is declared to never be null
cryptsha256_fmt_plug.c:771:12: runtime error: store to misaligned address 0x7ffe2dfd295e for type 'ARCH_WORD_32', which requires 4 byte alignment
0x7ffe2dfd295e: note: pointer points here
 1d d0 a3 45 70 c1  92 55 0e c8 90 78 e7 9f  0d 72 a1 42 af 3d 27 41  79 f4 e2 d5 76 c6 07 c1  90 c9
             ^ 
cryptsha512_fmt_plug.c:754:12: runtime error: store to misaligned address 0x7ffe2dfd377e for type 'ARCH_WORD_64', which requires 8 byte alignment
0x7ffe2dfd377e: note: pointer points here
 cc f0 54 c0 8e be  62 97 00 e5 99 26 f9 cd  f8 96 37 a1 5c f8 8a 19  36 5b 6f d4 74 d6 3e 50  3e 01
             ^ 
encfs_fmt_plug.c:161:124: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:161:144: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:161:96: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:161:77: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:163:38: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:163:58: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:179:62: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:180:63: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:180:83: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:181:56: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:181:76: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:133:49: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:133:29: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:140:39: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:142:39: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:146:28: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:226:2: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:227:54: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:182:63: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_fmt_plug.c:182:83: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
encfs_common_plug.c:175:39: runtime error: member access within misaligned address 0x000002e09d84 for type 'struct encfs_common_custom_salt', which requires 8 byte alignment
0x000002e09d84: note: pointer points here
  98 2c c6 0b 18 00 00 00  e2 c4 02 00 00 00 00 00  14 00 00 00 f1 c4 13 d9  a2 0f 7f db c0 68 c5 a4
              ^ 
androidfde_fmt_plug.c:256:29: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  74 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
androidfde_fmt_plug.c:277:44: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  74 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
androidfde_fmt_plug.c:219:35: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  74 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
androidfde_fmt_plug.c:227:35: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  74 65 73 74 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 10 00 00 00  00 00 00 00 10 00 00 00
              ^ 
config.c:337:10: runtime error: member access within misaligned address 0x000002ef1d76 for type 'struct cfg_param', which requires 8 byte alignment
0x000002ef1d76: note: pointer points here
 00 00 00 00 5e 1d  ef 02 00 00 00 00 00 1d  ef 02 00 00 00 00 04 1d  ef 02 00 00 00 00 00 00  b0 1c
             ^ 
HDAA_fmt_plug.c:447:29: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct reqinfo_t', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  00 00 00 00 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
HDAA_fmt_plug.c:449:15: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct reqinfo_t', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  00 00 00 00 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
HDAA_fmt_plug.c:484:21: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct reqinfo_t', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  00 00 00 00 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
HDAA_fmt_plug.c:486:15: runtime error: member access within misaligned address 0x00000302f8b4 for type 'struct reqinfo_t', which requires 8 byte alignment
0x00000302f8b4: note: pointer points here
  00 00 00 00 0d 00 00 00  00 00 00 00 81 00 00 00  00 00 00 00 75 73 65 72  3a 6d 79 72 65 61 6c 6d
              ^ 
dynamic_fmt.c:2236:4: runtime error: load of misaligned address 0x000003033c84 for type 'long unsigned int', which requires 8 byte alignment
0x000003033c84: note: pointer points here
  78 2b c6 0b d6 0a 18 08  82 7f 00 00 82 7f 00 00  20 73 6f 6e 6f 20 6c 61  21 00 00 00 00 00 00 00
              ^ 
dynamic_fmt.c:1118:9: runtime error: load of misaligned address 0x000003033c84 for type 'unsigned char *', which requires 8 byte alignment
0x000003033c84: note: pointer points here
  78 2b c6 0b d6 0a 18 08  82 7f 00 00 82 7f 00 00  20 73 6f 6e 6f 20 6c 61  21 00 00 00 00 00 00 00
              ^ 
oracle11_fmt_plug.c:346:5: runtime error: load of misaligned address 0x000003374822 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000003374822: note: pointer points here
 00 00  90 36 03 f2 c5 2e d1 b4  d6 42 61 00 67 00 50 00  90 36 03 f2 c5 2e d1 b4  d6 42 4d 00 80 00
              ^ 
oracle11_fmt_plug.c:349:5: runtime error: load of misaligned address 0x000003374826 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000003374826: note: pointer points here
 03 f2 c5 2e d1 b4  d6 42 61 00 67 00 50 00  90 36 03 f2 c5 2e d1 b4  d6 42 4d 00 80 00 00 00  6c 00
             ^ 
oracle11_fmt_plug.c:355:5: runtime error: load of misaligned address 0x000003374821 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000003374821: note: pointer points here
 5c 4d da  97 63 fc f0 d5 4d a6 67  d4 e6 61 00 67 00 50 00  97 63 fc f0 d5 4d a6 67  d4 e6 4d 00 80
              ^ 
oracle11_fmt_plug.c:358:5: runtime error: load of misaligned address 0x000003374825 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x000003374825: note: pointer points here
 63 fc f0 d5 4d a6 67  d4 e6 61 00 67 00 50 00  97 63 fc f0 d5 4d a6 67  d4 e6 4d 00 80 00 00 00  6c
             ^ 
pkzip_fmt_plug.c:482:9: runtime error: load of misaligned address 0x000003033b94 for type 'struct PKZ_SALT *', which requires 8 byte alignment
0x000003033b94: note: pointer points here
  00 00 00 00 20 10 03 03  00 00 00 00 82 7f 00 00  6f 70 65 6e 77 61 6c 6c  61 01 00 00 00 00 00 00
              ^ 
dyna_salt.c:51:24: runtime error: load of misaligned address 0x000003033b94 for type 'struct dyna_salt_john_core *', which requires 8 byte alignment
0x000003033b94: note: pointer points here
  00 00 00 00 20 10 03 03  00 00 00 00 82 7f 00 00  6f 70 65 6e 77 61 6c 6c  61 01 00 00 00 00 00 00
              ^ 
sapB_fmt_plug.c:456:36: runtime error: store to misaligned address 0x7ffe2dfd6039 for type 'unsigned int', which requires 4 byte alignment
0x7ffe2dfd6039: note: pointer points here
 49 00 51  00 f6 7d 00 00 00 00 00  00 0b ed 00 00 00 00 00  10 00 00 00 00 00 00 00  01 e6 9c 00 00
              ^ 
sapG_fmt_plug.c:463:33: runtime error: load of misaligned address 0x00000303bab9 for type 'const ARCH_WORD_32', which requires 4 byte alignment
0x00000303bab9: note: pointer points here
 38 39 30  00 58 00 49 43 00 32 33  30 00 2d 2d 2d 00 72 64  00 37 38 39 30 31 32 33  34 35 36 37 38
              ^ 
sapG_fmt_plug.c:556:59: runtime error: load of misaligned address 0x0000009cec62 for type 'ARCH_WORD_32', which requires 4 byte alignment
0x0000009cec62: note: pointer points here
 1c 2f  33 8f e6 e5 f8 9b ae dd  16 f2 4b 8d 2c e1 d4 dc  b0 cb df 9d d4 70 6d 17  f9 4d 42 3f 9b 1b
              ^ 
sapH_fmt_plug.c:303:15: runtime error: store to misaligned address 0x7ffe2dfd5c77 for type 'uint32_t', which requires 4 byte alignment
0x7ffe2dfd5c77: note: pointer points here
 42 42 42 42 1d  16 88 6f 62 84 8b 6c 44  32 c3 d6 0d f5 1d 68 cf  e6 83 22 80 00 00 00 00  00 00 00
             ^ 
sapH_fmt_plug.c:375:15: runtime error: store to misaligned address 0x7ffe2dfd5ea6 for type 'uint32_t', which requires 4 byte alignment
0x7ffe2dfd5ea6: note: pointer points here
 6f 62 6f 6f b2 6d  27 89 5b 9c bc e8 7b 13  2e 36 11 d7 f2 af 03 77  81 46 39 42 5b 2c 77 27  e0 bc
             ^ 
sapH_fmt_plug.c:448:15: runtime error: store to misaligned address 0x7ffe2dfd5ea6 for type 'ARCH_WORD_64', which requires 8 byte alignment
0x7ffe2dfd5ea6: note: pointer points here
 6f 62 6f 6f 35 01  f7 03 40 88 d4 ef 9c 89  cb 2a 37 28 60 50 db ea  7a 98 27 e4 5a 3c 23 af  e7 65
             ^ 
sapH_fmt_plug.c:520:15: runtime error: store to misaligned address 0x7ffe2dfd5f37 for type 'ARCH_WORD_64', which requires 8 byte alignment
0x7ffe2dfd5f37: note: pointer points here
 47 47 47 47 bd  7f 6f c5 90 03 68 2f 47  f9 16 e0 70 54 80 2d c8  51 82 6e 42 e3 1c ef f8  be 51 f5
             ^ 
uaf_encode.c:537:13: runtime error: member access within misaligned address 0x000003033be4 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x000003033be4: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:554:30: runtime error: member access within misaligned address 0x000003033be4 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x000003033be4: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:554:20: runtime error: member access within misaligned address 0x000003033be4 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x000003033be4: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:559:13: runtime error: member access within misaligned address 0x000003033be4 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x000003033be4: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
uaf_encode.c:563:10: runtime error: member access within misaligned address 0x000003033be4 for type 'struct uaf_hash_info', which requires 8 byte alignment
0x000003033be4: note: pointer points here
  00 00 00 00 64 90 61 55  0a 32 2a d1 00 00 00 00  00 00 00 00 a5 fb 03 00  8d 96 0b 7e 10 00 00 00
              ^ 
vtp_fmt_plug.c:334:15: runtime error: member access within misaligned address 0x00000308c8c4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000308c8c4: note: pointer points here
  78 32 c6 0b 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:335:57: runtime error: member access within misaligned address 0x00000308c8c4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000308c8c4: note: pointer points here
  78 32 c6 0b 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:336:22: runtime error: member access within misaligned address 0x00000308c8c4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000308c8c4: note: pointer points here
  78 32 c6 0b 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:340:54: runtime error: member access within misaligned address 0x00000308c8c4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000308c8c4: note: pointer points here
  78 32 c6 0b 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
vtp_fmt_plug.c:341:21: runtime error: member access within misaligned address 0x00000308c8c4 for type 'struct custom_salt', which requires 8 byte alignment
0x00000308c8c4: note: pointer points here
  78 32 c6 0b 00 00 00 00  02 01 00 0c 64 6f 6d 61  69 6e 31 32 33 34 35 36  00 00 00 00 00 00 00 00
              ^ 
XSHA512_fmt_plug.c:211:29: runtime error: load of misaligned address 0x00000159c304 for type 'const ARCH_WORD_64', which requires 8 byte alignment
0x00000159c304: note: pointer points here
  30 58 38 30 5f 49 53 5f  4e 4f 54 5f 45 4f 57 80  41 41 41 41 41 41 41 41  41 41 41 41 41 41 41 41
              ^ 
magnumripper commented 9 years ago

I just changed the definition of ARCH_ALLOWS_UNALIGNED in x86-64.h from 1 to 0, rebuilt john

Now, all remaining error messages about alignment problems should be genuine bugs which cause trouble on most non-x86 architectures.

Not quite, because we currently have lots of such code wrapped within SIMD_COEF_xx blocks, and since that so far has inferred we're on x86, we did not add ARCH_ALLOWS_UNALIGNED too. But if you also configure with CFLAGS="-g -O2 -mno-mmx -mno-sse" or something like that, you should get what you wanted.

frank-dittrich commented 9 years ago

@jfoug @magnumripper the issue is still assigned to me, but I am not sure what I am supposed to do except just closing the issue. But I think since @jfoug added a jumbo-2 milestone, he might want to test this on an architecture which doesn't allow unaligned access before closing it.

magnumripper commented 9 years ago

I did suggest a test you could do (the -mnosse etc one above, together with setting ARCH_ALLOWS_UNALIGNED to 0) if you like. For Jumbo-2 we'll have to do real Sparc testing anyway but if you can find bugs this way beforehand, those tests may be sped up a lot.

jfoug commented 9 years ago

That was one reason I put this one into J2.

I have sparc testing on my todo list, eseciially since there has been so much change in dynamic. But these unaligned warnings are something I also wanted to check.

However, I bet most are simply things you see in SIMD compiled parts of the code. I would almost assure you that our faster SIMD mixed loading code will trip this warning all over the place.

If you get done testing this frank, assign it to me, and I will do the real sparc testing. Once I do that, I will comment here. HOWEVER, I do not have a system where I can build with -fsanitize=undefined

jfoug commented 9 years ago

Ok, finally got around to building on my sparc. I had a bit up updating to do. We moved physical server boxes (upgrading 12 yr old HW to only 2 yr old, lol, but the OS is still 10yrs old, but patched to semi new).

The main problem I have, is the new box does not have SHA2 functions in oSSL while the older box did (I have a incident report into our Unix team that the ssl is different). So I think many of these errors are due to differences in ssl (I think).

But I saw NO warnings about unaligned, nor were there ANY cores (once I got dynamic parser to keep from coring instantly at startup). If there were alignment problems, I would have expected one of the formats to core. Nothing happened.

Now, I do have a few formats that are not working. These are the ones:

Testing: dynamic_2 [md5(md5($p)) (e107) 32/32 x2 (MD5_body)]... FAILED (cmp_all(6))
Testing: dynamic_3 [md5(md5(md5($p))) 32/32 x2 (MD5_body)]... FAILED (cmp_all(1))
Testing: dynamic_34 [md5(md4($p)) 32/32]... FAILED (cmp_all(6))
Testing: dynamic_1001 [md5(md5(md5(md5($p)))) 32/32 x2 (MD5_body)]... FAILED (cmp_all(1))
Testing: dynamic_1002 [md5(md5(md5(md5(md5($p))))) 32/32 x2 (MD5_body)]... FAILED (cmp_all(1))
Testing: dynamic_1004 [md5(md5(md5(md5(md5(md5($p)))))) 32/32 x2 (MD5_body)]... FAILED (cmp_all(1))
Testing: dynamic_1005 [md5(md5(md5(md5(md5(md5(md5($p))))))) 32/32 x2 (MD5_body)]... FAILED (cmp_all(1))
Testing: dynamic_1006 [md5(md5(md5(md5(md5(md5(md5(md5($p)))))))) 32/32 x2 (MD5_body)]... FAILED (cmp_all(1))
Testing: PBKDF2-HMAC-MD4 [PBKDF2-MD4 32/32]... FAILED (cmp_all(1))
Testing: PBKDF2-HMAC-MD5 [PBKDF2-MD5 32/32]... FAILED (cmp_all(1))
Testing: pomelo [POMELO 32/32]... FAILED (cmp_all(1))

Pomelo did not work before on BE, so ignore it. The others likely are due to some 'common' issue in the older version of oSSL (different ctx or something). I bet these all use CTX copying or something. So once I find the problem, there will only likely be changes to 3 source files and that problem goes away.

So at this time, I do not feel that these warnings are anything OTHER than some code running within the SIMD logic doing data conversion and not caring about alignment, that are triggering these warnings, and that we have proper #define logic so that only aligned access is being done on systems where alignment matters. I just do not see how a -test=0 would work otherwise.

frank-dittrich commented 9 years ago

Do we have that memdbg feature to make sure malloc() doesn't return an alignment that is greater than requested? Then you could repeat that test with a memdg build.

jfoug commented 9 years ago

Making now. I will test and post results.

Hopefully there will be no 'new' build problems. I am tired of trying to fix build issues on this box.

jfoug commented 9 years ago
bash-3.00$ ../run/john -test=0 | grep -v PASS
Testing: PBKDF2-HMAC-MD4 [PBKDF2-MD4 32/32]... FAILED (cmp_all(1))
Testing: PBKDF2-HMAC-MD5 [PBKDF2-MD5 32/32]... FAILED (cmp_all(1))
Testing: pomelo [POMELO 32/32]... FAILED (cmp_all(1))
3 out of 325 tests have FAILED
At Program Exit
MemDbg_Validate level 0 checking Passed