-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[lldb][test] check if CoreDumping info is supported #160333
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
Conversation
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
|
@llvm/pr-subscribers-lldb Author: Ebuka Ezike (da-viper) ChangesCoreDumping 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:
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
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Note, it's |
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)
…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)
|
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 |
|
Will update to use runtime check |
)" This reverts commit 02d8fb5.
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
#160333 reimplementation but at runtime instead because of broken CI. --------- Co-authored-by: Michael Buch <[email protected]> Co-authored-by: Daniel Thornburgh <[email protected]>
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)
… (#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]>
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