Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb][test][FreeBSD] Fix some concurrent event tests #84155

Merged
merged 1 commit into from
May 15, 2024

Conversation

DavidSpickett
Copy link
Collaborator

A lot of TestConcurrent*.py expect one of the threads to crash, but we weren't checking for it properly.

Possibly because signal reporting got better on FreeBSD at some point, and it now shows the same info as Linux does.

  lldb-api :: functionalities/inferior-changed/TestInferiorChanged.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashing.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashingStep.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py

Fixes #48777

TestConcurrentTwoBreakpointsOneSignal.py no longer fails, at least on an AWS instance, so I've removed the xfail there.

A lot of `TestConcurrent*.py` expect one of the threads to crash,
but we weren't checking for it properly.

Possibly because signal reporting got better on FreeBSD at some point,
and it now shows the same info as Linux does.

```
  lldb-api :: functionalities/inferior-changed/TestInferiorChanged.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashing.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashingStep.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py
```

Fixes llvm#48777

`TestConcurrentTwoBreakpointsOneSignal.py` no longer fails, at least on
an AWS instance, so I've removed the xfail there.
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 6, 2024

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

Changes

A lot of TestConcurrent*.py expect one of the threads to crash, but we weren't checking for it properly.

Possibly because signal reporting got better on FreeBSD at some point, and it now shows the same info as Linux does.

  lldb-api :: functionalities/inferior-changed/TestInferiorChanged.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashing.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashingStep.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py

Fixes #48777

TestConcurrentTwoBreakpointsOneSignal.py no longer fails, at least on an AWS instance, so I've removed the xfail there.


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

2 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/lldbutil.py (+1-1)
  • (modified) lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py (-3)
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index 58eb37fd742d73..32f52ec6c0f538 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -809,7 +809,7 @@ def is_thread_crashed(test, thread):
             thread.GetStopReason() == lldb.eStopReasonException
             and "EXC_BAD_ACCESS" in thread.GetStopDescription(100)
         )
-    elif test.getPlatform() == "linux":
+    elif test.getPlatform() in ["linux", "freebsd"]:
         return (
             thread.GetStopReason() == lldb.eStopReasonSignal
             and thread.GetStopReasonDataAtIndex(0)
diff --git a/lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py b/lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py
index c66905af9e92df..4960c4b241fb8b 100644
--- a/lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py
+++ b/lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py
@@ -8,9 +8,6 @@ class ConcurrentTwoBreakpointsOneSignal(ConcurrentEventsBase):
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple="^mips")
     @expectedFlakeyNetBSD
-    @expectedFailureAll(
-        archs=["aarch64"], oslist=["freebsd"], bugnumber="llvm.org/pr49433"
-    )
     def test(self):
         """Test two threads that trigger a breakpoint and one signal thread."""
         self.build()

@DavidSpickett
Copy link
Collaborator Author

DavidSpickett commented Mar 6, 2024

This assumes that Jim's patch (https://reviews.llvm.org/D129814) fixed the TestConcurrentTwoBreakpointsOneSignal issue, and not the fact that I'm using an AWS instance instead of QEMU.

I can remove that change if it seems like a risk.

@emaste
Copy link
Member

emaste commented May 1, 2024

Yes I think it's likely fixed. I'll give it a try on my FreeBSD laptop shortly.

@DavidSpickett
Copy link
Collaborator Author

Ok for me to land this or are you still going to check them locally?

@DavidSpickett
Copy link
Collaborator Author

I'm going to go ahead and land this, don't hesitate to revert if there are still problems.

@DavidSpickett DavidSpickett merged commit 03bdfb6 into llvm:main May 15, 2024
6 checks passed
@DavidSpickett DavidSpickett deleted the bsd-concurrent branch May 15, 2024 10:25
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.

concurrent_events tests: wrong breakpoint hit with multiple concurrent breakpoints
3 participants