Auto sync2gitlab import of crash-gcore-command-1.6.3-1.el8.src.rpm
This commit is contained in:
parent
9c55ae8acc
commit
d22a5b6737
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/crash-gcore-command-1.6.3.tar.gz
|
@ -0,0 +1,53 @@
|
||||
From 4731ebf085fe6322ba8c7ca14918d3cab2186cf0 Mon Sep 17 00:00:00 2001
|
||||
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
Date: Fri, 25 Feb 2022 04:45:37 -0500
|
||||
Subject: [PATCH 1/3] coredump: use MEMBER_{OFFSET, SIZE} instead of
|
||||
GCORE_{OFFSET, SIZE}
|
||||
|
||||
fill_auxv_note() and compat_fill_auxv_note() is called just once each
|
||||
time gcore command is invoked because each process has just one
|
||||
NT_AUXV. This means using MEMBER_{OFFSET, SIZE} is enough; using
|
||||
GCORE_{OFFSET, SIZE} is overkill.
|
||||
|
||||
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
---
|
||||
src/libgcore/gcore_coredump.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/libgcore/gcore_coredump.c b/src/libgcore/gcore_coredump.c
|
||||
index 3d0c0fcce61e..6f57b21b62b6 100644
|
||||
--- a/src/libgcore/gcore_coredump.c
|
||||
+++ b/src/libgcore/gcore_coredump.c
|
||||
@@ -930,11 +930,11 @@ fill_auxv_note(struct elf_note_info *info, struct task_context *tc,
|
||||
ulong *auxv;
|
||||
int i;
|
||||
|
||||
- auxv = (ulong *)GETBUF(GCORE_SIZE(mm_struct_saved_auxv));
|
||||
+ auxv = (ulong *)GETBUF(MEMBER_SIZE("mm_struct", "saved_auxv"));
|
||||
|
||||
readmem(task_mm(tc->task, FALSE) +
|
||||
- GCORE_OFFSET(mm_struct_saved_auxv), KVADDR, auxv,
|
||||
- GCORE_SIZE(mm_struct_saved_auxv), "fill_auxv_note",
|
||||
+ MEMBER_OFFSET("mm_struct", "saved_auxv"), KVADDR, auxv,
|
||||
+ MEMBER_SIZE("mm_struct", "saved_auxv"), "fill_auxv_note",
|
||||
gcore_verbose_error_handle());
|
||||
|
||||
i = 0;
|
||||
@@ -956,11 +956,11 @@ compat_fill_auxv_note(struct elf_note_info *info,
|
||||
uint32_t *auxv;
|
||||
int i;
|
||||
|
||||
- auxv = (uint32_t *)GETBUF(GCORE_SIZE(mm_struct_saved_auxv));
|
||||
+ auxv = (uint32_t *)GETBUF(MEMBER_SIZE("mm_struct", "saved_auxv"));
|
||||
|
||||
readmem(task_mm(tc->task, FALSE) +
|
||||
- GCORE_OFFSET(mm_struct_saved_auxv), KVADDR, auxv,
|
||||
- GCORE_SIZE(mm_struct_saved_auxv), "fill_auxv_note32",
|
||||
+ MEMBER_OFFSET("mm_struct", "saved_auxv"), KVADDR, auxv,
|
||||
+ MEMBER_SIZE("mm_struct", "saved_auxv"), "fill_auxv_note32",
|
||||
gcore_verbose_error_handle());
|
||||
|
||||
i = 0;
|
||||
--
|
||||
2.30.2
|
||||
|
@ -0,0 +1,59 @@
|
||||
From 6f4357340807f70bd1999f0b88435361c583f0b9 Mon Sep 17 00:00:00 2001
|
||||
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
Date: Fri, 25 Feb 2022 04:51:06 -0500
|
||||
Subject: [PATCH 2/3] gcore, defs: remove definitions and initializations for
|
||||
saved_auxv entries of offset and size tables
|
||||
|
||||
saved_auxv entries of offset and size tables are now not used in the
|
||||
source code by the previous commit. Let's remove definitions and
|
||||
initializations for them.
|
||||
|
||||
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
---
|
||||
src/gcore.c | 2 --
|
||||
src/libgcore/gcore_defs.h | 2 --
|
||||
2 files changed, 4 deletions(-)
|
||||
|
||||
diff --git a/src/gcore.c b/src/gcore.c
|
||||
index 5b78d9980887..f86b15f8a9f6 100644
|
||||
--- a/src/gcore.c
|
||||
+++ b/src/gcore.c
|
||||
@@ -371,7 +371,6 @@ static void gcore_offset_table_init(void)
|
||||
GCORE_MEMBER_OFFSET_INIT(mm_struct_arg_end, "mm_struct", "arg_end");
|
||||
GCORE_MEMBER_OFFSET_INIT(mm_struct_map_count, "mm_struct", "map_count");
|
||||
GCORE_MEMBER_OFFSET_INIT(mm_struct_reserved_vm, "mm_struct", "reserved_vm");
|
||||
- GCORE_MEMBER_OFFSET_INIT(mm_struct_saved_auxv, "mm_struct", "saved_auxv");
|
||||
GCORE_MEMBER_OFFSET_INIT(mm_struct_saved_files, "mm_struct", "saved_files");
|
||||
GCORE_MEMBER_OFFSET_INIT(mm_struct_context, "mm_struct", "context");
|
||||
GCORE_MEMBER_OFFSET_INIT(pid_level, "pid", "level");
|
||||
@@ -520,7 +519,6 @@ static void gcore_size_table_init(void)
|
||||
{
|
||||
GCORE_STRUCT_SIZE_INIT(i387_union, "i387_union");
|
||||
GCORE_STRUCT_SIZE_INIT(mm_context_t, "mm_context_t");
|
||||
- GCORE_MEMBER_SIZE_INIT(mm_struct_saved_auxv, "mm_struct", "saved_auxv");
|
||||
GCORE_MEMBER_SIZE_INIT(mm_struct_saved_files, "mm_struct", "saved_files");
|
||||
GCORE_MEMBER_SIZE_INIT(thread_struct_ds, "thread_struct", "ds");
|
||||
GCORE_MEMBER_SIZE_INIT(thread_struct_es, "thread_struct", "es");
|
||||
diff --git a/src/libgcore/gcore_defs.h b/src/libgcore/gcore_defs.h
|
||||
index df87851d23a1..3233ea533ca0 100644
|
||||
--- a/src/libgcore/gcore_defs.h
|
||||
+++ b/src/libgcore/gcore_defs.h
|
||||
@@ -1072,7 +1072,6 @@ struct gcore_offset_table
|
||||
long mm_struct_arg_end;
|
||||
long mm_struct_map_count;
|
||||
long mm_struct_reserved_vm;
|
||||
- long mm_struct_saved_auxv;
|
||||
long mm_struct_saved_files;
|
||||
long mm_struct_context;
|
||||
long pid_level;
|
||||
@@ -1148,7 +1147,6 @@ struct gcore_offset_table
|
||||
struct gcore_size_table
|
||||
{
|
||||
long mm_context_t;
|
||||
- long mm_struct_saved_auxv;
|
||||
long mm_struct_saved_files;
|
||||
long thread_struct_ds;
|
||||
long thread_struct_es;
|
||||
--
|
||||
2.30.2
|
||||
|
128
0003-gcore-fix-memory-allocation-failure-during-processin.patch
Normal file
128
0003-gcore-fix-memory-allocation-failure-during-processin.patch
Normal file
@ -0,0 +1,128 @@
|
||||
From 4cb65a0d9168778d120920418b968d05da10989f Mon Sep 17 00:00:00 2001
|
||||
From: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
Date: Fri, 25 Feb 2022 04:59:48 -0500
|
||||
Subject: [PATCH 3/3] gcore: fix memory allocation failure during processing
|
||||
NT_AUXV note
|
||||
|
||||
For crash dumps generated using kernel-4.18.0-365.el8 or later on
|
||||
CentOS stream 8, crash gcore command fails as follows:
|
||||
|
||||
crash> gcore -v 7 -f 128 10604
|
||||
gcore: Opening file core.10604.test-dumpfilter ...
|
||||
gcore: done.
|
||||
gcore: Writing ELF header ...
|
||||
gcore: done.
|
||||
gcore: Retrieving and writing note information ...
|
||||
gcore: zero-size memory allocation! (called from 7fd558ce1e05)
|
||||
Failed.
|
||||
|
||||
This memory allocation failure occurs in fill_auxv_note() that creates
|
||||
NT_AUXV note due to saved_auxv entries of size and offset tables are
|
||||
somehow 0.
|
||||
|
||||
This is because during the merge of the upstream kernel commit
|
||||
1c33bb0507508af24fd754dd7123bd8e997fab2f (x86/elf: Support a new ELF
|
||||
aux vector AT_MINSIGSTKSZ), location of saved_auxv of struct mm_struct
|
||||
has been moved as workaround in order to avoid kABI breakage.
|
||||
|
||||
Fix this by using RHEL-specific location for saved_auxv if there is
|
||||
member rh_reserved_saved_auxv in struct mm_struct.
|
||||
|
||||
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
|
||||
---
|
||||
src/libgcore/gcore_coredump.c | 54 +++++++++++++++++++++++++++++------
|
||||
1 file changed, 46 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/libgcore/gcore_coredump.c b/src/libgcore/gcore_coredump.c
|
||||
index 6f57b21b62b6..c14cc116e951 100644
|
||||
--- a/src/libgcore/gcore_coredump.c
|
||||
+++ b/src/libgcore/gcore_coredump.c
|
||||
@@ -18,6 +18,10 @@
|
||||
|
||||
static struct elf_note_info *elf_note_info_init(void);
|
||||
|
||||
+static void get_auxv_size_addr(struct task_context *tc,
|
||||
+ size_t *size,
|
||||
+ ulong *addr);
|
||||
+
|
||||
static void fill_prstatus_note(struct elf_note_info *info,
|
||||
struct task_context *tc,
|
||||
struct memelfnote *memnote);
|
||||
@@ -923,18 +927,49 @@ compat_fill_prstatus_note(struct elf_note_info *info,
|
||||
|
||||
#endif /* GCORE_ARCH_COMPAT */
|
||||
|
||||
+static void get_auxv_size_addr(struct task_context *tc,
|
||||
+ size_t *psize,
|
||||
+ ulong *paddr)
|
||||
+{
|
||||
+ size_t size;
|
||||
+ ulong addr;
|
||||
+
|
||||
+ if (MEMBER_EXISTS("mm_struct", "rh_reserved_saved_auxv")) {
|
||||
+ ulong mm_rh;
|
||||
+
|
||||
+ size = MEMBER_SIZE("mm_struct_rh", "saved_auxv");
|
||||
+ readmem(task_mm(tc->task, FALSE) + MEMBER_OFFSET("mm_struct", "mm_rh"),
|
||||
+ KVADDR,
|
||||
+ &mm_rh,
|
||||
+ sizeof(mm_rh),
|
||||
+ "mm_struct mm_rh",
|
||||
+ gcore_verbose_error_handle());
|
||||
+ addr = mm_rh + MEMBER_OFFSET("mm_struct_rh", "saved_auxv");
|
||||
+ } else {
|
||||
+ size = MEMBER_SIZE("mm_struct", "saved_auxv");
|
||||
+ addr = task_mm(tc->task, FALSE) +
|
||||
+ MEMBER_OFFSET("mm_struct", "saved_auxv");
|
||||
+ }
|
||||
+
|
||||
+ *psize = size;
|
||||
+ *paddr = addr;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
fill_auxv_note(struct elf_note_info *info, struct task_context *tc,
|
||||
struct memelfnote *memnote)
|
||||
{
|
||||
ulong *auxv;
|
||||
+ ulong addr;
|
||||
+ size_t size;
|
||||
int i;
|
||||
|
||||
- auxv = (ulong *)GETBUF(MEMBER_SIZE("mm_struct", "saved_auxv"));
|
||||
+ get_auxv_size_addr(tc, &size, &addr);
|
||||
|
||||
- readmem(task_mm(tc->task, FALSE) +
|
||||
- MEMBER_OFFSET("mm_struct", "saved_auxv"), KVADDR, auxv,
|
||||
- MEMBER_SIZE("mm_struct", "saved_auxv"), "fill_auxv_note",
|
||||
+ auxv = (ulong *)GETBUF(size);
|
||||
+
|
||||
+ readmem(addr, KVADDR, auxv,
|
||||
+ size, "fill_auxv_note",
|
||||
gcore_verbose_error_handle());
|
||||
|
||||
i = 0;
|
||||
@@ -954,13 +989,16 @@ compat_fill_auxv_note(struct elf_note_info *info,
|
||||
struct memelfnote *memnote)
|
||||
{
|
||||
uint32_t *auxv;
|
||||
+ ulong addr;
|
||||
+ size_t size;
|
||||
int i;
|
||||
|
||||
- auxv = (uint32_t *)GETBUF(MEMBER_SIZE("mm_struct", "saved_auxv"));
|
||||
+ get_auxv_size_addr(tc, &size, &addr);
|
||||
+
|
||||
+ auxv = (uint32_t *)GETBUF(size);
|
||||
|
||||
- readmem(task_mm(tc->task, FALSE) +
|
||||
- MEMBER_OFFSET("mm_struct", "saved_auxv"), KVADDR, auxv,
|
||||
- MEMBER_SIZE("mm_struct", "saved_auxv"), "fill_auxv_note32",
|
||||
+ readmem(addr, KVADDR, auxv,
|
||||
+ size, "fill_auxv_note32",
|
||||
gcore_verbose_error_handle());
|
||||
|
||||
i = 0;
|
||||
--
|
||||
2.30.2
|
||||
|
123
crash-gcore-command.spec
Normal file
123
crash-gcore-command.spec
Normal file
@ -0,0 +1,123 @@
|
||||
#
|
||||
# crash core analysis suite
|
||||
#
|
||||
%global reponame crash-gcore
|
||||
Summary: Gcore extension module for the crash utility
|
||||
Name: crash-gcore-command
|
||||
Version: 1.6.3
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2
|
||||
Group: Development/Debuggers
|
||||
Source: https://github.com/fujitsu/crash-gcore/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
URL: https://github.com/fujitsu/crash-gcore
|
||||
# Vendor: FUJITSU LIMITED
|
||||
# Packager: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
|
||||
ExclusiveOS: Linux
|
||||
ExclusiveArch: x86_64 %{ix86} arm aarch64 ppc64 ppc64le
|
||||
Buildroot: %{_tmppath}/%{name}-root
|
||||
BuildRequires: crash-devel >= 5.1.5, zlib-devel lzo-devel snappy-devel
|
||||
Requires: crash >= 5.1.5
|
||||
Patch0: 0001-coredump-use-MEMBER_-OFFSET-SIZE-instead-of-GCORE_-O.patch
|
||||
Patch1: 0002-gcore-defs-remove-definitions-and-initializations-fo.patch
|
||||
Patch2: 0003-gcore-fix-memory-allocation-failure-during-processin.patch
|
||||
|
||||
%description
|
||||
Command for creating a core dump file of a user-space task that was
|
||||
running in a kernel dumpfile.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{reponame}-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%build
|
||||
make CFLAGS="%{optflags} -Wl,-z,now" -C src -f gcore.mk
|
||||
|
||||
%install
|
||||
rm -Rf $RPM_BUILD_ROOT
|
||||
mkdir -p %{buildroot}%{_libdir}/crash/extensions/
|
||||
cp %{_builddir}/%{reponame}-%{version}/src/gcore.so %{buildroot}%{_libdir}/crash/extensions/
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
rm -Rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/crash/extensions/gcore.so
|
||||
%doc COPYING
|
||||
|
||||
%changelog
|
||||
* Mon Feb 28 2022 Lianbo Jiang <lijiang@redhat.com> - 1.6.3-1
|
||||
- Rebase to upstream crash-gcore-command-1.6.3
|
||||
- Fix memory allocation failure issue
|
||||
- Resolves: rhbz#2054066
|
||||
|
||||
* Wed Dec 2 2020 Bhupesh Sharma <bhsharma@redhat.com> - 1.6.0-1
|
||||
- Rebase crash-gcore-command to github upstream version crash-gcore-command-1.6.0
|
||||
Resolves: rhbz#1903465
|
||||
|
||||
* Wed Jul 8 2020 Bhupesh Sharma <bhsharma@redhat.com> - 1.5.1-1
|
||||
- Rebase crash-gcore-command to github upstream version crash-gcore-command-1.5.1
|
||||
Resolves: rhbz#1851747
|
||||
|
||||
* Tue Jun 25 2019 Dave Anderson <anderson@redhat.com> - 1.3.1-4
|
||||
- Fix "invalid structure size: pid_link"
|
||||
Resolves: rhbz#1722726
|
||||
|
||||
* Tue Dec 4 2018 Dave Anderson <anderson@redhat.com> - 1.3.1-3
|
||||
- Fix x86_64 "invalid structure member offset: thread_struct_fs"
|
||||
Resolves: rhbz#1589019
|
||||
- Fix arm64 "invalid structure member offset: thread_struct_fpsimd_state"
|
||||
Resolves: rhbz#1625810
|
||||
|
||||
* Wed Sep 10 2018 Dave Anderson <anderson@redhat.com> - 1.3.1-2
|
||||
- Address annocheck link issue
|
||||
Resolves: rhbz#1630556
|
||||
|
||||
* Mon Aug 13 2018 Dave Anderson <anderson@redhat.com> - 1.3.1-1
|
||||
- Bump release for mass rebuild
|
||||
Resolves: rhbz#1615509
|
||||
|
||||
* Thu Nov 6 2014 Dave Anderson <anderson@redhat.com> - 1.3.1-0
|
||||
- Rebase to 1.3.1 to address 32-bit x86 build error.
|
||||
- Resolves: rhbz#1077311
|
||||
|
||||
* Tue Nov 4 2014 Dave Anderson <anderson@redhat.com> - 1.3.0-0
|
||||
- Add aarch64 support
|
||||
- Resolves: rhbz#1077311
|
||||
- Add ppc64/ppc64le support
|
||||
- Resolves: rhbz#1125485
|
||||
|
||||
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.2.1-2
|
||||
- Mass rebuild 2013-12-27
|
||||
|
||||
|
||||
* Tue Aug 20 2013 Dave Anderson <anderson@redhat.com> - 1.2.1-1
|
||||
crash utility has added LZO and snappy compression in addition to zlib.
|
||||
|
||||
* Thu May 23 2013 HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> - 1.2.1-0
|
||||
Fixes for missing VDSO and vsyscall pages in core dump.
|
||||
|
||||
* Wed Nov 21 2012 HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> - 1.2-0
|
||||
Support recent kernels around 3.6.
|
||||
|
||||
* Tue Jan 31 2012 Dave Anderson <anderson@redhat.com> - 1.0-3
|
||||
Address Pkgwrangler/rpmlint issues.
|
||||
Resolves: rbhz#692799
|
||||
|
||||
* Wed Jan 25 2012 Dave Anderson <anderson@redhat.com> - 1.0-2
|
||||
Compile with RPM_OPT_FLAGS and fix warnings generated from using it.
|
||||
Resolves: rbhz#692799
|
||||
|
||||
* Thu Apr 13 2011 HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> - 1.0-1
|
||||
- Remove inclusion of kvmdump.h and unwind_x86_64.h due to non-supporting issue
|
||||
on crash-devel package. Instead, use a new interface for them.
|
||||
- Remove ppc64, ia64, s390 and s390x from ExclusiveArch, leave x86_64
|
||||
and %%{ix86} there.
|
||||
- Add descriptions in BuildRequires and Requires about crash and crash-devel.
|
||||
|
||||
* Wed Apr 6 2011 HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> - 1.0-0
|
||||
- Initial crash-gcore-command package
|
||||
|
Loading…
Reference in New Issue
Block a user