[Lldb-commits] [PATCH] D59177: [lldb] [test] Make 2lwp_process_SIGSEGV test more portable

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Mar 10 01:49:54 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL355786: [lldb] [test] Make 2lwp_process_SIGSEGV test more portable (authored by mgorny, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D59177?vs=190004&id=190007#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59177/new/

https://reviews.llvm.org/D59177

Files:
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.amd64.core
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
  lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/2lwp_process_SIGSEGV.c
@@ -4,9 +4,12 @@
 #include <unistd.h>
 #include <signal.h>
 
+volatile int sem = 0;
+
 static void bar() {
   char F = 'b';
-  kill(getpid(), SIGSEGV); // Frame bar
+  sem = 1;
+  while (1) continue; // Frame bar
 }
 
 static void foo(void (*boomer)()) {
@@ -28,5 +31,7 @@
   stack = malloc(ssize);
   _lwp_makecontext(&uc, lwp_main, NULL, NULL, stack, ssize);
   _lwp_create(&uc, 0, &lid);
+  while (sem != 1) continue;
+  kill(getpid(), SIGSEGV);
   _lwp_wait(lid, NULL);
 }
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
@@ -206,11 +206,10 @@
         thread = process.GetSelectedThread()
         self.assertTrue(thread)
         self.assertEqual(thread.GetThreadID(), 2)
-        self.assertEqual(thread.GetThreadID(), 2)
         self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)
         self.assertEqual(thread.GetStopReasonDataCount(), 1)
         self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
-        backtrace = ["_kill", "bar", "foo", "lwp_main"]
+        backtrace = ["bar", "foo", "lwp_main"]
         self.check_backtrace(thread, filename, backtrace)
 
         # thread 1 should have the same signal
@@ -219,8 +218,7 @@
         self.assertEqual(thread.GetStopReasonDataCount(), 1)
         self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
 
-    @skipIf  # TODO: fails with non-netbsd libc
     @skipIfLLVMTargetMissing("X86")
     def test_amd64(self):
         """Test double-threaded amd64 core dump where process is signalled."""
-        self.do_test("2lwp_process_SIGSEGV.amd64", pid=141, region_count=24)
+        self.do_test("2lwp_process_SIGSEGV.amd64", pid=665, region_count=24)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59177.190007.patch
Type: text/x-patch
Size: 2394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190310/aa453bd6/attachment.bin>


More information about the lldb-commits mailing list