[llvm] r289070 - Fix ASAN buildbots by fixing a double free crash.

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 13:47:47 PST 2016


Still now we have a new issue:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/1252/steps/check-llvm%20asan/logs/stdio

On Thu, Dec 8, 2016 at 9:07 AM Greg Clayton via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: gclayton
> Date: Thu Dec  8 10:57:04 2016
> New Revision: 289070
>
> URL: http://llvm.org/viewvc/llvm-project?rev=289070&view=rev
> Log:
> Fix ASAN buildbots by fixing a double free crash.
>
> The dwarfgen::Generator::StringPool was in a unique_ptr but it was owned
> by the Allocator member variable so it was being free twice.
>
>
> Modified:
>     llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
>     llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h
>
> Modified: llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp?rev=289070&r1=289069&r2=289070&view=diff
>
> ==============================================================================
> --- llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp (original)
> +++ llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.cpp Thu Dec  8
> 10:57:04 2016
> @@ -110,7 +110,9 @@ dwarfgen::DIE dwarfgen::CompileUnit::get
>  /// dwarfgen::Generator implementation.
>
>  //===----------------------------------------------------------------------===//
>
> -dwarfgen::Generator::Generator() : Abbreviations(Allocator) {}
> +dwarfgen::Generator::Generator()
> +    : MAB(nullptr), MCE(nullptr), MS(nullptr), StringPool(nullptr),
> +      Abbreviations(Allocator) {}
>  dwarfgen::Generator::~Generator() = default;
>
>  llvm::Expected<std::unique_ptr<dwarfgen::Generator>>
> @@ -201,7 +203,7 @@ llvm::Error dwarfgen::Generator::init(Tr
>    MC->setDwarfVersion(Version);
>    Asm->setDwarfVersion(Version);
>
> -  StringPool.reset(new DwarfStringPool(Allocator, *Asm, StringRef()));
> +  StringPool = new DwarfStringPool(Allocator, *Asm, StringRef());
>
>    return Error::success();
>  }
>
> Modified: llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h?rev=289070&r1=289069&r2=289070&view=diff
>
> ==============================================================================
> --- llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h (original)
> +++ llvm/trunk/unittests/DebugInfo/DWARF/DwarfGenerator.h Thu Dec  8
> 10:57:04 2016
> @@ -170,7 +170,7 @@ class Generator {
>    MCStreamer *MS;     // Owned by AsmPrinter
>    std::unique_ptr<TargetMachine> TM;
>    std::unique_ptr<AsmPrinter> Asm;
> -  std::unique_ptr<DwarfStringPool> StringPool;
> +  DwarfStringPool *StringPool; // Owned by Allocator
>    std::vector<std::unique_ptr<CompileUnit>> CompileUnits;
>    BumpPtrAllocator Allocator;
>    DIEAbbrevSet Abbreviations;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161208/ee8b9763/attachment.html>


More information about the llvm-commits mailing list