On Thu, Feb 17, 2022 at 10:57 AM Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote: > > On Thu, Feb 17, 2022 at 10:55 AM sunyucong@xxxxxxxxx > <sunyucong@xxxxxxxxx> wrote: > > > > > Should it be: > > > bpf_object__close(obj); > > > obj = NULL: > > > > No, the actual crash is caused by this line: > > https://github.com/kernel-patches/bpf/blob/bpf-next/tools/testing/selftests/bpf/prog_tests/core_reloc.c#L896 > > > > When run_btfgen fails, the obj contains uninitialized data and then > > bpf_object__close(obj) crashes. > > > Martin's point is that you have to NULL out obj so that on the next > iteration this doesn't crash again. I'll fix it up while applying. But I actually ended up replacing two goto cleanup with continue (there is no clean up to do). And adjusted commit message to reflect that. Applied to bpf-next, thanks for the fix!