Skip to content

Conversation

@da-viper
Copy link
Contributor

CoreDumping in /proc/pid/stat was added in kernel 4.15, this causes the test to fail in older kernel versions. see https://man7.org/linux/man-pages/man5/proc_pid_status.5.html

CoreDumping in /proc/pid/stat was added in kernel 4.15, this causes the test to fail in older versions.
see https://man7.org/linux/man-pages/man5/proc_pid_status.5.html
@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2025

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

Changes

CoreDumping in /proc/pid/stat was added in kernel 4.15, this causes the test to fail in older kernel versions. see https://man7.org/linux/man-pages/man5/proc_pid_status.5.html


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

1 Files Affected:

  • (modified) lldb/unittests/Host/posix/HostTest.cpp (+9)
diff --git a/lldb/unittests/Host/posix/HostTest.cpp b/lldb/unittests/Host/posix/HostTest.cpp
index 082edccf4e774..7bb44c99bc998 100644
--- a/lldb/unittests/Host/posix/HostTest.cpp
+++ b/lldb/unittests/Host/posix/HostTest.cpp
@@ -15,6 +15,10 @@
 #include <cerrno>
 #include <sys/resource.h>
 
+#ifdef __linux__
+#include <linux/version.h>
+#endif // __linux__
+
 using namespace lldb_private;
 
 namespace {
@@ -116,7 +120,12 @@ TEST_F(HostTest, GetProcessInfoSetsPriority) {
   ASSERT_TRUE(Info.IsZombie().has_value());
   ASSERT_FALSE(Info.IsZombie().value());
 
+  // CoreDumping was added in kernel version 4.15 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
   ASSERT_TRUE(Info.IsCoreDumping().has_value());
   ASSERT_FALSE(Info.IsCoreDumping().value());
+#else
+  ASSERT_FALSE(Info.IsCoreDumping().has_value());
+#endif
 }
 #endif

@github-actions
Copy link

github-actions bot commented Sep 23, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@Jlalond
Copy link
Contributor

Jlalond commented Sep 24, 2025

CoreDumping in /proc/pid/stat was added in kernel 4.15, this causes the test to fail in older kernel versions. see https://man7.org/linux/man-pages/man5/proc_pid_status.5.html

Note, it's /proc/pid/status not stat for the coredumping field.

@da-viper da-viper merged commit 02d8fb5 into llvm:main Sep 25, 2025
9 checks passed
@da-viper da-viper deleted the linux-version-check branch September 25, 2025 08:54
da-viper added a commit to swiftlang/llvm-project that referenced this pull request Sep 25, 2025
CoreDumping in /proc/<pid>/status was added in kernel 4.15, this causes the
test to fail in older kernel versions. see
https://man7.org/linux/man-pages/man5/proc_pid_status.5.html

(cherry picked from commit 02d8fb5)
da-viper added a commit to swiftlang/llvm-project that referenced this pull request Sep 25, 2025
…1496)

CoreDumping in /proc/<pid>/status was added in kernel 4.15, this causes the
test to fail in older kernel versions. see
https://man7.org/linux/man-pages/man5/proc_pid_status.5.html

(cherry picked from commit 02d8fb5)
@mysterymath
Copy link
Contributor

This appears to be breaking the Fuchsia Linux toolchain LLDB builders: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/lldb-linux-arm64/b8702712918947567569/overview

IIRC, we ship with Linux headers much older than the running kernel to ensure that we can run on old (as well as newer) kernels. I'd think this kind of runtime behavior checking should be done through a runtime mechanism, not a compile-time one. (Maybe uname?)

@da-viper
Copy link
Contributor Author

Will update to use runtime check

da-viper added a commit to da-viper/llvm-project that referenced this pull request Sep 30, 2025
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
CoreDumping in /proc/<pid>/status was added in kernel 4.15, this causes the
test to fail in older kernel versions. see
https://man7.org/linux/man-pages/man5/proc_pid_status.5.html
mysterymath added a commit that referenced this pull request Oct 3, 2025
#160333 reimplementation but at runtime instead because of broken CI.

---------

Co-authored-by: Michael Buch <[email protected]>
Co-authored-by: Daniel Thornburgh <[email protected]>
da-viper added a commit to da-viper/llvm-project that referenced this pull request Nov 6, 2025
llvm#160333 reimplementation but at runtime instead because of broken CI.

---------

Co-authored-by: Michael Buch <[email protected]>
Co-authored-by: Daniel Thornburgh <[email protected]>
(cherry picked from commit c488dca)
da-viper added a commit to swiftlang/llvm-project that referenced this pull request Nov 7, 2025
… (#11767)

llvm#160333 reimplementation but at runtime instead because of broken CI.

---------



(cherry picked from commit c488dca)

Co-authored-by: Michael Buch <[email protected]>
Co-authored-by: Daniel Thornburgh <[email protected]>
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.

4 participants