[erlang-bugs] gcc 5.1 ubsan

Tuncer Ayaz tuncer.ayaz@REDACTED
Fri Apr 24 17:32:55 CEST 2015


Just built yesterday's otp.git master with amd64 gcc-5.1, and here's
the UBSan results. The previously reported int overflow with 4.9 are
naturally also there, but the diagnostics have changed a little.

Of course, this is just an excerpt, and the complete set of ubsan
errors for, say, one invocation of erlc would be too much to post.

If for some reason you don't have access to gcc-5.1, I've archived the
full build log for reference. Ask me if you need it.

------

beam/erl_thr_progress.c:422:8: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

sys/common/erl_poll.c:391:23: runtime error: left shift of 1 by 63
places cannot be represented in type 'long int'

common/ethr_mutex.c:3003:7: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

common/ethr_mutex.c:3055:10: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

common/ethr_mutex.c:3056:13: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

common/ethr_mutex.c:3021:11: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

common/ethr_mutex.c:3063:7: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

common/ethr_mutex.c:3064:13: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

common/ethr_mutex.c:2077:16: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

common/ethr_mutex.c:2109:10: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/beam_load.c:5205:14: runtime error: left shift of 65535 by 16
places cannot be represented in type 'int'

beam/external.c:3064:13: runtime error: left shift of 255 by 24 places
cannot be represented in type 'int'

beam/erl_process.c:10912:20: runtime error: left shift of 268435455 by
4 places cannot be represented in type 'int'

beam/erl_process.c:10916:23: runtime error: left shift of 268435455 by
4 places cannot be represented in type 'int'

beam/erl_process.c:10749:33: runtime error: left shift of 268435455 by
4 places cannot be represented in type 'int'

beam/erl_process.c:10782:39: runtime error: left shift of 268435455 by
4 places cannot be represented in type 'int'

beam/erl_thr_progress.c:812:14: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/erl_thr_progress.c:741:18: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/erl_thr_progress.c:358:27: runtime error: left shift of 1 by 31
places cannot be represented in type 'in

beam/erl_thr_progress.c:366:27: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/erl_thr_progress.c:867:7: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/beam_emu.c:5588:15: runtime error: member access within
misaligned address 0x00000230676c for type 'struct StackTrace', which
requires 8 byte alignment
0x00000230676c: note: pointer points here
  22 72 91 25 00 00 00 00  00 00 00 00 00 00 [...]
              ^

sys/common/erl_check_io.c:1621:9: runtime error: left shift of 1 by 63
places cannot be represented in type 'long int'

sys/common/erl_poll.c:2293:6: runtime error: left shift of 1 by 63
places cannot be represented in type 'long int'

sys/common/erl_poll.c:2136:21: runtime error: left shift of 1 by 63
places cannot be represented in type 'long int'

sys/common/erl_poll.c:2347:26: runtime error: left shift of 1 by 63
places cannot be represented in type 'long int'

sys/common/erl_poll.c:2023:25: runtime error: left shift of 1 by 63
places cannot be represented in type 'long int'

beam/erl_bits.c:164:19: runtime error: member access within misaligned
address 0x000002306cbc for type 'struct ErlBinMatchState', which
requires 8 byte alignment
0x000002306cbc: note: pointer points here
  d5 08 c2 01 c4 02 00 00  00 00 00 00 52 6c 30 [...]
              ^

beam/erl_bits.c:157:11: runtime error: member access within misaligned
address 0x00000240095c for type 'struct ProcBin', which requires 8
byte alignment
0x00000240095c: note: pointer points here
  74 00 00 00 24 01 00 00  09 00 00 00 2d 70 72 6f [...]
              ^

beam/beam_emu.c:6387:22: runtime error: member access within
misaligned address 0x000002401a64 for type 'struct ErlFunThing', which
requires 8 byte alignment
0x000002401a64: note: pointer points here
  d5 0a 40 02 00 00 00 00  00 00 00 00 00 00 00 00 [...]
              ^

beam/io.c:5942:6: runtime error: null pointer passed as argument 2,
which is declared to never be null
/usr/include/bits/string3.h:53:10: runtime error: null pointer passed
as argument 2, which is declared to never be null

beam/erl_gc.c:2354:23: runtime error: member access within misaligned
address 0x0000024013ec for type 'struct erl_off_heap_header', which
requires 8 byte alignment
0x0000024013ec: note: pointer points here
  03 02 00 00 d4 01 00 00  00 00 00 00 50 2e 49 0e [...]
              ^

beam/erl_thr_progress.c:763:18: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/erl_thr_progress.c:779:13: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/erl_thr_progress.c:816:25: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'

beam/binary.c:97:20: runtime error: member access within misaligned
address 0x00000240340c for type 'struct ProcBin', which requires 8
byte alignment
0x00000240340c: note: pointer points here
  87 09 00 00 00 00 00 00  21 40 40 02 00 00 00 00  11 [...]
              ^

beam/erl_bif_op.c:256:10: runtime error: member access within
misaligned address 0x00000240830c for type 'struct ErlFunThing', which
requires 8 byte alignment
0x00000240830c: note: pointer points here
  f1 82 40 02 d4 01 00 00  0f 07 00 00 30 3a 65 0f  56 03 00 [...]
              ^

beam/external.c:3280:14: runtime error: left shift of 245 by 24 places
cannot be represented in type 'int'

beam/beam_emu.c:5654:13: runtime error: member access within
misaligned address 0x00000241bafc for type 'struct StackTrace', which
requires 8 byte alignment
0x00000241bafc: note: pointer points here
  e5 ba 41 02 88 05 00 00  50 07 00 00 fd ba 41 02  fb ff ff ff [...]
              ^

x86_64-unknown-linux-gnu/opt/smp/beam_cold.h:142:5: runtime error:
member access within misaligned address 0x000002429b84 for type
'struct ErlBinMatchBuffer', which requires 8 byte alignment
0x000002429b84: note: pointer points here
  00 00 00 00 fa 9a 42 02  00 00 00 00 b0 4e 4c 0f  56 03 00 [...]
              ^



More information about the erlang-bugs mailing list