Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8331298

avoid alignment checks in UBSAN enabled build

    XMLWordPrintable

Details

    • b21

    Backports

      Description

        Currently we run into some alignment related issues when building with '--enable-ubsan' . Those errors already occur in the build. Fixing them might take some time and maybe also some discussion if it is worth the effort ,
        So for now the alignment related checks should be disabled to get the UBSAN build working.
        Examples :

        /jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:128:13: runtime error: store to misaligned address 0x15099c3cf4ce for type 'int', which requires 4 byte alignment
        0x15099c3cf4ce: note: pointer points here
         00 80 0f 86 00 00 00 00 3d 06 00 00 80 76 60 3d 07 00 00 80 76 40 3d 08 00 00 80 76 20 3d 1e 00
                     ^
            #0 0x1509b3b04f10 in MacroAssembler::pd_patch_instruction(unsigned char*, unsigned char*, char const*, int) /jdk/src/hotspot/cpu/x86/macroAssembler_x86.hpp:128
            #1 0x1509b3b04f10 in Label::patch_instructions(MacroAssembler*) /jdk/src/hotspot/share/asm/assembler.cpp:201
            #2 0x1509b940b6d8 in VM_Version_StubGenerator::generate_get_cpu_info() /jdk/src/hotspot/cpu/x86/vm_version_x86.cpp:381
            #3 0x1509b94059bd in VM_Version::initialize() /jdk/src/hotspot/cpu/x86/vm_version_x86.cpp:2138
            #4 0x1509b93fb56e in VM_Version_init() /jdk/src/hotspot/share/runtime/vm_version.cpp:32
            #5 0x1509b61ef947 in init_globals() /jdk/src/hotspot/share/runtime/init.cpp:126
            #6 0x1509b8fb0e29 in Threads::create_vm(JavaVMInitArgs*, bool*) /jdk/src/hotspot/share/runtime/threads.cpp:553
            #7 0x1509b67da3d7 in JNI_CreateJavaVM_inner /jdk/src/hotspot/share/prims/jni.cpp:3581
            #8 0x1509b67da3d7 in JNI_CreateJavaVM /jdk/src/hotspot/share/prims/jni.cpp:3672
            #9 0x1509c0eed957 in InitializeJVM /jdk/src/java.base/share/native/libjli/java.c:1550
            #10 0x1509c0eed957 in JavaMain /jdk/src/java.base/share/native/libjli/java.c:491
           ... (rest of output omitted)
           
        /jdk/src/hotspot/share/runtime/vmStructs.cpp:2653:3: runtime error: member access within misaligned address 0x7fff39f33a30 for type 'struct XCollectedHeap', which requires 64 byte alignment
        0x7fff39f33a30: note: pointer points here
         ff ff ef 7f 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
                      ^
            #0 0x152482fb311c in operator() /jdk/src/hotspot/share/runtime/vmStructs.cpp:2653
            #1 0x152482fb311c in __static_initialization_and_destruction_0 /jdk/src/hotspot/share/runtime/vmStructs.cpp:2653
            #2 0x15249138a5e9 in call_init.part.0 (/lib64/ld-linux-x86-64.so.2+0x115e9) (BuildId: be5d0c46cde7620968b30cd3c9a737179b4f8f5f)
            #3 0x15249138a705 in _dl_init (/lib64/ld-linux-x86-64.so.2+0x11705) (BuildId: be5d0c46cde7620968b30cd3c9a737179b4f8f5f)
            #4 0x152490953fbd in _dl_catch_exception (/lib64/libc.so.6+0x156fbd) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)
            #5 0x15249138eed3 in dl_open_worker (/lib64/ld-linux-x86-64.so.2+0x15ed3) (BuildId: be5d0c46cde7620968b30cd3c9a737179b4f8f5f)
            #6 0x15249095402c in _dl_catch_exception (/lib64/libc.so.6+0x15702c) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)
            #7 0x15249138e28a in _dl_open (/lib64/ld-linux-x86-64.so.2+0x1528a) (BuildId: be5d0c46cde7620968b30cd3c9a737179b4f8f5f)
            #8 0x1524913203b5 in dlopen_doit (/lib64/libdl.so.2+0x13b5) (BuildId: d217b228882341aeb761264b83415f7458617268)
            #9 0x15249095402c in _dl_catch_exception (/lib64/libc.so.6+0x15702c) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)
            #10 0x1524909540be in _dl_catch_error (/lib64/libc.so.6+0x1570be) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)
           ... (rest of output omitted)

        Attachments

          Issue Links

            Activity

              People

                mbaesken Matthias Baesken
                mbaesken Matthias Baesken
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: