Skip to content

Conversation

@JDevlieghere
Copy link
Member

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

The error message emitted by libmalloc changed in macOS 26. Update the
test to support both.
@llvmbot llvmbot added the lldb label Aug 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 18, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

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


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

1 Files Affected:

  • (modified) lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py (+17-8)
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

@JDevlieghere JDevlieghere merged commit 4cecbee into llvm:main Aug 19, 2025
11 checks passed
@JDevlieghere JDevlieghere deleted the TestProcessCrashInfo-take-2 branch August 19, 2025 17:49
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Nov 4, 2025
The error message emitted by libmalloc changed in macOS 26. Update the
test to support both.

(cherry picked from commit 4cecbee)
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Nov 5, 2025
[lldb] Support error variations in TestProcessCrashInfo.py (llvm#154202)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants