Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-84627

UBSAN builds on the ARM virtual workstations crash in libunwind

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • v8.0
    • Service Arch 2024-02-05, Service Arch 2024-02-19, Service Arch 2024-03-04, Service Arch 2024-03-18, Service Arch 2024-04-01, Service Arch 2024-05-13, Programmability 2024-07-22, Programmability 2024-08-05
    • 0

      UBSAN builds produced on the ARM virtual workstations crash in libunwind because of an array out-of-bounds access (snippet included below). The crash doesn't happen with --allocator=system.

      billy.donahue@mongodb.com discovered a known bug in libunwind which has been been fixed (here and here), so I am filing this ticket to request that we vendor-in the latest libunwind and take advantage of the improved ARM support.

      (python3-venv) ubuntu@kal-virtual-workstation:~/workspace/mongo$ buildscripts/scons.py -j128 ICECC=icecc --ssl --build-tools=next --variables-files=etc/scons/developer_versions.vars --variables-files=etc/scons/mongodbtoolchain_stable_clang.vars VARIANT_DIR=ubsan DESTDIR=build/install_ubsan GDB_INDEX=0 --dbg=on --opt=on --sanitize=undefined +db_update_test
      ...
      Install file: "build/ubsan/mongo/db/update/db_update_test" as "build/install_ubsan/bin/db_update_test"
      /bin/icerun build/install_ubsan/bin/db_update_test
      src/third_party/unwind/dist/src/aarch64/Ginit.c:50:13: runtime error: index 32 out of bounds for type 'uint64_t [31]'
          #0 0xaaaae04e6134 in uc_addr /home/ubuntu/workspace/mongo/src/third_party/unwind/dist/src/aarch64/Ginit.c:50:13
          #1 0xaaaae04e73e8 in common_init /home/ubuntu/workspace/mongo/src/third_party/unwind/dist/src/aarch64/init.h:65:35
          #2 0xaaaae04c8c60 in GetStackTrace_libunwind(void**, int, int) /home/ubuntu/workspace/mongo/src/third_party/gperftools/dist/src/stacktrace_libunwind-inl.h:116:13
          #3 0xaaaae04c907c in maybe_convert_libunwind_to_generic_fp() /home/ubuntu/workspace/mongo/src/third_party/gperftools/dist/src/stacktrace.cc:353:12
          #4 0xaaaae04c9d50 in init_default_stack_impl() /home/ubuntu/workspace/mongo/src/third_party/gperftools/dist/src/stacktrace.cc:385:3
          #5 0xaaaae04c9edc in (anonymous namespace)::google_init_module_stacktrace_init_default_stack_impl() /home/ubuntu/workspace/mongo/src/third_party/gperftools/dist/src/stacktrace.cc:396:1
          #6 0xaaaae04c9edc in GoogleInitializer::GoogleInitializer(char const*, void (*)(), void (*)()) /home/ubuntu/workspace/mongo/src/third_party/gperftools/dist/src/base/googleinit.h:46:7
          #7 0xaaaae04c9edc in __cxx_global_var_init /home/ubuntu/workspace/mongo/src/third_party/gperftools/dist/src/stacktrace.cc:396:1
          #8 0xaaaae04c9edc in _GLOBAL__sub_I_stacktrace.cc /home/ubuntu/workspace/mongo/src/third_party/gperftools/dist/src/stacktrace.cc
          #9 0xffff911e7548 in call_init csu/../csu/libc-start.c:145:3
          #10 0xffff911e7548 in __libc_start_main csu/../csu/libc-start.c:379:5
          #11 0xaaaadd1a676c in _start (/home/ubuntu/workspace/mongo/build/install_ubsan/bin/db_update_test+0xa49676c)
      
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/third_party/unwind/dist/src/aarch64/Ginit.c:50:13 in
      scons: *** [+db_update_test] Error 1
      scons: building terminated because of errors.
      +db_update_test failed: Error 1
      (python3-venv) ubuntu@kal-virtual-workstation:~/workspace/mongo$ build/install_ubsan/bin/db_update_test
      src/third_party/unwind/dist/src/aarch64/Ginit.c:50:13: runtime error: index 32 out of bounds for type 'uint64_t [31]'
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/third_party/unwind/dist/src/aarch64/Ginit.c:50:13 in
      

            Assignee:
            blake.oler@mongodb.com Blake Oler
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: