RFR: JDK-8300069: Left shift of negative value in share/adlc/dict2.cpp
Justin King
jcking at openjdk.org
Fri Jan 13 04:03:03 UTC 2023
On Thu, 12 Jan 2023 18:48:46 GMT, Justin King <jcking at openjdk.org> wrote:
> Refactor `hashstr` to use unsigned integrals to avoid undefined behavior.
GCC 12.2.0
Linux 5.9.11 x86_64
Patch https://github.com/openjdk/jdk/pull/11975 on-top of master (if it's not merged yet), configure with `--enable-ubsan`, and `make`. It should fail at the ADLC gensrc step.
* For target hotspot_variant-server_support_adlc__adlc_run_exec:
src/hotspot/share/adlc/dict2.cpp:292:19: runtime error: left shift of negative value -45
#0 0x563e46f29334 in hashstr(void const*) (build/linux-x86_64-server-release/hotspot/variant-server/tools/adlc/adlc+0x22d334)
#1 0x563e46f26929 in Dict::Insert(void const*, void const*) (build/linux-x86_64-server-release/hotspot/variant-server/tools/adlc/adlc+0x22a929)
#2 0x563e46f2fc46 in FormDict::Insert(char const*, Form*) (build/linux-x86_64-server-release/hotspot/variant-server/tools/adlc/adlc+0x233c46)
#3 0x563e46f13566 in ArchDesc::initKeywords(FormDict&) (build/linux-x86_64-server-release/hotspot/variant-server/tools/adlc/adlc+0x217566)
#4 0x563e46f040bc in ArchDesc::ArchDesc() (build/linux-x86_64-server-release/hotspot/variant-server/tools/adlc/adlc+0x2080bc)
#5 0x563e46fe8db1 in main (build/linux-x86_64-server-release/hotspot/variant-server/tools/adlc/adlc+0x2ecdb1)
#6 0x7f9747c46189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#7 0x7f9747c46244 in __libc_start_main_impl ../csu/libc-start.c:381
#8 0x563e46eb5030 in _start (build/linux-x86_64-server-release/hotspot/variant-server/tools/adlc/adlc+0x1b9030)
-------------
PR: https://git.openjdk.org/jdk/pull/11977
More information about the hotspot-compiler-dev
mailing list