Skip to content

Commit b2e0f08

Browse files
committed
syscse: 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: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f4b1ed in dwarf__load_file (cus=0x4052a0, conf=0x0, filename=0x7fffffffe4c3 "bla") at /home/acme/git/pahole/dwarf_loader.c:3626 3626 if (conf->max_hashtable_bits != 0) { (gdb) bt #0 0x00007ffff7f4b1ed in dwarf__load_file (cus=0x4052a0, conf=0x0, filename=0x7fffffffe4c3 "bla") at /home/acme/git/pahole/dwarf_loader.c:3626 #1 0x00007ffff7f310f5 in cus__load_file (cus=0x4052a0, conf=0x0, filename=0x7fffffffe4c3 "bla") at /home/acme/git/pahole/dwarves.c:2074 #2 0x00007ffff7f31ca1 in cus__load_files (cus=0x4052a0, conf=0x0, filenames=0x7fffffffe1c0) at /home/acme/git/pahole/dwarves.c:2577 #3 0x000000000040177a in main (argc=2, argv=0x7fffffffe1b8) at /home/acme/git/pahole/syscse.c:159 (gdb) Fixes: ff7bd70 ("core: Allow sizing the loader hash table") 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 461f61e commit b2e0f08

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

syscse.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
static const char *prefix = "sys_";
1919
static size_t prefix_len = 4;
2020

21+
static struct conf_fprintf conf;
22+
23+
static struct conf_load conf_load = {
24+
.conf_fprintf = &conf,
25+
};
26+
2127
static bool filter(struct function *f)
2228
{
2329
if (f->proto.nr_parms != 0) {
@@ -156,7 +162,7 @@ int main(int argc, char *argv[])
156162
argp_help(&argp, stderr, ARGP_HELP_SEE, argv[0]);
157163
return EXIT_FAILURE;
158164
}
159-
err = cus__load_files(cus, NULL, argv + remaining);
165+
err = cus__load_files(cus, &conf_load, argv + remaining);
160166
if (err != 0) {
161167
cus__fprintf_load_files_err(cus, "syscse", argv + remaining, err, stderr);
162168
return EXIT_FAILURE;

0 commit comments

Comments
 (0)