Re: [linus:master] [perf dsos] 7a9418cf7f: util/dsos.c:184:8: runtime error: null pointer passed as argument 2, which is declared to never be null
From: Namhyung Kim
Date: Wed Jun 19 2024 - 14:37:35 EST
Hello,
On Mon, Jun 17, 2024 at 9:45 PM kernel test robot <oliver.sang@xxxxxxxxx> wrote:
>
>
>
> Hello,
>
> kernel test robot noticed "util/dsos.c:184:8: runtime error: null pointer passed as argument 2, which is declared to never be null" on:
>
> commit: 7a9418cf7f05a74cbc9d4c750ee1bfddaa11f121 ("perf dsos: Switch hand crafted code to bsearch()")
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
>
> [test failed on linus/master a3e18a540541325a8c8848171f71e0d45ad30b2c]
> [test failed on linux-next/master 6906a84c482f098d31486df8dc98cead21cce2d0]
>
>
>
> the issue can be reproduced by below commands:
>
> $ sudo make WERROR=0 ARCH= DEBUG=1 EXTRA_CFLAGS='-fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address'
> $ sudo ./perf record -e 'cpu/branch-instructions/' -- sleep 1
> util/dsos.c:184:8: runtime error: null pointer passed as argument 2, which is declared to never be null
It seems we need to return early from the function when
dsos->dsos is NULL since there's nothing to search.
Thanks,
Namhyung
>
>
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <oliver.sang@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-lkp/202406180932.84be448c-oliver.sang@xxxxxxxxx
>
>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
>
>