Re: [PATCH bpf-next v4 1/2] bpftool: Fix gen object segfault

From: kernel test robot
Date: Wed Dec 11 2024 - 04:49:52 EST


Hi Rong,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bpf-next/master]

url: https://github.com/intel-lab-lkp/linux/commits/Rong-Tao/libbpf-linker-Avoid-using-object-file-as-both-input-and-output/20241206-100435
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/tencent_B497E42A7CAF94A35B88EB060E42A2593408%40qq.com
patch subject: [PATCH bpf-next v4 1/2] bpftool: Fix gen object segfault
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241211/202412111714.9jJxt9x6-lkp@xxxxxxxxx/reproduce)

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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412111714.9jJxt9x6-lkp@xxxxxxxxx/

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

PERF_VERSION = 6.13.rc1.g228582f448e8
gen.c: In function 'do_object':
>> gen.c:1927:9: warning: 'linker' may be used uninitialized [-Wmaybe-uninitialized]
1927 | bpf_linker__free(linker);
| ^~~~~~~~~~~~~~~~~~~~~~~~
gen.c:1879:28: note: 'linker' was declared here
1879 | struct bpf_linker *linker;
| ^~~~~~
--
gen.c: In function 'do_object':
>> gen.c:1927:9: warning: 'linker' may be used uninitialized [-Wmaybe-uninitialized]
1927 | bpf_linker__free(linker);
| ^~~~~~~~~~~~~~~~~~~~~~~~
gen.c:1879:28: note: 'linker' was declared here
1879 | struct bpf_linker *linker;
| ^~~~~~
gen.c: In function 'do_object':
>> gen.c:1927:9: warning: 'linker' may be used uninitialized [-Wmaybe-uninitialized]
1927 | bpf_linker__free(linker);
| ^~~~~~~~~~~~~~~~~~~~~~~~
gen.c:1879:28: note: 'linker' was declared here
1879 | struct bpf_linker *linker;
| ^~~~~~
gen.c: In function 'do_object':
>> gen.c:1927:9: warning: 'linker' may be used uninitialized [-Wmaybe-uninitialized]
1927 | bpf_linker__free(linker);
| ^~~~~~~~~~~~~~~~~~~~~~~~
gen.c:1879:28: note: 'linker' was declared here
1879 | struct bpf_linker *linker;
| ^~~~~~

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki