[all-commits] [llvm/llvm-project] 2cf696: [lldb/DWARF] Fix a split-dwarf crash while parsing...

Pavel Labath via All-commits all-commits at lists.llvm.org
Wed Apr 29 07:21:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2cf69684fb3089a2cde46fc9eac22dd6b8475b5f
      https://github.com/llvm/llvm-project/commit/2cf69684fb3089a2cde46fc9eac22dd6b8475b5f
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2020-04-29 (Wed, 29 Apr 2020)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    A lldb/test/Shell/SymbolFile/DWARF/split-dwarf-expression-eval-bug.cpp

  Log Message:
  -----------
  [lldb/DWARF] Fix a split-dwarf crash while parsing compile units

The cause of this crash is relatively simple -- we are using a
SymbolFileDWARFDwo to parse a (skeleton) dwarf unit. This cause the
CompileUnit to be created with the wrong ID, which later triggers an
assertion in SymbolFile::SetCompileUnitAtIndex. The fix is also simple
-- ensure we use the right symbol file for parsing.

However, a fairly elaborate setup is needed trigger this bug, because
ParseCompileUnit is normally called very early on (and with the right
symbol file object) during the process of accessing a compile unit.
The only way this can be triggered is if the DWARF unit is
"accidentally" pulled into scope during expression evaluation
This can happen if the "this" object used for the context of an
expression is in a namespace, and that namespace is also present in
other compile units

The included test recreates this setup.




More information about the All-commits mailing list