Skip to content

Commit f86ed77

Browse files
committed
dtagnames: cus__load_files() requires a non NULL conf_load
Since ff7bd70 ("core: Allow sizing the loader hash table") dwarf__load_files(), called by cus__load_files() needs a non-NULL conf_load argument, add one to avoid a core dump. With the fix: $ dtagnames vmlinux | sort | uniq -c | sort -nr 8793952 member 2214363 formal_parameter 1707497 pointer_type 1397044 structure_type 1101747 enumerator 819003 variable 671032 subroutine_type 441683 inlined_subroutine 432020 lexical_block 340042 subprogram 335456 typedef 264541 array_type 208998 const_type 194379 union_type 132403 enumeration_type 41631 base_type 29098 label 4941 volatile_type 4 restrict_type $ J B reported this for syscse, which led me to do a quick audit to find this other case. Reported-by: J B <[email protected]> Link: https://lore.kernel.org/dwarves/CAJXMFhFbv5MccigKvmQt9MhYwKv2iyigEG3Bhs64BZ=PMWc0WQ@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent b2e0f08 commit f86ed77

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: dtagnames.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
#include "dwarves.h"
1212
#include "dutil.h"
1313

14+
static struct conf_fprintf conf;
15+
16+
static struct conf_load conf_load = {
17+
.conf_fprintf = &conf,
18+
};
19+
1420
static int class__tag_name(struct tag *tag, struct cu *cu __maybe_unused,
1521
void *cookie __maybe_unused)
1622
{
@@ -40,7 +46,7 @@ int main(int argc __maybe_unused, char *argv[])
4046
}
4147
dwarves__resolve_cacheline_size(NULL, 0);
4248

43-
err = cus__load_files(cus, NULL, argv + 1);
49+
err = cus__load_files(cus, &conf_load, argv + 1);
4450
if (err != 0) {
4551
cus__fprintf_load_files_err(cus, "dtagnames", argv + 1, err, stderr);
4652
goto out;

0 commit comments

Comments
 (0)