diff --git a/.crash-gcore-command.metadata b/.crash-gcore-command.metadata deleted file mode 100644 index c7e70ff..0000000 --- a/.crash-gcore-command.metadata +++ /dev/null @@ -1 +0,0 @@ -2c15b78c28ef2e71307e826a5a7912346b4c4d2a SOURCES/crash-gcore-command-1.6.4.tar.gz diff --git a/.gitignore b/.gitignore index 3a19bba..4eba4e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/crash-gcore-command-1.6.4.tar.gz +crash-gcore-command-1.6.4.tar.gz diff --git a/SOURCES/0001-gcore-update-set_context-with-upstream-counterpart.patch b/0001-gcore-update-set_context-with-upstream-counterpart.patch similarity index 100% rename from SOURCES/0001-gcore-update-set_context-with-upstream-counterpart.patch rename to 0001-gcore-update-set_context-with-upstream-counterpart.patch diff --git a/0001-x86-fix-extend-gcore.so-taking-much-time-like-more-t.patch b/0001-x86-fix-extend-gcore.so-taking-much-time-like-more-t.patch new file mode 100644 index 0000000..ddaf607 --- /dev/null +++ b/0001-x86-fix-extend-gcore.so-taking-much-time-like-more-t.patch @@ -0,0 +1,66 @@ +From b3af265aa60251f282145bb0eee3b83d8a15ebb7 Mon Sep 17 00:00:00 2001 +From: HATAYAMA Daisuke +Date: Mon, 18 Sep 2023 20:45:11 -0400 +Subject: [PATCH] x86: fix extend gcore.so taking much time like more than 1 + hour when huge thread group is present + +extend gcore.so command takes lengthy time such as more than 1 hour +when huge thread group is present. + +The root cause of this issue is that we never take into account time +complexity of function gcore_arch_vsyscall_has_vm_alwaysdump_flag() +sufficiently, which iterates the task list and vma lists of each task +to detect existence of VM_ALWAYS flag in a given crash dump and so has +O(nm) where the n is the length of the task list and the m is the +total number of vma among all tasks. + +To fix this issue, skip this process for the kernels whose version is +equal to or larger than v3.4.0. + +Originally, this process was implemented to detect existence of +VM_ALWAYS flag that was removed at the commit +909af768e88867016f427264ae39d27a57b6a8ed (coredump: remove +VM_ALWAYSDUMP flag) included at Linux kernel v3.4. However, the base +kernel version of RHEL7.0 GA is 3.10.0-123.el7. Hence, the kernels for +RHEL7 and later have included the commit. For RHEL7 and later, it's +sufficient to conclude absence of the flag by checking kernel version +of a given crash dump. + +The issue could still remain on RHEL6 and older, but we think it's +acceptable because today we rarely handle crash dump files of RHEL6 +and older. + +Signed-off-by: HATAYAMA Daisuke +--- + src/libgcore/gcore_x86.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/src/libgcore/gcore_x86.c b/src/libgcore/gcore_x86.c +index 8878f79..3ddf510 100644 +--- a/src/libgcore/gcore_x86.c ++++ b/src/libgcore/gcore_x86.c +@@ -2502,6 +2502,21 @@ int gcore_arch_vsyscall_has_vm_alwaysdump_flag(void) + struct task_context *tc; + int i; + ++ /* ++ * The commit 909af768e88867016f427264ae39d27a57b6a8ed ++ * (coredump: remove VM_ALWAYSDUMP flag) of the Linux kernel ++ * was merged at v3.4. We can say VM_ALWAYSDUMP flag doesn't ++ * exist for the version 3.4.0 or later. The base kernel ++ * version of RHEL7.0 GA is 3.10.0-123.el7. Hence, this ++ * condition is expected to match RHEL7 and later RHEL major ++ * versions. On the other hand, the commit ++ * 909af768e88867016f427264ae39d27a57b6a8ed was backported ++ * into the kernel package in RHEL6 and the exploring code is ++ * still needed. ++ */ ++ if (THIS_KERNEL_VERSION >= LINUX(3, 4, 0)) ++ return FALSE; ++ + /* + * For simplicity, consider that VM_ALWAYSDUMP was already not + * present when maple tree was introduced. +-- +2.47.0 + diff --git a/SOURCES/0001-x86-fix-the-issue-that-core-files-for-64-bit-tasks-a.patch b/0001-x86-fix-the-issue-that-core-files-for-64-bit-tasks-a.patch similarity index 100% rename from SOURCES/0001-x86-fix-the-issue-that-core-files-for-64-bit-tasks-a.patch rename to 0001-x86-fix-the-issue-that-core-files-for-64-bit-tasks-a.patch diff --git a/SOURCES/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch b/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch similarity index 100% rename from SOURCES/crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch rename to crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch diff --git a/SPECS/crash-gcore-command.spec b/crash-gcore-command.spec similarity index 91% rename from SPECS/crash-gcore-command.spec rename to crash-gcore-command.spec index b6907b8..78b8fe8 100644 --- a/SPECS/crash-gcore-command.spec +++ b/crash-gcore-command.spec @@ -3,7 +3,7 @@ Summary: Gcore extension module for the crash utility Name: crash-gcore-command Version: 1.6.4 -Release: 8%{?dist}.1 +Release: 9%{?dist} License: GPL-2.0-only Source0: https://github.com/fujitsu/crash-gcore/archive/v%{version}/%{name}-%{version}.tar.gz URL: https://github.com/fujitsu/crash-gcore @@ -14,8 +14,9 @@ BuildRequires: gcc Requires: crash >= 5.1.5 Patch0: crash-gcore-1.6.4-coredump-fix-building-failure-due-to-undefined-macro.patch -Patch1: 0001-gcore-update-set_context-with-upstream-counterpart.patch -Patch2: 0001-x86-fix-the-issue-that-core-files-for-64-bit-tasks-a.patch +Patch1: 0001-x86-fix-extend-gcore.so-taking-much-time-like-more-t.patch +Patch2: 0001-gcore-update-set_context-with-upstream-counterpart.patch +Patch3: 0001-x86-fix-the-issue-that-core-files-for-64-bit-tasks-a.patch %description Command for creating a core dump file of a user-space task that was @@ -38,9 +39,8 @@ install -m 0755 -t %{buildroot}%{_libdir}/crash/extensions %{_builddir}/%{repona %license COPYING %changelog -* Tue Aug 05 2025 Kevin Lyons - 1.6.4-8.1 -- x86: fix the issue that core files for 64-bit tasks are generated in the 32-bit format -- gcore: update set_context with upstream counterpart +* Mon May 5 2025 Tao Liu - 1.6.4-9 +- rebase to latest upstream e03ff7341a * Tue Oct 29 2024 Troy Dawson - 1.6.4-8 - Bump release for October 2024 mass rebuild: diff --git a/sources b/sources new file mode 100644 index 0000000..59061c9 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (crash-gcore-command-1.6.4.tar.gz) = 5799337cea3459e122f6ed3a3c8a375ff950477d00a46bc0428e1771dd6d99d4c3470f2514c1b299ab403bbe0b1b46b169243d581ea54ec6109ad42aa7aa3406