import CS dwarves-1.30-1.el9

This commit is contained in:
eabdullin 2025-09-15 11:54:05 +00:00
parent 3a9f35b39e
commit e4e73a303e
5 changed files with 41 additions and 139 deletions

View File

@ -1 +1 @@
a9bbb201925e4b58e73fc17eedbfd5484d101e97 SOURCES/dwarves-1.27.tar.xz
44240d08c7858d760dcc02cc5e64f77d6771ef6b SOURCES/dwarves-1.30.tar.xz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/dwarves-1.27.tar.xz
SOURCES/dwarves-1.30.tar.xz

View File

@ -1,83 +0,0 @@
From 6a2b27c0f512619b0e7a769a18a0fb05bb3789a5 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Tue, 18 Jun 2024 10:37:30 -0300
Subject: [PATCH] core: Initialize cu->node with INIT_LIST_HEAD()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In cu__new() zalloc() is used defensively, and that helped catch this
problem where we assume that a cu us in the cus list of cu instances,
but that is not the case when we use cus__merge_and_process_cu(), for
instance when loading files created by clang with LTO, as reported by
Peter Jung and narrowed down by Nathan Chancellor.
If we use INIT_LIST_HEAD() in cu__new() to initialize cu->node, which is
what we do with other lists and nodes there, then the unconditional
removal using list_del_init() will be a no-op and removing something not
on the cus list of cu instances will not cause problems, just keep an
unconsistent cus->nr_entries field.
So lets just have this fix in first, keeping Nathan's Tested-by and then
do the a bit more involved fix of either adding that cu to the cus list
or checking at removal time if it is there.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f1e13e in __list_del (prev=0x0, next=0x0) at /home/acme/git/pahole/list.h:106
106 next->prev = prev;
(gdb) bt
#0 0x00007ffff7f1e13e in __list_del (prev=0x0, next=0x0) at /home/acme/git/pahole/list.h:106
#1 0x00007ffff7f1e176 in list_del_init (entry=0x417980) at /home/acme/git/pahole/list.h:165
#2 0x00007ffff7f1f8f9 in __cus__remove (cus=0x4142a0, cu=0x417980) at /home/acme/git/pahole/dwarves.c:527
#3 0x00007ffff7f1f92b in cus__remove (cus=0x4142a0, cu=0x417980) at /home/acme/git/pahole/dwarves.c:533
#4 0x00007ffff7f3d01c in cus__finalize (cus=0x4142a0, cu=0x417980, conf=0x4133c0 <conf_load>, thr_data=0x0)
at /home/acme/git/pahole/dwarf_loader.c:3040
#5 0x00007ffff7f3e05c in cus__merge_and_process_cu (cus=0x4142a0, conf=0x4133c0 <conf_load>, mod=0x415cf0, dw=0x416110, elf=0x414380,
filename=0x7fffffffe3f7 "cast_common.ko", build_id=0x416680 "\265D\371U\213\373u|\037\250\242\032\271\365⒜]y\023", build_id_len=20,
type_dcu=0x0) at /home/acme/git/pahole/dwarf_loader.c:3482
#6 0x00007ffff7f3e218 in cus__load_module (cus=0x4142a0, conf=0x4133c0 <conf_load>, mod=0x415cf0, dw=0x416110, elf=0x414380,
filename=0x7fffffffe3f7 "cast_common.ko") at /home/acme/git/pahole/dwarf_loader.c:3521
#7 0x00007ffff7f3e396 in cus__process_dwflmod (dwflmod=0x415cf0, userdata=0x415d00, name=0x415ea0 "cast_common.ko", base=65536,
arg=0x7fffffffde40) at /home/acme/git/pahole/dwarf_loader.c:3581
#8 0x00007ffff7eb4609 in dwfl_getmodules (dwfl=0x414300, callback=0x7ffff7f3e2ec <cus__process_dwflmod>, arg=0x7fffffffde40, offset=0)
at ../libdwfl/dwfl_getmodules.c:86
#9 0x00007ffff7f3e4c5 in cus__process_file (cus=0x4142a0, conf=0x4133c0 <conf_load>, fd=3, filename=0x7fffffffe3f7 "cast_common.ko")
at /home/acme/git/pahole/dwarf_loader.c:3647
#10 0x00007ffff7f3e5cd in dwarf__load_file (cus=0x4142a0, conf=0x4133c0 <conf_load>, filename=0x7fffffffe3f7 "cast_common.ko")
at /home/acme/git/pahole/dwarf_loader.c:3684
#11 0x00007ffff7f232df in cus__load_file (cus=0x4142a0, conf=0x4133c0 <conf_load>, filename=0x7fffffffe3f7 "cast_common.ko")
at /home/acme/git/pahole/dwarves.c:2134
#12 0x00007ffff7f23e8b in cus__load_files (cus=0x4142a0, conf=0x4133c0 <conf_load>, filenames=0x7fffffffe0f0)
at /home/acme/git/pahole/dwarves.c:2637
#13 0x000000000040aec0 in main (argc=2, argv=0x7fffffffe0e8) at /home/acme/git/pahole/pahole.c:3805
(gdb) fr 1
#1 0x00007ffff7f1e176 in list_del_init (entry=0x417980) at /home/acme/git/pahole/list.h:165
165 __list_del(entry->prev, entry->next);
(gdb) p entry
$1 = (struct list_head *) 0x417980
(gdb) p entry->next
$2 = (struct list_head *) 0x0
(gdb) p entry->prev
$3 = (struct list_head *) 0x0
Closes: https://github.com/acmel/dwarves/issues/53
Closes: https://gitlab.archlinux.org/archlinux/packaging/packages/pahole/-/issues/1
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/all/20240617210810.GA1877676@thelio-3990X
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
dwarves.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dwarves.c b/dwarves.c
index 1ec259f5..823a0152 100644
--- a/dwarves.c
+++ b/dwarves.c
@@ -739,6 +739,7 @@ struct cu *cu__new(const char *name, uint8_t addr_size,
cu->dfops = NULL;
INIT_LIST_HEAD(&cu->tags);
INIT_LIST_HEAD(&cu->tool_list);
+ INIT_LIST_HEAD(&cu->node);
cu->addr_size = addr_size;
cu->extra_dbg_info = 0;

View File

@ -1,46 +0,0 @@
From 94a01bde592c555b3eb526aeb4c2ad695c5660d8 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Tue, 18 Jun 2024 11:14:09 -0300
Subject: [PATCH] dwarf_loader: Add missing cus__add(cus, cu) to
cus__merge_and_process_cu()
In cus__finalize() if cu__finalize() returns LSK__DELETE, i.e. if the
tool processing the cu is done with it, we will assume that it is in the
cus list of cu instances, remove it and then delete it.
This was not being done by cus__merge_and_process_cu(), used when
merging all DWARF CUs into a single 'struct cu', such as when processing
binaries generated by clang using LTO.
Add the missing cus__add() to keep cus->nr_entries consistent.
Cc: Alan Maguire <alan.maguire@oracle.com>
Cc: Daniel Xu <dxu@dxuuu.xyz>
Cc: Domenico Andreoli <cavok@debian.org>
Cc: Dominique Leuenberger <dimstar@opensuse.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Jan Alexander Steffens <heftig@archlinux.org>
Cc: Jan Engelhardt <jengelh@inai.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Matthias Schwarzott <zzam@gentoo.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Viktor Malik <vmalik@redhat.com>
Cc: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/all/ZnGZ71a4E29kPrvS@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
dwarf_loader.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dwarf_loader.c b/dwarf_loader.c
index b832c93c..3caf3245 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -3452,6 +3452,7 @@ static int cus__merge_and_process_cu(struct cus *cus, struct conf_load *conf,
cu->priv = dcu;
cu->dfops = &dwarf__ops;
cu->language = attr_numeric(cu_die, DW_AT_language);
+ cus__add(cus, cu);
}
Dwarf_Die child;

View File

@ -2,16 +2,12 @@
%define libver 1
Name: dwarves
Version: 1.27
Release: 2%{?dist}
Version: 1.30
Release: 1%{?dist}
License: GPLv2
Summary: Debugging Information Manipulation Tools (pahole & friends)
URL: http://acmel.wordpress.com
Source: http://fedorapeople.org/~acme/dwarves/%{name}-%{version}.tar.xz
# core: Initialize cu->node with INIT_LIST_HEAD()
Patch: https://github.com/acmel/dwarves/commit/6a2b27c0f512619b0e7a769a18a0fb05bb3789a5.patch
# dwarf_loader: Add missing cus__add(cus, cu) to cus__merge_and_process_cu()
Patch: https://github.com/acmel/dwarves/commit/94a01bde592c555b3eb526aeb4c2ad695c5660d8.patch
Requires: %{libname}%{libver} = %{version}-%{release}
BuildRequires: gcc
BuildRequires: cmake >= 2.8.12
@ -84,8 +80,9 @@ rm -Rf %{buildroot}
%files
%doc README.ctracer
%doc README.btf
%doc changes-v1.26
%doc changes-v1.27
%doc changes-v1.28
%doc changes-v1.29
%doc changes-v1.30
%doc NEWS
%{_bindir}/btfdiff
%{_bindir}/codiff
@ -137,6 +134,40 @@ rm -Rf %{buildroot}
%{_libdir}/%{libname}_reorganize.so
%changelog
* Fri Jun 20 2025 Gregory Bell <grbell@redhat.com> - 1.30-1
- New release: 1.30
- Better detection of abort during DWARF loader thread processing
- pahole now detects presence of libbpf APIs and BTF features using weak function
declarations when built using a shared library libbpf
- Type tags are emitted for BPF arena pointers with new BTF "attributes" feature
- New release: 1.29
- Multithreading is now in the DWARF loader using a jobs queue and a pool of worker threads.
- The BTF encoding now is always reproducible, and as fast/faster than before.
- The memory consumption is reduced.
- Support for multiple BTF_DECL_TAGs pointing to same tag.
- Verify that pfunct prints btf_decl_tags read from BTF.
- Don't print functions twice when using 'pfunct -f function_name'.
- New release: 1.28
- Various improvements to reduce the memory footprint of pahole, notably when doing BTF encoding.
- Show flexible arrays statistics
- Add '--padding N' and '--padding_ge N' to show structs with paddings
- Introduce --running_kernel_vmlinux to find a vmlinux that matches the build-id of the running kernel.
- Don't stop pfunct output at the first function that matches a filter, show all of them
- Allow encoding data about all global variables, not just per CPU ones
- Handle .BTF_ids section endianness, fully supporting cross builds
- Generate decl tags for bpf_fastcall for eligible kfuncs
- Add "distilled_base" BTF feature to split BTF generation.
- Use the ELF_C_READ_MMAP mode with libelf, reducing peak memory utilization
- Allow overriding /sys/kernel/btf/vmlinux via the PAHOLE_VMLINUX_BTF_FILENAME env var
- Allow setting the list of compile units via PAHOLE_LANG_EXCLUDE env var
- Serialize access to elfutils dwarf_getlocation().
- Honour --lang_exclude when merging LTO built CUs.
- Add the debuginfod client cache directory to the vmlinux search path.
- Print the CU's language when a tag isn't supported.
- Initial support for GNU_formal_parameter_pack, GNU_template_parameter_pack, template_value_param and template_type_param DWARF tags.
- Improve the parameter parsing by checking DW_OP_[GNU_]entry_value
- Introduce a tests/ directory with regression tests
* Mon Aug 12 2024 Davide Cavalca <dcavalca@centosproject.org> - 1.27-2
- Backport upstream bugfixes for clang builds
Resolves: RHEL-54022