[Lldb-commits] [lldb] [lldb/crashlog] Enforce image loading policy (PR #91109)

via lldb-commits lldb-commits at lists.llvm.org
Sat May 4 23:53:39 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

<details>
<summary>Changes</summary>

Starting `27f27d1`, we changed the image loading logic to conform to the various options (`-a|--load-all` & `-c|--crashed-only`) and set the `resolve` attribute of the matching images.

Then, we would try to load all those images concurrently. However, the `symbolicator.Image.add_module` method didn't check the `resolve` attribute to skip unwanted images, causing all images to be loaded in the target everytime. This matches the `-a|--load-all` option behaviour but it can cause lldb to load thousands of images, which can take a very long time if the images are downloaded over the network.

This patch fixes that issue by checking the `Image.resolve` attribute to conform to the user selection, and reinstates the expected default behaviour, by only loading the crashed thread images and skipping all the others.

rdar://123694062

---
Full diff: https://github.com/llvm/llvm-project/pull/91109.diff


1 Files Affected:

- (modified) lldb/examples/python/symbolication.py (+6) 


``````````diff
diff --git a/lldb/examples/python/symbolication.py b/lldb/examples/python/symbolication.py
index f6dcc8b9a79437..f247ebf3da733a 100755
--- a/lldb/examples/python/symbolication.py
+++ b/lldb/examples/python/symbolication.py
@@ -399,6 +399,12 @@ def add_module(self, target, obj_dir=None):
         if not self.path and self.uuid == uuid.UUID(int=0):
             return "error: invalid image"
 
+        if not self.resolve:
+            # Since this method get called concurrently on every crashlog image,
+            # we should only add the images marked to be resolved and skip the
+            # others.
+            return None
+
         if target:
             # Try and find using UUID only first so that paths need not match
             # up

``````````

</details>


https://github.com/llvm/llvm-project/pull/91109


More information about the lldb-commits mailing list