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

ubsan error: templateTable.cpp:62:3: runtime error: call to function TemplateTable::nop() through pointer to incorrect function type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • 23
    • hotspot
    • x86_64
    • generic

      When using ubsan we run into the following error :

      src/hotspot/share/interpreter/templateTable.cpp:62:3: runtime error: call to function TemplateTable::nop() through pointer to incorrect function type 'void (*)(int)'
      templateTable_x86.cpp:258: note: TemplateTable::nop() defined here
          #0 0x1225c96b2 in Template::generate(InterpreterMacroAssembler*) templateTable.cpp:62
          #1 0x1225af68c in TemplateInterpreterGenerator::generate_and_dispatch(Template*, TosState) templateInterpreterGenerator.cpp:394
          #2 0x1225c1e71 in TemplateInterpreterGenerator::set_vtos_entry_points(Template*, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&, unsigned char*&) templateInterpreterGenerator_x86.cpp:1785
          #3 0x1225adf21 in TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code) templateInterpreterGenerator.cpp:327
          #4 0x1225add23 in TemplateInterpreterGenerator::set_entry_points_for_all_bytes() templateInterpreterGenerator.cpp:283
          #5 0x1225ac70c in TemplateInterpreterGenerator::generate_all() templateInterpreterGenerator.cpp:241
          #6 0x1225a685e in TemplateInterpreter::initialize_code() templateInterpreter.cpp:67
          #7 0x121903666 in interpreter_init_code() interpreter.cpp:142
          #8 0x1218bef60 in init_globals2() init.cpp:156
          #9 0x122620dee in Threads::create_vm(JavaVMInitArgs*, bool*) threads.cpp:572
          #10 0x121a8c4ab in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) jni.cpp:3581
          #11 0x10f2d071c in JavaMain java.c:491
          #12 0x10f2d7248 in ThreadJavaMain java_md_macosx.m:720
         ... (rest of output omitted)

      Reason is a mismatch of the generator function typedef compared to the real interface.
      The generator function is

        typedef void (*generator)(int arg);

      But TemplateTable::nop() is 'void (*)(int)' .

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

              Created:
              Updated: