[all-commits] [llvm/llvm-project] 52c1d2: [PassManagerBuilder] Remove global extension when ...

Elia Geretto via All-commits all-commits at lists.llvm.org
Wed Jan 29 12:44:18 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 52c1d209acec58b393290a5a126aa6f1d38beb1e
      https://github.com/llvm/llvm-project/commit/52c1d209acec58b393290a5a126aa6f1d38beb1e
  Author: Elia Geretto <elia.f.geretto at gmail.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
    M llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

  Log Message:
  -----------
  [PassManagerBuilder] Remove global extension when a plugin is unloaded

This commit fixes PR39321.

GlobalExtensions is not guaranteed to be destroyed when optimizer plugins are unloaded. If it is indeed destroyed after a plugin is dlclose-d, the destructor of the corresponding ExtensionFn is not mapped anymore, causing a call to unmapped memory during destruction.

This commit guarantees that extensions coming from external plugins are removed from GlobalExtensions when the plugin is unloaded if GlobalExtensions has not been destroyed yet.

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

(cherry picked from commit ab2300bc154f7bed43f85f74fd3fe31be71d90e0)




More information about the All-commits mailing list