[Lldb-commits] [PATCH] D97230: [lldb] [test] Workaround symlink-related create_after_attach test failure

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 22 14:43:20 PST 2021


mgorny created this revision.
mgorny added reviewers: labath, emaste, krytarowski.
Herald added a subscriber: arichardson.
mgorny requested review of this revision.

Use realpath() when spawning the executable create_after_attach
to workaround a FreeBSD plugin (and possibly others) problem.
If the executable is started via a path containing a symlink, it is
added to the module list twice -- via the real and apparent path.
This in turn cases the requested breakpoint to resolve twice.

Since the problem is non-trivial to fix and the purpose of this test
is not to verify that image list does not contain duplicates, let's
apply a trivial workaround to make it pass.


https://reviews.llvm.org/D97230

Files:
  lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py


Index: lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
===================================================================
--- lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -25,7 +25,6 @@
     # Occasionally hangs on Windows, may be same as other issues.
     @skipIfWindows
     @skipIfiOSSimulator
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48376")
     @expectedFailureNetBSD
     def test_create_after_attach(self):
         """Test thread creation after process attach."""
@@ -33,7 +32,8 @@
         exe = self.getBuildArtifact("a.out")
 
         # Spawn a new process
-        popen = self.spawnSubprocess(exe)
+        # use realpath to workaround llvm.org/pr48376
+        popen = self.spawnSubprocess(os.path.realpath(exe))
         pid = popen.pid
 
         # Attach to the spawned process


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97230.325576.patch
Type: text/x-patch
Size: 985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210222/8d820c8c/attachment.bin>


More information about the lldb-commits mailing list