[Lldb-commits] [lldb] [lldb] Fix SIGSEGV in `GetPtraceScope()` in `Procfs.cpp` (PR #142224)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 2 10:24:17 PDT 2025


================
@@ -120,6 +120,21 @@ TEST(Perf, RealPtraceScope) {
       << "Sensible values of ptrace_scope are between 0 and 3";
 }
 
+TEST(Perf, RealPtraceScopeWhenNotExist) {
+  // We first check we can NOT read /proc/sys/kernel/yama/ptrace_scope
+  auto buffer_or_error =
+      errorOrToExpected(getProcFile("sys/kernel/yama/ptrace_scope"));
+  if (buffer_or_error)
+    GTEST_SKIP() << "In order for this test to run, "
+                    "/proc/sys/kernel/yama/ptrace_scope should not exist";
----------------
clayborg wrote:

Looks like GTEST_SKIP does do an early return somehow after checking the documentation.

https://github.com/llvm/llvm-project/pull/142224


More information about the lldb-commits mailing list