[all-commits] [llvm/llvm-project] a1a1a4: [lldb] Handle an empty SBMemoryRegionInfo from scr...

Jason Molenda via All-commits all-commits at lists.llvm.org
Fri Nov 15 00:26:31 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a1a1a4ced9d4ecba428175c45a24da476bdc55f4
      https://github.com/llvm/llvm-project/commit/a1a1a4ced9d4ecba428175c45a24da476bdc55f4
  Author: Jason Molenda <jmolenda at apple.com>
  Date:   2024-11-15 (Fri, 15 Nov 2024)

  Changed paths:
    M lldb/source/Target/Process.cpp
    A lldb/test/API/functionalities/scripted_process_empty_memory_region/Makefile
    A lldb/test/API/functionalities/scripted_process_empty_memory_region/TestScriptedProcessEmptyMemoryRegion.py
    A lldb/test/API/functionalities/scripted_process_empty_memory_region/dummy_scripted_process.py
    A lldb/test/API/functionalities/scripted_process_empty_memory_region/main.c

  Log Message:
  -----------
  [lldb] Handle an empty SBMemoryRegionInfo from scripted process (#115963)

A scripted process implementation might return an SBMemoryRegionInfo
object in its implementation of `get_memory_region_containing_address`
which will have an address 0 and size 0, without realizing the problems
this can cause. Several algorithms in lldb will try to iterate over the
MemoryRegions of the process, starting at address 0 and expecting to
iterate up to the highest vm address, stepping by the size of each
region, so a 0-length region will result in an infinite loop. Add a
check to Process::GetMemoryRegionInfo that rejects a MemoryRegion which
does not contain the requested address; a 0-length memory region will
therefor always be rejected.

rdar://139678032



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list