[all-commits] [llvm/llvm-project] fb2819: [BOLT] Fix intermittent crash with instrumentation

maksfb via All-commits all-commits at lists.llvm.org
Mon Feb 27 14:11:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb28196a642a12599c1251b9d1587b398a479fca
      https://github.com/llvm/llvm-project/commit/fb28196a642a12599c1251b9d1587b398a479fca
  Author: Maksim Panchenko <maks at fb.com>
  Date:   2023-02-27 (Mon, 27 Feb 2023)

  Changed paths:
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/lib/Core/MCPlusBuilder.cpp
    M bolt/lib/Passes/Instrumentation.cpp
    M bolt/lib/Target/X86/X86MCPlusBuilder.cpp

  Log Message:
  -----------
  [BOLT] Fix intermittent crash with instrumentation

When createInstrumentedIndirectCall() was invoked for tail calls, we
attached annotation instruction twice to the new call instruction.
First in createDirectCall(), and then again while copying over the
metadata operands.

As a result, the annotations were not properly stripped for such calls
before the call to freeAnnotations() in LowerAnnotations pass. That lead
to use-after-free while restoring the offsets with setOffset() call.

Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D144806




More information about the All-commits mailing list