[all-commits] [llvm/llvm-project] 62a2fe: [BOLT] Fix state of MCSymbols in lowering pass

Rafael Auler via All-commits all-commits at lists.llvm.org
Tue May 16 14:54:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 62a2feff5784bcee3c7b037501956552acdf736c
      https://github.com/llvm/llvm-project/commit/62a2feff5784bcee3c7b037501956552acdf736c
  Author: Rafael Auler <rafaelauler at fb.com>
  Date:   2023-05-16 (Tue, 16 May 2023)

  Changed paths:
    M bolt/include/bolt/Passes/BinaryPasses.h
    M bolt/lib/Passes/BinaryPasses.cpp
    M bolt/lib/Rewrite/BinaryPassManager.cpp

  Log Message:
  -----------
  [BOLT] Fix state of MCSymbols in lowering pass

We have mostly harmless data races when running
BinaryContext::calculateEmittedSize() in parallel, while performing
split function pass.  However, it is possible to end up in a state
where some MCSymbols are still registered and our clean up
failed. This happens rarely but it does happen, and when it happens,
it is a difficult to diagnose heisenbug. To avoid this, add a new
clean pass to perform a last check on MCSymbols, before they
undergo our final emission pass, to verify that they are in a sane
state. If we fail to do this, we might resolve some symbols to zero
and crash the output binary.

Reviewed By: #bolt, Amir

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




More information about the All-commits mailing list