[all-commits] [llvm/llvm-project] a83a82: Make sure the interpreter module was loaded before...

António Afonso via All-commits all-commits at lists.llvm.org
Sun Feb 21 09:28:50 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a83a825e9902b54b315870e9ed85723525208f09
      https://github.com/llvm/llvm-project/commit/a83a825e9902b54b315870e9ed85723525208f09
  Author: António Afonso <antonio.afonso at gmail.com>
  Date:   2021-02-21 (Sun, 21 Feb 2021)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/decorators.py
    M lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    A lldb/test/API/functionalities/module_load_attach/Makefile
    A lldb/test/API/functionalities/module_load_attach/TestModuleLoadAttach.py
    A lldb/test/API/functionalities/module_load_attach/feature.c
    A lldb/test/API/functionalities/module_load_attach/main.c

  Log Message:
  -----------
  Make sure the interpreter module was loaded before making checks against it

This issue was introduced in https://reviews.llvm.org/D92187.
The guard I'm changing were is supposed to act when linux is loading the linker for the second time (due to differences in paths like symlinks).
This is done by checking `module_sp != m_interpreter_module.lock()` however this will be true when `m_interpreter_module` wasn't initialized, making linux unload the linker module (the most visible result here is that lldb will stop getting notified about new modules loaded by the process, because it can't set the rendezvous breakpoint again after the stepping over it once).
The `m_interpreter_module` is not getting initialize when it goes through this path: https://github.com/llvm/llvm-project/blob/dbfdb139f75470a9abc78e7c9faf743fdd963c2d/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp#L332, which happens when lldb was able to read the address from the dynamic section of the executable.

What I'm not sure about though, is if when we go through this path if we still load the linker twice on linux. If that's the case then it means we need to somehow set the m_interpreter_module instead of the fix I provide here. I've only tested this on Android.

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




More information about the All-commits mailing list