[all-commits] [llvm/llvm-project] 15664f: [scudo][standalone] Fix for releaseToOS prior to init

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Mon Nov 25 08:38:59 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 15664fe2c48be242b4b38422466246e9592b6670
      https://github.com/llvm/llvm-project/commit/15664fe2c48be242b4b38422466246e9592b6670
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2019-11-25 (Mon, 25 Nov 2019)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp

  Log Message:
  -----------
  [scudo][standalone] Fix for releaseToOS prior to init

Summary:
cferris@ found an issue where calling `releaseToOS` prior to any other
heap operation would lead to a crash, due to the allocator not being
properly initialized (it was discovered via `mallopt`).

The fix is to call `initThreadMaybe` prior to calling `releaseToOS` for
the Primary.

Add a test that crashes prior to fix.

Reviewers: hctim, cferris, pcc, eugenis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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




More information about the All-commits mailing list