diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-02-27 10:19:45 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-02-27 10:19:45 -0300 |
commit | b2e0f084eca03613ce55dcbcac11bb58821f7b2d (patch) | |
tree | f29131e6280464b0a9b28237a0af66390476fb6d | |
parent | 461f61ebaf8f31080f8e57656ce59b54ce5c97bd (diff) | |
download | pahole-b2e0f084eca03613ce55dcbcac11bb58821f7b2d.tar.gz |
syscse: cus__load_files() requires a non NULL conf_load
Since ff7bd7083f36db80 ("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: ff7bd7083f36db80 ("core: Allow sizing the loader hash table")
Reported-by: J B <jb.1234abcd@gmail.com>
Link: https://lore.kernel.org/dwarves/CAJXMFhFbv5MccigKvmQt9MhYwKv2iyigEG3Bhs64BZ=PMWc0WQ@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | syscse.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -18,6 +18,12 @@ static const char *prefix = "sys_"; static size_t prefix_len = 4; +static struct conf_fprintf conf; + +static struct conf_load conf_load = { + .conf_fprintf = &conf, +}; + static bool filter(struct function *f) { if (f->proto.nr_parms != 0) { @@ -156,7 +162,7 @@ int main(int argc, char *argv[]) argp_help(&argp, stderr, ARGP_HELP_SEE, argv[0]); return EXIT_FAILURE; } - err = cus__load_files(cus, NULL, argv + remaining); + err = cus__load_files(cus, &conf_load, argv + remaining); if (err != 0) { cus__fprintf_load_files_err(cus, "syscse", argv + remaining, err, stderr); return EXIT_FAILURE; |