On 3/30/21 8:10 AM, Arnaldo Carvalho de Melo wrote:
Em Mon, Mar 29, 2021 at 02:40:05PM -0300, Arnaldo Carvalho de Melo escreveu:
[acme@five pahole]$ ulimit -c 10000000
[acme@five pahole]$
[acme@five pahole]$ file tcp_bbr.o
tcp_bbr.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
[acme@five pahole]$ readelf -wi tcp_bbr.o | grep DW_AT_producer
<d> DW_AT_producer : (indirect string, offset: 0x4a97): GNU C89 10.2.1 20200723 (Red Hat 10.2.1-1) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -mindirect-branch=thunk-extern -mindirect-branch-register -mrecord-mcount -mfentry -march=x86-64 -g -O2 -std=gnu90 -p -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -falign-jumps=1 -falign-loops=1 -fno-asynchronous-unwind-tables -fno-jump-tables -fno-delete-null-pointer-checks -fno-allow-store-data-races -fstack-protector-strong -fno-var-tracking-assignments -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fstack-check=no -fconserve-stack -fcf-protection=none
[acme@five pahole]$ fullcircle tcp_bbr.o
/home/acme/bin/fullcircle: line 38: 3969006 Segmentation fault (core dumped) ${pfunct_bin} --compile $file > $c_output
/tmp/fullcircle.4XujnI.c:1435:2: error: unterminated comment
1435 | /* si
| ^
/tmp/fullcircle.4XujnI.c:1433:2: error: expected specifier-qualifier-list at end of input
1433 | u32 * saved_syn; /* 2184 8 */
| ^~~
codiff: couldn't load debugging info from /tmp/fullcircle.ZOVXGv.o
/home/acme/bin/fullcircle: line 40: 3969019 Segmentation fault (core dumped) ${codiff_bin} -q -s $file $o_output
[acme@five pahole]$
Both seem unrelated to what you've done here, I'm investigating it now.
The fullcircle one, that crashes at the 'codiff' utility is related to
the patch that makes dwarf_cu to allocate space for the hash tables, as
you introduced a destructor for the dwarf_cu hashtables and the dwarf_cu
that was assigned to cu->priv was a local variable, which wasn't much of
a problem because we were not freeing it, as it went away at each loop
iteration, the following patch to that first patch in the series seems
to cure it, I'm folding it into your patch + a commiter note.
Thanks for the fix!
- Arnaldo
diff --git a/dwarf_loader.c b/dwarf_loader.c
index 5a1e860da079e04c..3e7875d4ab577f1b 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -150,6 +150,18 @@ static int dwarf_cu__init(struct dwarf_cu *dcu)
return 0;
}
[...]