Author: Jonas Devlieghere
Date: 2025-08-19T10:49:23-07:00
New Revision: 4cecbeed4f4558df9cd221afaaa38e2281d133a2

URL: 
https://github.com/llvm/llvm-project/commit/4cecbeed4f4558df9cd221afaaa38e2281d133a2
DIFF: 
https://github.com/llvm/llvm-project/commit/4cecbeed4f4558df9cd221afaaa38e2281d133a2.diff

LOG: [lldb] Support error variations in TestProcessCrashInfo.py (#154202)

The error message emitted by libmalloc changed in macOS 26. Update the
test to support both.

Added: 
    

Modified: 
    lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py

Removed: 
    


################################################################################
diff  --git 
a/lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py 
b/lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py
index af05c2f3a0f62..c143da2bf94fb 100644
--- a/lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py
+++ b/lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py
@@ -22,6 +22,15 @@ def tearDown(self):
         self.runCmd("settings clear auto-confirm")
         TestBase.tearDown(self)
 
+    def containsLibmallocError(self, output):
+        for error in [
+            "pointer being freed was not allocated",
+            "not an allocated block",
+        ]:
+            if error in output:
+                return True
+        return False
+
     @skipIfAsan  # The test process intentionally double-frees.
     @skipUnlessDarwin
     def test_cli(self):
@@ -33,15 +42,15 @@ def test_cli(self):
 
         self.expect("process launch", patterns=["Process .* launched: 
.*a.out"])
 
-        self.expect(
-            "process status --verbose",
-            patterns=[
-                "Extended Crash Information",
-                "Crash-Info Annotations",
-                "pointer being freed was not allocated",
-            ],
+        result = lldb.SBCommandReturnObject()
+        self.dbg.GetCommandInterpreter().HandleCommand(
+            "process status --verbose", result
         )
 
+        self.assertIn("Extended Crash Information", result.GetOutput())
+        self.assertIn("Crash-Info Annotations", result.GetOutput())
+        self.assertTrue(self.containsLibmallocError(result.GetOutput()))
+
     @skipIfAsan  # The test process intentionally hits a memory bug.
     @skipUnlessDarwin
     def test_api(self):
@@ -67,7 +76,7 @@ def test_api(self):
 
         self.assertTrue(crash_info.IsValid())
 
-        self.assertIn("pointer being freed was not allocated", 
stream.GetData())
+        self.assertTrue(self.containsLibmallocError(stream.GetData()))
 
     # dyld leaves permanent crash_info records when testing on device.
     @skipIfDarwinEmbedded


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to